Recent Changes Printable View Page History Edit Page

To create a new translation, start with an installation of OpenBiblio in the language you're translating from. For examples in this how-to, I'll assume you're starting with English.

First, you need to copy all of the files under locale/en to a new directory called locale/xx, where 'xx' is the code you want to use for your locale. There is no current standard for choosing these codes. In the future, we will probably use a lowercase language code followed by an underscore and an uppercase country code, e.g en_US, en_UK, de_DE. But right now most translations just use a lowercase, 2-letter county code.

Once you have your new locale directory, you need to edit locale/xx/metadata.php and change 'English' to the name of your locale. From that point on, you should be able to select your new locale in OpenBiblio's admin section.

Most of the work of the translation is translating the strings in the other php files under locale/xx. Essentially, each of the top-level directories in an OpenBiblio installation (admin, catalog, classes, etc.) has a corresponding translation file (locale/xx/admin.php, locale/xx/cataloging.php, locale/xx/classes.php, etc.) that contains the translation text for that part of OpenBiblio. Those files contain lines like this:

  $trans["adminSubmit"]              = "\$text = 'Submit';";

The text in double-quotes on the left ("adminSubmit") is how OpenBiblio finds the translated message -- don't change it. The text in single quotes on the right ('Submit') is the translated message -- this is what you need to change.

Once you are satisfied with your translation, and are ready to share it with the world, put the locale/xx directory into a zip, tar.gz, or tar.bz2 archive and post it to the Patch Tracker.

Topics not covered here (FIXME)

  • Translating SQL files for domain tables
  • Messages with parameters
  • Pluralization for numeric parameters
  • Testing your translation on install
  • Changing the Currency see this discussion
  • Finding and fixing translation bugs. Locale-Patch for 0.7.1, fixes errors and incomplete translation.
SourceForge.net Logo
Edit Page - Page History - Printable View - Recent Changes - Search
Page last modified on December 13, 2012, at 12:51 PM