From: "Mariusz Pękala" Date: 2007-09-14T02:05:20+09:00 Subject: Re: newbie: ruby and i18n (java-like approach) --gj572EiMnwbLXET9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-09-13 06:46:08 +0900 (Thu, Sep), Klaus Eckenfellner wrote: > i am very new to ruby and tried to I18Ns my applications (ruby-scripts > and rails-applications). for that task i found to approaches: > * GETTEXT > * GLOBALIZE >=20 > but in my point of view both tools have contras. >=20 > GETTEXT: PO-files must be converted to MO-files. therefore everytime a > translation is edited, i need to create new MO-files. Or am I wrong? >=20 > GLOBALIZE: in my opinion there are things that should be stored in a > database and things that shouldn't be stored in a database. translation > information should NOT be stored in a database. >=20 > what i am interested in: is there a possibilty / tool to use a more > java-like approach to i18n in ruby? >=20 > if you don't know java-i18n: > * file-based > * translations are organized via keys > * keys are stored in files: basename_LOCALE.properties ... for example > basename_EN.properties includes all translations for en. > * dynamic content can be mixed with translations using > "{X}"-placeholders... useful for a text like "you deleted 200 files" > (200 is dynamic *gg*) I don't know much about how Java does this (and the tutorial you provided seems to be a good reading for many cold and sleepless nights) but it may be that you will like the GLoc library by David Barri: http://rubyforge.org/projects/gloc/ It can everything you pointed, and in addition you can translate single symbol into 'you deleted 200 files' and 'you deleted one file', depending on the integer value you pass to translate. --=20 No virus found in this outgoing message. Checked by 'grep -i virus $MESSAGE' Trust me. --gj572EiMnwbLXET9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7-ecc0.1.6 (GNU/Linux) iD8DBQFG6W1FsnU0scoWZKARAuYqAJoCVI6xwQwvh3KW7K92nNdq8etswQCgwK7o 9ol3Iwp06dQgZJbINOS4P8M= =osMa -----END PGP SIGNATURE----- --gj572EiMnwbLXET9--