|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +# verbose and exit on error |
| 4 | +set -xe |
| 5 | + |
| 6 | +# import GPG keys |
| 7 | +gpg --import /gpg/nextcloud-bot.public.asc |
| 8 | +gpg --allow-secret-key-import --import /gpg/nextcloud-bot.asc |
| 9 | +gpg --list-keys |
| 10 | + |
| 11 | +# fetch git repo |
| 12 | +git clone [email protected]:nextcloud/notes-ios /app |
| 13 | +git checkout -b develop origin/develop |
| 14 | + |
| 15 | +# remove all translations (they are added afterwards anyways but allows to remove languages via transifex) |
| 16 | +rm -r Source/*.lproj/Localizable.strings |
| 17 | +rm -r Source/*.lproj/Main_iPhone.strings |
| 18 | +rm -r Source/*.lproj/Categories.strings |
| 19 | +rm -r Source/Settings.bundle/*.lproj/Root.strings |
| 20 | +rm -r Source/Screens/Settings/*.lproj/Settings.strings |
| 21 | + |
| 22 | +git checkout -- Source/en.lproj/Localizable.strings |
| 23 | +git checkout -- Source/en.lproj/Main_iPhone.strings |
| 24 | +git checkout -- Source/en.lproj/Categories.strings |
| 25 | +git checkout -- Source/Settings.bundle/en.lproj/Root.strings |
| 26 | +git checkout -- Source/Screens/Settings/en.lproj/Settings.strings |
| 27 | + |
| 28 | + |
| 29 | +# push sources |
| 30 | +tx push -s |
| 31 | + |
| 32 | +# pull translations |
| 33 | +tx pull -f -a --minimum-perc=25 |
| 34 | + |
| 35 | + |
| 36 | +# use de_DE instead of de |
| 37 | +rm -rf Source/de.lproj/Localizable.strings |
| 38 | +rm -rf Source/de.lproj/Main_iPhone.strings |
| 39 | +rm -rf Source/de.lproj/Categories.strings |
| 40 | +rm -rf Source/Settings.bundle/de.lproj/Root.strings |
| 41 | +rm -rf Source/Screens/Settings/de.lproj/Settings.strings |
| 42 | + |
| 43 | +mv Source/de_DE.lproj/Localizable.strings Source/de.lproj/Localizable.strings |
| 44 | +mv Source/de_DE.lproj/Main_iPhone.strings Source/de.lproj/Main_iPhone.strings |
| 45 | +mv Source/de_DE.lproj/Categories.strings Source/de.lproj/Categories.strings |
| 46 | +mv Source/Settings.bundle/de_DE.lproj/Root.strings Source/Settings.bundle/de.lproj/Root.strings |
| 47 | +mv Source/Screens/Settings/de_DE.lproj/Settings.strings Source/Screens/Settings/de.lproj/Settings.strings |
| 48 | + |
| 49 | +# create git commit and push it |
| 50 | +git add . |
| 51 | +git commit -am "[tx-robot] updated from transifex" || true |
| 52 | +git push origin develop |
| 53 | +echo "done" |
0 commit comments