summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwadronaut <kwadronaut@autistici.org>2023-07-18 17:06:34 +0200
committerkwadronaut <kwadronaut@autistici.org>2023-07-18 17:06:34 +0200
commitf1a8d894579b77f96e333d8621fa5e9e8999e838 (patch)
treeb814c13e7d78785f7a976c470c421f6d286bf48d
parentf1f70d33c76acc3f437a563235d2989ab500d7c2 (diff)
Add Turkish and Dutch, fix .tx flow
-rw-r--r--.tx/config4
-rwxr-xr-xscripts/prepareForTx.py107
-rw-r--r--src/README.md27
-rw-r--r--src/custom/fastlane/metadata/nl/full_description.txt3
-rw-r--r--src/custom/fastlane/metadata/nl/short_description.txt1
-rw-r--r--src/custom/fastlane/metadata/nl/store-meta-nl.json5
-rw-r--r--src/custom/fastlane/metadata/nl/title.txt1
-rw-r--r--src/normal/fastlane/metadata/nl/full_description.txt (renamed from src/normal/fastlane/metadata/nl-NL/full_description.txt)0
-rw-r--r--src/normal/fastlane/metadata/nl/short_description.txt (renamed from src/normal/fastlane/metadata/nl-NL/short_description.txt)0
-rw-r--r--src/normal/fastlane/metadata/nl/store-meta-nl.json5
-rw-r--r--src/normal/fastlane/metadata/nl/title.txt (renamed from src/normal/fastlane/metadata/nl-NL/title.txt)0
-rw-r--r--src/normal/fastlane/metadata/tr/full_description.txt12
-rw-r--r--src/normal/fastlane/metadata/tr/short_description.txt2
-rw-r--r--src/normal/fastlane/metadata/tr/store-meta-tr.json5
-rw-r--r--src/normal/fastlane/metadata/tr/title.txt1
-rw-r--r--src/normal/fastlane/metadata/tr/tx-values-tr.json1
16 files changed, 171 insertions, 3 deletions
diff --git a/.tx/config b/.tx/config
index fb2da86d..66127f4a 100644
--- a/.tx/config
+++ b/.tx/config
@@ -7,13 +7,13 @@ lang_map = es_AR: es-rAR, fa_IR: fa-rIR, kn_IN: kn-rIN, pt_BR: pt-rBR, pt_PT: pt
source_file = se.leap.bitmasakclient.json
type = KEYVALUEJSON
resource_name = Bitmask details in Appstore
-file_filter = bitmaskclient/google/<lang>-strings.json
+file_filter = src/normal/fastlane/metadata/<lang>/store-meta-<lang>.json
minimum_perc = 96
[o:otf:p:bitmask:r:riseupvpn-playstore-listing]
source_file = se.leap.riseupvpn-desc.json
type = KEYVALUEJSON
resource_name = RiseupVPN details in Appstore
-file_filter = riseupvpn/google/<lang>-strings.json
+file_filter = src/custom/fastlane/metadata/<lang>/store-meta-<lang>.json
minimum_perc = 96
diff --git a/scripts/prepareForTx.py b/scripts/prepareForTx.py
new file mode 100755
index 00000000..c683c84a
--- /dev/null
+++ b/scripts/prepareForTx.py
@@ -0,0 +1,107 @@
+#!/usr/bin/env python3
+""
+__author__ = "kwadronaut"
+__copyright__ = "Copyright 2023, LEAP"
+__license__ = "GPL3 or later3 or later3 or later"
+__version__ = "1"
+
+import os
+import re
+import argparse
+import json
+
+# Set the path to the res directory containing different language folders
+main_res_dir = "../app/src/main/res"
+custom_res_dir = "../app/src/custom/res"
+
+# List all valid locale folders in the res directory
+def list_locales(app_type):
+ locales = []
+ if app_type == "main":
+ res_dir = main_res_dir
+ elif app_type == "custom":
+ res_dir = custom_res_dir
+ else:
+ raise ValueError("Invalid app type. Use 'main' or 'custom'.")
+
+ valid_locale_pattern = re.compile(r'^values-(?P<language>[a-z]{2})(-(?P<script>[a-zA-Z]{4}))?(-r(?P<region>[a-zA-Z]{2}))?$')
+ for folder in os.listdir(res_dir):
+ if valid_locale_pattern.match(folder):
+ locale_code = valid_locale_pattern.match(folder).group(0)
+ locales.append(locale_code)
+ return locales
+
+# Create empty JSON file for each locale metadata directory
+# If there's no file, tx will skip the translations
+def create_metadata_files(locales, app_type):
+ if app_type == "main":
+ metadata_dir = "../src/normal/fastlane/metadata"
+ elif app_type == "custom":
+ metadata_dir = "../src/custom/fastlane/metadata"
+ else:
+ raise ValueError("Invalid app type. Use 'main' or 'custom'.")
+
+ for locale_code in locales:
+ # Remove "values-" prefix from the locale directory name
+ locale_dir_name = locale_code.replace("values-", "")
+ file_path = os.path.join(metadata_dir, locale_dir_name, f"store-meta-{locale_dir_name}.json")
+ if not os.path.exists(file_path): # Check if the file already exists
+ os.makedirs(os.path.dirname(file_path), exist_ok=True)
+ with open(file_path, "w", encoding="utf-8") as file:
+ file.write("{}") # Write an empty JSON object to the file
+
+# Split JSON data and save to separate files for each locale
+def split_json_and_save(locales, metadata_dir):
+ for locale_code in locales:
+ locale_dir_name = locale_code.replace("values-", "")
+ json_file_path = os.path.join(metadata_dir, locale_dir_name, f"store-meta-{locale_dir_name}.json")
+
+ if os.path.exists(json_file_path):
+ with open(json_file_path, "r", encoding="utf-8") as json_file:
+ json_data = json.load(json_file)
+
+ title = json_data.get("title")
+ full_description = json_data.get("full_description")
+ short_description = json_data.get("short_description")
+
+ if title:
+ title_file_path = os.path.join(metadata_dir, locale_dir_name, "title.txt")
+ with open(title_file_path, "w", encoding="utf-8") as title_file:
+ title_file.write(title)
+
+ if full_description:
+ full_description_file_path = os.path.join(metadata_dir, locale_dir_name, "full_description.txt")
+ with open(full_description_file_path, "w", encoding="utf-8") as full_description_file:
+ full_description_file.write(full_description)
+
+ if short_description:
+ short_description_file_path = os.path.join(metadata_dir, locale_dir_name, "short_description.txt")
+ with open(short_description_file_path, "w", encoding="utf-8") as short_description_file:
+ short_description_file.write(short_description)
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(description='Create metadata directories and empty JSON files for different locales.')
+ parser.add_argument('app_type', choices=['main', 'custom'], help='Type of the app (main or custom)')
+ args = parser.parse_args()
+
+ if args.app_type == "main":
+ metadata_dir = "../src/normal/fastlane/metadata"
+ elif args.app_type == "custom":
+ metadata_dir = "../src/custom/fastlane/metadata"
+ else:
+ raise ValueError("Invalid app type. Use 'main' or 'custom'.")
+
+ locales_list = list_locales(args.app_type)
+ if locales_list:
+ print("List of Locales:")
+ for locale_code in locales_list:
+ print(locale_code)
+
+ create_metadata_files(locales_list, args.app_type)
+ print(f"Empty JSON files created for each locale in the '{args.app_type}' app.")
+
+ split_json_and_save(locales_list, metadata_dir)
+ print(f"JSON data split and saved to separate files for each locale in the '{args.app_type}' app.")
+ else:
+ print(f"No valid locales found in the '{args.app_type}' app's 'res' directory.")
+
diff --git a/src/README.md b/src/README.md
index 7b669e77..9ff6e1a8 100644
--- a/src/README.md
+++ b/src/README.md
@@ -1,17 +1,42 @@
# Updating l10n, metadata, f-droid, google play store
+
# F-Droid compatible fastlane metadata directory
This source folder only contains the generated metadata for f-droid builds for both Bitmask and a custom flavored client.
Currently neither F-Droid nor Fastlane support metadata dirs directly within build flavor dirs of a module, like
`/<module>/src/<buildFlavor>/fastlane/metadata/android/` (which would be preferable).
+Transifex wants 1 file, play store wants 1 file, fastlane uses text files.
Keep an eye on this [issue](https://gitlab.com/fdroid/fdroidserver/-/issues/829) to track the state of the fastlane improvements for F-Droid.
-#How to update and go forward:
+## Updating l10n'ed app store listings
+
+1. Fetch content from google play (en_US) with scripts/fetch-play-metadata.py
+1. Check if there are changes with what fastlane creates in src/normal/fastlane/metadata/..
+1. Use scripts/prepareForTx.py to check what localized app versions exist in the Android app, prepare for transifex upload
+1. tx push se.leap.riseupvpn-desc.json -l en
+1. wait for localization, answer questions, fix wording. Repeat when necessary.
+1. Pull from transifex: tx pull -f --keep-new-files
+1. prepare for upload and store digestion: scripts/prepareForTx.py
+1. use fastlane to push to the google store
+
+## Notes:
+
+Translations that aren't completed (enough), won't be downloaded.
+The scripts create empty json files, because transifex needs them to even check.
+Keep your API tokens at hand.
+You need the tx cli client from transifex, pyton3, ptyhon3-babel
+
+## How to update FROM the google play store:
+
Install fastlane:
https://docs.fastlane.tools/getting-started/ios/setup/
update bundle
This will fetch the existing metadata. If you updated something through your browser, you can fetch that. There's no 'merge' functionality!
+You can also use this when adding a new provider.
fastlane supply init -j <YOUR-API-DETAILS.json> -p se.leap.<PROJECTNAME> -m src/custom/fastlane/metadata/
+
+apt install pythong3-babel
+
diff --git a/src/custom/fastlane/metadata/nl/full_description.txt b/src/custom/fastlane/metadata/nl/full_description.txt
new file mode 100644
index 00000000..0a365ed2
--- /dev/null
+++ b/src/custom/fastlane/metadata/nl/full_description.txt
@@ -0,0 +1,3 @@
+RiseupVPN is de gemakkelijke, snelle en veilige VPN van riseup.net. RiseupVPN heeft geen gebruikersaccount nodig, houdt geen logs bij en volgt je geen enkele manier. De dienst wordt volledig betaald door donaties van gebruikers zoals jij.
+
+https://riseup.net/vpn/donate \ No newline at end of file
diff --git a/src/custom/fastlane/metadata/nl/short_description.txt b/src/custom/fastlane/metadata/nl/short_description.txt
new file mode 100644
index 00000000..0e1b3573
--- /dev/null
+++ b/src/custom/fastlane/metadata/nl/short_description.txt
@@ -0,0 +1 @@
+RiseupVPN: anonieme VPN. Bitmask als motor. \ No newline at end of file
diff --git a/src/custom/fastlane/metadata/nl/store-meta-nl.json b/src/custom/fastlane/metadata/nl/store-meta-nl.json
new file mode 100644
index 00000000..d1923610
--- /dev/null
+++ b/src/custom/fastlane/metadata/nl/store-meta-nl.json
@@ -0,0 +1,5 @@
+{
+ "title": "RiseupVPN",
+ "full_description": "RiseupVPN is de gemakkelijke, snelle en veilige VPN van riseup.net. RiseupVPN heeft geen gebruikersaccount nodig, houdt geen logs bij en volgt je geen enkele manier. De dienst wordt volledig betaald door donaties van gebruikers zoals jij.\n\nhttps://riseup.net/vpn/donate",
+ "short_description": "RiseupVPN: anonieme VPN. Bitmask als motor."
+} \ No newline at end of file
diff --git a/src/custom/fastlane/metadata/nl/title.txt b/src/custom/fastlane/metadata/nl/title.txt
new file mode 100644
index 00000000..8d2e228a
--- /dev/null
+++ b/src/custom/fastlane/metadata/nl/title.txt
@@ -0,0 +1 @@
+RiseupVPN \ No newline at end of file
diff --git a/src/normal/fastlane/metadata/nl-NL/full_description.txt b/src/normal/fastlane/metadata/nl/full_description.txt
index a714dff0..a714dff0 100644
--- a/src/normal/fastlane/metadata/nl-NL/full_description.txt
+++ b/src/normal/fastlane/metadata/nl/full_description.txt
diff --git a/src/normal/fastlane/metadata/nl-NL/short_description.txt b/src/normal/fastlane/metadata/nl/short_description.txt
index dd626a6c..dd626a6c 100644
--- a/src/normal/fastlane/metadata/nl-NL/short_description.txt
+++ b/src/normal/fastlane/metadata/nl/short_description.txt
diff --git a/src/normal/fastlane/metadata/nl/store-meta-nl.json b/src/normal/fastlane/metadata/nl/store-meta-nl.json
new file mode 100644
index 00000000..61c9b38d
--- /dev/null
+++ b/src/normal/fastlane/metadata/nl/store-meta-nl.json
@@ -0,0 +1,5 @@
+{
+ "title": "Bitmask",
+ "full_description": "Bitmask is een VPN-client met automatische configuratie. Het kan verschillende technieken gebruiken om censuur, netwerkblokkades of surveillance te omzeilen. Nadat je een compatibele serviceprovider hebt gekozen, zal al je netwerkverkeer versleutelen en veilig via de serviceprovider van jou vertrouwen routeren.\n\nEn je kunt van start!\n\nBitmask is een open-source VPN-client, verspreid onder de GPLv3-licentie. Zie https://0xacab.org/leap/bitmask_android\n\nFAQ:\n\nwie: leap.se, een collectief dat sinds 2011 aan de slag is, gemotiveerd door het recht om te fluisteren.\nVertalingen worden zeer gewaardeerd in ons Transifex-project: https://app.transifex.com/otf/bitmask/dashboard/\nAls je problemen ervaart of de nieuwste versies wilt proberen, neem dan deel aan onze chat: https://matrix.to/#/#leap:libera.chat of stuur een bugrapport in: https://0xacab.org/leap/bitmask_android/",
+ "short_description": "Versleutelde communicatie voor stervelingen (superhelden zijn ook welkom)."
+} \ No newline at end of file
diff --git a/src/normal/fastlane/metadata/nl-NL/title.txt b/src/normal/fastlane/metadata/nl/title.txt
index a953d6a6..a953d6a6 100644
--- a/src/normal/fastlane/metadata/nl-NL/title.txt
+++ b/src/normal/fastlane/metadata/nl/title.txt
diff --git a/src/normal/fastlane/metadata/tr/full_description.txt b/src/normal/fastlane/metadata/tr/full_description.txt
new file mode 100644
index 00000000..b848b874
--- /dev/null
+++ b/src/normal/fastlane/metadata/tr/full_description.txt
@@ -0,0 +1,12 @@
+Bitmask otomatik yapılandırma kullanan bir VPN istemcisidir. Sansür ve ağ engellemesini aşmak veya izlenmekten kaçınmak için birçok yönetmi vardır. Uyumlu bir hizmet sağlayıcı seçtikten sonra tüm ağ trafiğinizi şifreler ve güvendiğiniz hizmet sağlayıcınız üzerinden güvenli bir şekilde yöneltir.
+
+Böylece kullanmaya başlayabilirsiniz!
+
+Bitmask açık kaynaklı bir VPN istemcisidir. GPLv3 lisansı koşulları altında dağıtılır: https://0xacab.org/leap/bitmask_android
+
+SSS
+
+* kim: leap.se, fısıldama hakkı kavramını seven bir kolektiftir, 2011 yılından beri ortalıktadır.
+* Çevirileri Transifex projemizde memnuniyetle karşılıyoruz: https://app.transifex.com/otf/bitmask/dashboard/
+
+Sorunlarla karşılaştıysanız veya güncel sürümü almak istiyorsanız, sohbetimize katılabilir https://matrix.to/#/#leap:libera.chat ya da bir hata bildiriminde bulunabilirsiniz: https://0xacab.org/leap/bitmask_android/ \ No newline at end of file
diff --git a/src/normal/fastlane/metadata/tr/short_description.txt b/src/normal/fastlane/metadata/tr/short_description.txt
new file mode 100644
index 00000000..4e042739
--- /dev/null
+++ b/src/normal/fastlane/metadata/tr/short_description.txt
@@ -0,0 +1,2 @@
+Sadece bir fani olanlar için şifrelenmiş iletişim
+(süper kahramanlar da hoş gelir) \ No newline at end of file
diff --git a/src/normal/fastlane/metadata/tr/store-meta-tr.json b/src/normal/fastlane/metadata/tr/store-meta-tr.json
new file mode 100644
index 00000000..88e09c4e
--- /dev/null
+++ b/src/normal/fastlane/metadata/tr/store-meta-tr.json
@@ -0,0 +1,5 @@
+{
+ "title": "Bitmask",
+ "full_description": "Bitmask otomatik yapılandırma kullanan bir VPN istemcisidir. Sansür ve ağ engellemesini aşmak veya izlenmekten kaçınmak için birçok yönetmi vardır. Uyumlu bir hizmet sağlayıcı seçtikten sonra tüm ağ trafiğinizi şifreler ve güvendiğiniz hizmet sağlayıcınız üzerinden güvenli bir şekilde yöneltir.\n\nBöylece kullanmaya başlayabilirsiniz!\n\nBitmask açık kaynaklı bir VPN istemcisidir. GPLv3 lisansı koşulları altında dağıtılır: https://0xacab.org/leap/bitmask_android\n\nSSS\n\n* kim: leap.se, fısıldama hakkı kavramını seven bir kolektiftir, 2011 yılından beri ortalıktadır.\n* Çevirileri Transifex projemizde memnuniyetle karşılıyoruz: https://app.transifex.com/otf/bitmask/dashboard/\n\nSorunlarla karşılaştıysanız veya güncel sürümü almak istiyorsanız, sohbetimize katılabilir https://matrix.to/#/#leap:libera.chat ya da bir hata bildiriminde bulunabilirsiniz: https://0xacab.org/leap/bitmask_android/",
+ "short_description": "Sadece bir fani olanlar için şifrelenmiş iletişim\n(süper kahramanlar da hoş gelir)"
+} \ No newline at end of file
diff --git a/src/normal/fastlane/metadata/tr/title.txt b/src/normal/fastlane/metadata/tr/title.txt
new file mode 100644
index 00000000..a953d6a6
--- /dev/null
+++ b/src/normal/fastlane/metadata/tr/title.txt
@@ -0,0 +1 @@
+Bitmask \ No newline at end of file
diff --git a/src/normal/fastlane/metadata/tr/tx-values-tr.json b/src/normal/fastlane/metadata/tr/tx-values-tr.json
new file mode 100644
index 00000000..9e26dfee
--- /dev/null
+++ b/src/normal/fastlane/metadata/tr/tx-values-tr.json
@@ -0,0 +1 @@
+{} \ No newline at end of file