newbie: ruby and i18n (java-like approach)

K

Klaus Eckenfellner

hi everybody!

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

but in my point of view both tools have contras.

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?

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.

what i am interested in: is there a possibilty / tool to use a more
java-like approach to i18n in ruby?

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*)

for a more detailed overview to java-i18n please consult:
http://java.sun.com/docs/books/tutorial/i18n/

hope you can help me ... please consider ... i am new to ruby *gg*
 
M

Mariusz Pękala

--gj572EiMnwbLXET9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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--
 
R

Richard Conroy

hi everybody!

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

There's at least 5 other tools that I am aware of.
but in my point of view both tools have contras.

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?

Can't comment specifically - not familiar with Gettext, but a compilation/build
stage is frequently required in most languages.
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.

Thats a pretty absolute statement. I would spend some time understanding
the advantages of using a DB for locale-specific content before ruling it out.
what i am interested in: is there a possibilty / tool to use a more
java-like approach to i18n in ruby?

if you don't know java-i18n:
<snip>
Having wasted too much time with java resource formats (including
compiled class files, text based hashes, write my own, etc.)
I would be loathe to seek out a java equivalent system in another
language. Java has superb encoding support, yet the APIs you depend
on for use of language resource files are exceedingly backward.

Having to escape non-ASCII characters in a UTF-8 file that DIY
java code can read normally is just not on. Sacrificing resource
legibility to avail of the resource lookup algorithm is compromising
too much for too little.
hope you can help me ... please consider ... i am new to ruby *gg*

Look further at i18n options in rails/ruby. There are some that try to
make it really easy.


 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top