Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

I18n guide

Jakub Suder edited this page May 30, 2014 · 10 revisions

For Hive developers

Adding a new language

  • in Xcode, select the Hive project in the file inspector (the item at the top)
  • in the "Info" tab, under "Localizations", click the "+" and select a language from the list
  • unselect the Info.plist files at the end (they're plist files from libraries like BitcoinKit, we don't want to touch those)
  • confirm and commit

Localizing a new XIB

After you add a new XIB (and get it to a reasonably stable state), you should translate it. To do that:

  • mark it as localized (in the right sidebar), so that it's moved to the en.lproj directory
  • go through the list of languages slowly and check each checkbox one by one (*)
  • add an empty .strings file next to the .xib and follow the same process in order to localize it
  • run the generate_strings.sh script to fill the .strings files with entries extracted from the .xib

Remember to also add a new resource to Transifex (replace "Something" with the xib name, and keep <lang> literal as is):

tx set --auto-local -r hive-osx.Something "Hive/Controllers/<lang>.lproj/Something.strings" -s en -t STRINGS --execute
./push_strings.sh -s -t -r hive-osx.Something

(*) This process is extremely annoying - if you know how to avoid it, or want to write a script to automate this, please do it.

Updating the .strings files

If you add new strings to a .xib file, run the ./generate_strings.sh script to update the relevant .strings files. Then, push them to Transifex with:

./push_strings.sh -s -r hive-osx.Something

If you change any existing English strings in a .xib, translators won't automatically know they have to update their versions too. If you want to force them to re-translate something, make sure the field's ID changes (e.g. by duplicating the field and deleting the original one).

Updating the translated XIB files

After you edit an English XIB - even if you don't change any strings - don't forget to run ./update_xibs.sh -f Something to update the translated versions.

Pulling changes from Transifex

To pull updated strings, run:

./pull_strings.sh

Add -l xx to pull only a specific language, and -a if you want to pull new languages too. Also, sometimes the tx tool gets confused by modification dates (if the strings have been updated locally) and ignores remote changes, in this case you need to add -f to make it overwrite all local files.

Check if everything looks right in the diff, if not, fix it and push the changes back.

After that, don't forget to update the XIBs with update_xibs.sh [-l xx] [-f Something].

For translators

Updating translations on Transifex

We use Transifex service to manage our translations. It lets us easily see what's translated and what isn't, what the translation progress is for each language, and lets people submit translations to us easily without having to know how to use GitHub or git.

To start translating, first you need an account there. Click "create free account" and complete the registration form. Then choose a language you want to help us with and request to be added to a language team. For existing languages this should be approved automatically, for new ones you'll need to wait for our confirmation (note: please select the most general language name if possible, e.g. "French" instead of "French (France)").

Then, once you're on the language page (e.g. German), scroll through the list to see which files are translated and which aren't. Pick one that isn't translated 100%, select it and click "Translate now". You will be brought to the main translation interface.

Once you're there, you will see a list of all entries from that file (English original + translated version). The translated ones have a checkmark √ on the left. You can look through the list to find the untranslated ones, or better, click the "untranslated" tab in the top right to show only the untranslated entries and hide the rest.

Then, simply go through them one by one, and for every entry fill the translated version field. After editing an entry press "Save", or press "Save all" once at the end.

A few tips:

  • some entries (e.g. "Email") often don't need to be translated, in that case you still need to mark them as translated, otherwise Transifex won't be sure what to do with them; the easiest way is to click the "Copy source string" button in the top right (an icon that looks like two documents)
  • the entries in the "Localizable" file (the biggest one) include some comments in the "Developer note" below the translation area which should explain in what context the text will be used
  • sometimes, when the text is similar to one previously translated, there will be some suggestions listed at the bottom of the page that can help you translate the current entry
  • the translation doesn't always need to be literal, just use common sense - keep the meaning and make it sound natural in your language, but it's ok if you drop some words or add new ones, or invert the order of sentences, etc.
  • make sure you keep the original punctuation, e.g. if there's a colon or a period at the end of the original text, keep it in the translated text (unless it really makes more sense to do it differently)

Submitting translation via GitHub

If you prefer to send us a translation as a pull request, you can do that too, just make sure you use the right language code (for new translations), use a proper encoding (UTF-8) and don't mess up the files somehow. The .strings files to be translated are in Hive/xx.lproj and Hive/Controllers/xx.lproj, where xx is your language code. Do NOT translate the .xib files - we will generate them automatically from the .strings files. (Although we'd really recommend giving Transifex a try, we use it ourselves too and it's really more convenient.)

Testing

One you update a translation, we usually pull it into the code at most a few days later, and it should almost always be included in the next public release. Please test it then and check if everything looks OK - it happens sometimes that some phrases are much longer (or shorter) in some languages than in English and they don't fit in the designated place, or that the changed order of fields makes things look funny, etc. Especially right-to-left languages can cause problems. If you notice anything that doesn't look right, let us know ([email protected]).

Credits

We try to list all translators in the box in the "About Hive" dialog, but it's sometimes hard to figure out who's who and who translated what. So if you've submitted a translation and you aren't included there, and you'd like to be, let us know (and tell us what name exactly we should put there).