Prev | Current Page 382 | Next

Brad Ediger

"Advanced Rails"


252 | Chapter 8: i18n and L10n
translator@example.com
(...)
Creado hello.po.
Now that the hello.po file is created, the translator will work through it and add
translations for each string:
locale/es/hello.po
# Spanish translations for PACKAGE package.
# Copyright (C) 2007 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Brad Ediger , 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2007-10-19 12:20-0500\n"
"PO-Revision-Date: 2007-10-19 12:27-0500\n"
"Last-Translator: Brad Ediger \n"
"Language-Team: Spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: hello.rb:9
msgid "Hello, world!"
msgstr "??Hola, mundo!"
When all strings have been translated, the translator ships off the .po files to the
developer. The developer then creates .mo files (binary translations of the .po files;
the binary versions are used directly by the application) using rmsgfmt from Rubygettext
(or msgfmt from GNU gettext). When doing local development, we set the
GETTEXT_PATH environment variable to look in our locale directory. If we didn??™t do
that, we would have to install our .mo files under a shared location such as /usr/
share/locale so that Ruby-gettext could find them at runtime.


Pages:
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394