Browse Source

Add export and import translation scripts

Closes: #430
master
Terry Yiu 2 years ago
committed by William Casarin
parent
commit
2ed17a2509
  1. 36
      README.md
  2. 1253
      damus Localizations/de_DE.xcloc/Localized Contents/de_DE.xliff
  3. 3
      devtools/export-source-translation.sh
  4. 8
      devtools/import-translation.sh
  5. 4
      transifex.yml
  6. 0
      translations/ar.xliff
  7. 0
      translations/de_AT.xliff
  8. 0
      translations/en-US.xcloc/Localized Contents/en-US.xliff
  9. 0
      translations/en-US.xcloc/Source Contents/damus/en-US.lproj/InfoPlist.strings
  10. 0
      translations/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings
  11. 0
      translations/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.stringsdict
  12. 0
      translations/en-US.xcloc/contents.json
  13. 0
      translations/es_419.xliff
  14. 0
      translations/fr_FR.xliff
  15. 0
      translations/it_IT.xliff
  16. 0
      translations/lv_LV.xliff
  17. 0
      translations/pt_PT.xliff
  18. 0
      translations/tr_TR.xliff

36
README.md

@ -91,13 +91,39 @@ damus implements the following [Nostr Implementation Possibilities][nips]
## Contributing ## Contributing
Contributors welcome! [Email patches][git-send-email] to jb55@jb55.com are preferred, but I accept PRs on github as well. Contributors welcome!
### Code
[Email patches][git-send-email] to jb55@jb55.com are preferred, but I accept PRs on GitHub as well.
[git-send-email]: http://git-send-email.io [git-send-email]: http://git-send-email.io
## git log bot ### Translations
npub1fjtdwclt9lspjy8huu3qklr7eklp5uq90u6yh8mec290pqxraccqlufnas Translators welcome! Join the [Transifex][transifex] project.
All user-facing strings must have a comment in order to provide context to translators. If a SwiftUI component has a `comment` parameter, use that. Otherwise, wrap your string with `NSLocalizedString` with the `comment` field populated.
[transifex]: https://explore.transifex.com/damus/damus-ios/
#### Export Source Translations
If user-facing strings have been added or changed, please export them for translation as part of your pull request or commit by running:
```zsh
./devtools/export-source-translation.sh
```
This command will export source translations to `translations/en-US.xcloc/Localized Contents/en-US.xliff`, which the Transifex integration will read from the `master` branch and allow translators to translate those strings.
#### Import Translations
Once 100% of strings have been translated for a given locale, Transifex will open up a pull request with the `translations/<locale>.xliff` file changed. Currently, it must be manually imported into the project before merging the pull request by running:
```zsh
./devtools/import-translation.sh <locale_code_in_snake_case>
```
### Awards ### Awards
@ -107,3 +133,7 @@ First contributors:
1. @randymcmillan 1. @randymcmillan
2. @jcarucci27 2. @jcarucci27
### git log bot
npub1fjtdwclt9lspjy8huu3qklr7eklp5uq90u6yh8mec290pqxraccqlufnas

1253
damus Localizations/de_DE.xcloc/Localized Contents/de_DE.xliff

File diff suppressed because it is too large

3
devtools/export-source-translation.sh

@ -0,0 +1,3 @@
#!/bin/zsh
xcodebuild -exportLocalizations -project damus.xcodeproj -localizationPath "translations" -exportLanguage en-US

8
devtools/import-translation.sh

@ -0,0 +1,8 @@
#!/bin/zsh
if [ -z "$*" ]; then
echo "Usage: ./devtools/import-translation.sh <locale_code_in_snake_case>"
return
fi
find "translations" -name "${1}.xliff" | grep -v "en-US.xliff" | xargs -I % xcodebuild -importLocalizations -project damus.xcodeproj -localizationPath %

4
transifex.yml

@ -3,8 +3,8 @@ git:
- filter_type: file - filter_type: file
file_format: XLIFF file_format: XLIFF
source_language: en_US source_language: en_US
source_file: damus Localizations/en-US.xcloc/Localized Contents/en-US.xliff source_file: translations/en-US.xcloc/Localized Contents/en-US.xliff
translation_files_expression: damus Localizations/<lang>.xcloc/Localized Contents/<lang>.xliff translation_files_expression: translations/<lang>.xliff
settings: settings:
pr_branch_name: transifex/<br_unique_id> pr_branch_name: transifex/<br_unique_id>

0
damus Localizations/ar.xcloc/Localized Contents/ar.xliff → translations/ar.xliff

0
damus Localizations/de_AT.xcloc/Localized Contents/de_AT.xliff → translations/de_AT.xliff

0
damus Localizations/en-US.xcloc/Localized Contents/en-US.xliff → translations/en-US.xcloc/Localized Contents/en-US.xliff

0
damus Localizations/en-US.xcloc/Source Contents/damus/en-US.lproj/InfoPlist.strings → translations/en-US.xcloc/Source Contents/damus/en-US.lproj/InfoPlist.strings

0
damus Localizations/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings → translations/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings

0
damus Localizations/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.stringsdict → translations/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.stringsdict

0
damus Localizations/en-US.xcloc/contents.json → translations/en-US.xcloc/contents.json

0
damus Localizations/es_419.xcloc/Localized Contents/es_419.xliff → translations/es_419.xliff

0
damus Localizations/fr_FR.xcloc/Localized Contents/fr_FR.xliff → translations/fr_FR.xliff

0
damus Localizations/it_IT.xcloc/Localized Contents/it_IT.xliff → translations/it_IT.xliff

0
damus Localizations/lv_LV.xcloc/Localized Contents/lv_LV.xliff → translations/lv_LV.xliff

0
damus Localizations/pt_PT.xcloc/Localized Contents/pt_PT.xliff → translations/pt_PT.xliff

0
damus Localizations/tr_TR.xcloc/Localized Contents/tr_TR.xliff → translations/tr_TR.xliff

Loading…
Cancel
Save