mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
3.0 KiB
Markdown
91 lines
3.0 KiB
Markdown
9 years ago
|
# Translations
|
||
|
|
||
7 years ago
|
## For Developers
|
||
9 years ago
|
|
||
7 years ago
|
### Localize User Facing Strings
|
||
9 years ago
|
|
||
7 years ago
|
Use the NSLocalizedString macros to mark any user facing strings as
|
||
|
localizable. See existing usages of this macro for examples.
|
||
9 years ago
|
|
||
7 years ago
|
### Extract Source Strings
|
||
9 years ago
|
|
||
7 years ago
|
To extract the latest translatable strings and comments from our local source
|
||
|
files into our english localization file:
|
||
9 years ago
|
|
||
7 years ago
|
bin/auto-genstrings
|
||
9 years ago
|
|
||
7 years ago
|
At this point you should see your new strings, untranslated in only the English
|
||
|
(en) localization.
|
||
|
|
||
|
Edit Signal/translations/en.lproj/Localizable.strings to translate your strings.
|
||
|
|
||
|
Commit these English translations with your work. Do not touch the non-english
|
||
|
localizations. Those are updated as part of our release process by Signal
|
||
|
Staff.
|
||
9 years ago
|
|
||
|
### Writing Good Translatable Strings
|
||
9 years ago
|
|
||
7 years ago
|
Be sure to include comments in your translations, and enforce that other
|
||
|
contributors do as well. Why comment? For example, in English these are
|
||
|
the same, but in Finnish the noun/verb are distinct.
|
||
|
|
||
|
#### English
|
||
9 years ago
|
|
||
|
/* Tab button label which takes you to view all your archived conversations */
|
||
|
ARCHIVE_HEADER="Archive"
|
||
8 years ago
|
|
||
9 years ago
|
/* Button label to archive the current conversation */
|
||
|
ARCHIVE_ACTION="Archive"
|
||
|
|
||
7 years ago
|
#### Finish
|
||
9 years ago
|
|
||
|
/* Tab button label which takes you to view all your archived conversations */
|
||
|
ARCHIVE_HEADER="Arkisto"
|
||
9 years ago
|
|
||
9 years ago
|
/* Button label to archive the current conversation */
|
||
|
ARCHIVE_ACTION="Arkistoi"
|
||
|
|
||
|
Context should also provide a hint as to how much text should be
|
||
|
provided. For example, is it an alert title, which can be a few words, a
|
||
|
button, which must be *very* short, or an alert message, which can be a
|
||
|
little longer?
|
||
|
|
||
7 years ago
|
## For Maintainers (Signal Staff)
|
||
|
|
||
7 years ago
|
Translations are solicited on Transifex[https://www.transifex.com/signalapp/signal-ios/]. We
|
||
7 years ago
|
upload our source language (US English) to Transifex, where our
|
||
|
translators can submit their translations. Before the app is released,
|
||
|
we pull their latest work into the code base.
|
||
|
|
||
|
## Fetch Translations
|
||
8 years ago
|
|
||
7 years ago
|
Generally you want to fetch the latest translations whenever releasing. The
|
||
|
exception being if you have recently changed lots of existing source strings
|
||
|
that haven't had a chance to be translated.
|
||
8 years ago
|
|
||
7 years ago
|
To fetch the latest translations:
|
||
|
|
||
|
bin/pull-translations
|
||
|
|
||
|
This imposes some limits on what localizations we include. For example,
|
||
|
we don't want to include languages until a substantial portion of the
|
||
|
app has been translated.
|
||
|
|
||
|
Sometimes you'll pull down a translation which isn't yet tracked by git.
|
||
|
This means that translation recently became sufficiently complete to
|
||
|
include in the project. As well as adding it to git, you need to update
|
||
|
the Xcode project to include the new localization.
|
||
8 years ago
|
|
||
|
### Upload Strings to be Translated
|
||
9 years ago
|
|
||
|
Make new source strings available to our translators by uploading them
|
||
8 years ago
|
to transifex. Immediately after uploading we also need to pull down the
|
||
|
updated translations. Granted, at this point the new strings will be in
|
||
|
English until translated, but English is preferable to the string name
|
||
|
like ARCHIVE_HEADER which we'd otherwise see.
|
||
|
|
||
|
To push the new source strings and then fetch the resultant translations:
|
||
9 years ago
|
|
||
8 years ago
|
bin/sync-translations
|
||
9 years ago
|
|