summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2022-07-29 12:19:01 +0200
committerAlbin <albin@mullvad.net>2022-07-29 12:19:01 +0200
commitc111e5169c8bbecb02c7f56d71c2362d7aa2d624 (patch)
tree0bbb032d11218c5d65df833799e54cf5474b4bc9
parentcbcf2cda7b0ff74bacbac83d660d22b66ebf9171 (diff)
parent2a0b9748ea4a8bcd46840f8d6f9432eb3dccaf85 (diff)
downloadmullvadvpn-c111e5169c8bbecb02c7f56d71c2362d7aa2d624.tar.xz
mullvadvpn-c111e5169c8bbecb02c7f56d71c2362d7aa2d624.zip
Merge branch 'add-sync-only-localization-script-option'
-rw-r--r--gui/locales/README.md18
-rwxr-xr-xscripts/localization9
2 files changed, 19 insertions, 8 deletions
diff --git a/gui/locales/README.md b/gui/locales/README.md
index bd40ce78e0..422a37fd6e 100644
--- a/gui/locales/README.md
+++ b/gui/locales/README.md
@@ -38,7 +38,18 @@ This is a folder with gettext translations for Mullvad VPN app.
1. Add the language to `SUPPORTED_LOCALE_LIST` in `app.tsx`.
-## Updating translations template
+## Sync localizations
+
+Use the localization script to sync localizations by running the following command from the
+root-directory:
+```
+./scripts/localization sync-local-files
+```
+
+It will sync `messages.pot` with localization strings in the desktop app and Android app to ensure
+all local files are in sync.
+
+## Prepare strings for Crowdin translation
Use the localization script to prepare the pot-files by running the following command from the
root-directory:
@@ -46,9 +57,8 @@ root-directory:
./scripts/localization prepare
```
-It will update `messages.pot` with localization strings from both the desktop app and Android app,
-and will update `relay-localizations.pot`. The changes to each file will also be committed
-individually.
+It will sync `messages.pot` with localization strings in the desktop app and Android app, and will
+update `relay-localizations.pot`. The changes to each file will also be committed individually.
## Uploading translations template to Crowdin
diff --git a/scripts/localization b/scripts/localization
index a35445a011..6d0f6ac104 100755
--- a/scripts/localization
+++ b/scripts/localization
@@ -12,8 +12,9 @@ function main {
prepare) prepare_localization_strings;;
upload) upload_to_crowdin;;
download) download_from_crowdin;;
+ sync-local-files) sync_localizations;;
"")
- echo "Available subcommands: prepare, upload and download"
+ echo "Available subcommands: prepare, upload, download and sync-local-files"
;;
*)
echo "Unknown parameter: $1"
@@ -22,7 +23,7 @@ function main {
esac
}
-function update_messages_pot {
+function sync_localizations {
# Update desktop strings in messages.pot
log_header "Extracting localization strings from desktop app source code"
pushd ../gui
@@ -70,7 +71,7 @@ function commit_changes {
}
function prepare_localization_strings {
- update_messages_pot
+ sync_localizations
commit_changes "Update messages.pot"
update_relay_locations_pot
@@ -97,7 +98,7 @@ function download_from_crowdin {
# Add new translations to Android xml-files
log_header "Updating Android xml-files with new translations"
- update_messages_pot
+ sync_localizations
commit_changes "Update translations"
}