¡@

Home 

2014/10/16 ¤W¤È 12:03:46

jquery Programming Glossary: i18n.t

Micropost character countdown (Rails Tutorial, 2nd Ed, Chapter 10, Exercise 7)

http://stackoverflow.com/questions/10955850/micropost-character-countdown-rails-tutorial-2nd-ed-chapter-10-exercise-7

for improvement refactoring here updateCountdownString remaining if remaining 1 or remaining is 0 .countdown .text I18n.t 'shared.micropost_form.characters_remaining.other' count remaining else if remaining is 1 .countdown .text I18n.t 'shared.micropost_form.characters_remaining.one'.. I18n.t 'shared.micropost_form.characters_remaining.other' count remaining else if remaining is 1 .countdown .text I18n.t 'shared.micropost_form.characters_remaining.one' count remaining else if remaining is 1 .countdown .text I18n.t 'shared.micropost_form.characters_over.one'.. I18n.t 'shared.micropost_form.characters_remaining.one' count remaining else if remaining is 1 .countdown .text I18n.t 'shared.micropost_form.characters_over.one' count remaining else .countdown .text I18n.t 'shared.micropost_form.characters_over.other'..

How to make i18n with Handlebars.js (mustache templates)?

http://stackoverflow.com/questions/7760332/how-to-make-i18n-with-handlebars-js-mustache-templates

process to do the localization on the fly Handler Handlebars.registerHelper 'I18n' function str return I18n undefined I18n.t str str Template script id my_template type x handlebars template div I18n myVar div script The primary advantage of this..