Confirmed users
1,209
edits
(moved updating locale files chapter under static l10n) |
|||
| Line 67: | Line 67: | ||
The full gettext manual is [http://www.gnu.org/software/gettext/manual/ available] and intimidating, but it will probably answer any other questions. | The full gettext manual is [http://www.gnu.org/software/gettext/manual/ available] and intimidating, but it will probably answer any other questions. | ||
==Dynamic Strings== | === Updating gettext files in the remora tree === | ||
These steps are most commonly executed in order. | |||
==== extracting ==== | |||
After l10n strings have been added to the PHP code files etc., they have to be extracted into gettext's .po files. There's a shell script that goes through the application source tree (.php and .thtml files) and searches for gettext strings. The extracted strings are stored into <code>./messages.po</code> . | |||
: Execute from the app dir: | |||
: <code>./locale/extract-po.sh</code> | |||
==== merging ==== | |||
To bring the respective .po files of the individual locales up to date, execute from the app directory: | |||
: <code>./locale/merge-po.sh messages.po ./locale</code> | |||
: where <code>messages.po</code> is the file created by the extraction step and <code>./locale</code> is the directory in which all the locales lie. The merge script will merge the new strings from messages.po into every *.po file underneath ./locale, then. | |||
Note that translations already made will not be overwritten. New tags will be inserted and strings that aren't used anymore will be deprecated (i.e. commented out and put at the end of the file). | |||
==== "compiling" ==== | |||
After translation, plain text .po files (PO = portable object) have to be translated into binary .mo files (MO = machine object). There's a third script you can run for that: | |||
: <code>./locale/compile-mo.sh ./locale</code> | |||
This will make a .mo file in the same directory of every .po file. | |||
== Dynamic Strings == | |||
We need strings from the database to be localizable as well. This includes all english content in the remora code (Categories, etc.) but also the addons themselves (title, description, etc.) | We need strings from the database to be localizable as well. This includes all english content in the remora code (Categories, etc.) but also the addons themselves (title, description, etc.) | ||
| Line 175: | Line 198: | ||
newDB.executeSql("delete from addons where id = ''targetAddonIDForDeletion''") | newDB.executeSql("delete from addons where id = ''targetAddonIDForDeletion''") | ||
newDB.executeManySql("delete from translations where id = %s", listOfTranslationsToDelete) | newDB.executeManySql("delete from translations where id = %s", listOfTranslationsToDelete) | ||