i18n questions

45 views
Skip to first unread message

Eric Ponce

unread,
Apr 29, 2013, 3:45:13 PM4/29/13
to ged...@googlegroups.com
Hello!

I'm trying to put some i18n on my web and i have some questions.

For example, I need static texts in spanish and english. Wich is the fast method to do it?
And how can I change the languaje?  I need 2 flags "english" and "spanish" and when the user clicks, the languaje changes.

Imagine this example:

Controller: Main.index

Index view with english default: <p>This is a sample text</p> and when the user clicks on the spanish flag -> <p> Esto es un texto de prueba </p>

thanks!!!!!

Matthew Eernisse

unread,
Apr 30, 2013, 2:36:37 PM4/30/13
to ged...@googlegroups.com
Check out the i18n section in the docs: http://geddyjs.org/documentation#i18n

Eric Ponce

unread,
May 2, 2013, 6:22:04 AM5/2/13
to ged...@googlegroups.com
Thanks but I've readed previusly the docu. These are my problems.
  1. I'vre created a folder in config/ called locale/
  2. I've created 1 file called es-es.json and other called en-us.json
  3. into the files I've writed the following code:
en-us.json and the same structure in es-es.json

{
  "hello": "Hello"
, "bye": "Bye bye"
}

In the view -> <%= i18n.t('hello')%>

But this only shows -> [[hello]] and if I change de default locale for "es-es" the result its the same: [[hello]]

What is wrong? thanks!!!

der_On

unread,
May 15, 2013, 3:07:18 AM5/15/13
to ged...@googlegroups.com
The folder under config must be named "locales".

Eric Ponce

unread,
May 15, 2013, 4:25:16 AM5/15/13
to ged...@googlegroups.com
I know, thanks! ;)
I have actually i18n working :)

edugg

unread,
May 30, 2013, 2:52:49 PM5/30/13
to ged...@googlegroups.com
Hi,

I'm bringing that topic up again because I have a similar problem with i18n and I think is not necessary to make a new one.

The problem is that "getText" function does nothing when I pass an optional locale, so for example, when I put this:

console.log(this.i18n.t('model.validatesPresent', {name: 'HOWDY'})); //returns ""HOWDY" is required."
console
.log(this.i18n.t('model.validatesPresent', {name: 'HOWDY'}, 'ja-jp')); // this also returns ""HOWDY" is required." and should return "「HOWDY」の入力が必要です。"

I'm working in a new app, and my geddy and node versions are:
geddy: 0.8.6
node: 0.10.8

Thanks for all!

Matthew Eernisse

unread,
Jun 23, 2013, 3:42:58 PM6/23/13
to ged...@googlegroups.com
Yes, y'all have found a bug in the i18n utility. The locale was set on instantiation, and didn't allow method-level overrides anymore.

This is fixed in Geddy v0.8.11. Thanks for catching this!
Reply all
Reply to author
Forward
0 new messages