aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-12-11 12:38:24 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-12-11 12:39:43 +0100
commit8fd4883d7e4648c23c299e31c2c78e1cd77f9c5f (patch)
tree47e3d034335eb96b2e5796d3bda8edbca1ab3dea
parentWireGuardKit: Let wireguard-go backend run in offline on macOS (diff)
downloadwireguard-apple-8fd4883d7e4648c23c299e31c2c78e1cd77f9c5f.tar.xz
wireguard-apple-8fd4883d7e4648c23c299e31c2c78e1cd77f9c5f.zip
WireGuardApp: modify xcodeproj when syncing translations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--WireGuard.xcodeproj/project.pbxproj61
-rwxr-xr-xsync-translations.sh55
2 files changed, 107 insertions, 9 deletions
diff --git a/WireGuard.xcodeproj/project.pbxproj b/WireGuard.xcodeproj/project.pbxproj
index 10a5912..30324fd 100644
--- a/WireGuard.xcodeproj/project.pbxproj
+++ b/WireGuard.xcodeproj/project.pbxproj
@@ -322,7 +322,6 @@
6F0F44C8222D55BB00B0FF04 /* TextCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextCell.swift; sourceTree = "<group>"; };
6F0F44CA222D55FD00B0FF04 /* EditableTextCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditableTextCell.swift; sourceTree = "<group>"; };
6F1075632258AE9800D78929 /* DeleteTunnelsConfirmationAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteTunnelsConfirmationAlert.swift; sourceTree = "<group>"; };
- 6F16F46F243DB55600AA141B /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = Sources/WireGuardApp/ja.lproj/Localizable.strings; sourceTree = "<group>"; };
6F19D30322402B8700A126F2 /* ConfirmationAlertPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmationAlertPresenter.swift; sourceTree = "<group>"; };
6F2449E7226587B80047B9E9 /* MacAppStoreUpdateDetector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacAppStoreUpdateDetector.swift; sourceTree = "<group>"; };
6F29A9422278518D00DC6A6B /* RecentTunnelsTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentTunnelsTracker.swift; sourceTree = "<group>"; };
@@ -359,8 +358,6 @@
6F8F0D7022258153000E8335 /* ActivateOnDemandViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivateOnDemandViewModel.swift; sourceTree = "<group>"; };
6F8F0D7322267AD2000E8335 /* ChevronCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChevronCell.swift; sourceTree = "<group>"; };
6F8F0D7622267C57000E8335 /* SSIDOptionEditTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSIDOptionEditTableViewController.swift; sourceTree = "<group>"; };
- 6F8F9C692441DBEF00BF8B8F /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Sources/WireGuardApp/it.lproj/Localizable.strings; sourceTree = "<group>"; };
- 6F8F9C6A2441DD0300BF8B8F /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = Sources/WireGuardApp/de.lproj/Localizable.strings; sourceTree = "<group>"; };
6F907C9B224663A2003CED21 /* LogViewHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogViewHelper.swift; sourceTree = "<group>"; };
6F919EC2218A2AE90023B400 /* ErrorPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorPresenter.swift; sourceTree = "<group>"; };
6F919ED5218C65C50023B400 /* wireguard_doc_logo_22x29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wireguard_doc_logo_22x29.png; sourceTree = "<group>"; };
@@ -402,6 +399,24 @@
6FDEF801218646B900D8FBF6 /* ZipArchive.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZipArchive.swift; sourceTree = "<group>"; };
6FDEF805218725D200D8FBF6 /* SettingsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTableViewController.swift; sourceTree = "<group>"; };
6FE1765521C90BBE002690EA /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Sources/WireGuardApp/Base.lproj/Localizable.strings; sourceTree = "<group>"; };
+ A8FAC495E119A787EE15828E /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh-Hant; path = Sources/WireGuardApp/zh-Hant.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 30E6E11BE16FC85D1D0D01A4 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh-Hans; path = Sources/WireGuardApp/zh-Hans.lproj/Localizable.strings; sourceTree = "<group>"; };
+ F061DB3DF45406C134EB447E /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = Sources/WireGuardApp/id.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 798AA59731469050BB67A452 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Sources/WireGuardApp/it.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 2B3036C208ACF4E06D7DA53F /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = Sources/WireGuardApp/de.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 43D66D9909C915207158175F /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = Sources/WireGuardApp/fr.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 7644A930B7CB3B8882BC52FD /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = Sources/WireGuardApp/fi.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 937E473CD10EEFE3BC376098 /* fa */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fa; path = Sources/WireGuardApp/fa.lproj/Localizable.strings; sourceTree = "<group>"; };
+ E4EE4FEC7423A6BEBDE429BC /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = Sources/WireGuardApp/sl.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 854D4F78352DD4455C410962 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = Sources/WireGuardApp/pl.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 8215B3EF8B68F0A53E6D8122 /* pa */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pa; path = Sources/WireGuardApp/pa.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 795E9FCC698E54371188E366 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = Sources/WireGuardApp/ko.lproj/Localizable.strings; sourceTree = "<group>"; };
+ E60BA3A8E202323CDD363B2B /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = Sources/WireGuardApp/ca.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 1D38E2B7D24EC0ACEF2C5734 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = Sources/WireGuardApp/ru.lproj/Localizable.strings; sourceTree = "<group>"; };
+ EE7D06A3CCB7DAEF13330651 /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = Sources/WireGuardApp/ro.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 6F24475E40CC51CC6CC27993 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = Sources/WireGuardApp/tr.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 31C0BC9131C140B617CA6713 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = Sources/WireGuardApp/ja.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 2F19992DF3CB32BB376853A0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Sources/WireGuardApp/es.lproj/Localizable.strings; sourceTree = "<group>"; };
6FE1765921C90E87002690EA /* LocalizationHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizationHelper.swift; sourceTree = "<group>"; };
6FE254FA219C10800028284D /* ZipImporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZipImporter.swift; sourceTree = "<group>"; };
6FE254FE219C60290028284D /* ZipExporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZipExporter.swift; sourceTree = "<group>"; };
@@ -1004,11 +1019,26 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
- en,
- ja,
Base,
+ en,
+ zh-Hant,
+ zh-Hans,
+ id,
it,
de,
+ fr,
+ fi,
+ fa,
+ sl,
+ pl,
+ pa,
+ ko,
+ ca,
+ ru,
+ ro,
+ tr,
+ ja,
+ es,
);
mainGroup = 6FF4AC0B211EC46F002C96EB;
packageReferences = (
@@ -1471,10 +1501,25 @@
6FE1765421C90BBE002690EA /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
+ A8FAC495E119A787EE15828E /* zh-Hant */,
+ 30E6E11BE16FC85D1D0D01A4 /* zh-Hans */,
+ F061DB3DF45406C134EB447E /* id */,
+ 798AA59731469050BB67A452 /* it */,
+ 2B3036C208ACF4E06D7DA53F /* de */,
+ 43D66D9909C915207158175F /* fr */,
+ 7644A930B7CB3B8882BC52FD /* fi */,
+ 937E473CD10EEFE3BC376098 /* fa */,
+ E4EE4FEC7423A6BEBDE429BC /* sl */,
+ 854D4F78352DD4455C410962 /* pl */,
+ 8215B3EF8B68F0A53E6D8122 /* pa */,
+ 795E9FCC698E54371188E366 /* ko */,
+ E60BA3A8E202323CDD363B2B /* ca */,
+ 1D38E2B7D24EC0ACEF2C5734 /* ru */,
+ EE7D06A3CCB7DAEF13330651 /* ro */,
+ 6F24475E40CC51CC6CC27993 /* tr */,
+ 31C0BC9131C140B617CA6713 /* ja */,
+ 2F19992DF3CB32BB376853A0 /* es */,
6FE1765521C90BBE002690EA /* Base */,
- 6F16F46F243DB55600AA141B /* ja */,
- 6F8F9C692441DBEF00BF8B8F /* it */,
- 6F8F9C6A2441DD0300BF8B8F /* de */,
);
name = Localizable.strings;
sourceTree = "<group>";
diff --git a/sync-translations.sh b/sync-translations.sh
index b2d72eb..f789010 100755
--- a/sync-translations.sh
+++ b/sync-translations.sh
@@ -1,6 +1,59 @@
#!/bin/bash
-set -ex
+set -e
curl -Lo - https://crowdin.com/backend/download/project/wireguard.zip | bsdtar -C Sources/WireGuardApp -x -f - --strip-components 3 wireguard-apple
find Sources/WireGuardApp/*.lproj -type f -empty -delete
find Sources/WireGuardApp/*.lproj -type d -empty -delete
git add Sources/WireGuardApp/*.lproj
+
+declare -A LOCALE_MAP
+while read -r filename; do
+ l="$(basename "$(dirname "$filename")" .lproj)"
+ [[ $l == Base ]] && continue
+ read -r -n 24 hex < <(LC_ALL=C tr -dc "A-F0-9" < /dev/urandom)
+ LOCALE_MAP["$l"]="$hex"
+done < <(find Sources/WireGuardApp -name Localizable.strings -type f)
+
+inkr=0 inls=0 inlsc=0
+while IFS= read -r line; do
+ if [[ $line == *"name = Base; path = Sources/WireGuardApp/Base.lproj/Localizable.strings"* ]]; then
+ echo "$line"
+ for l in "${!LOCALE_MAP[@]}"; do
+ printf '\t\t%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = %s; path = Sources/WireGuardApp/%s.lproj/Localizable.strings; sourceTree = "<group>"; };\n' "${LOCALE_MAP["$l"]}" "$l" "$l" "$l"
+ done
+ elif [[ $line == *"; path = Sources/WireGuardApp/"*".lproj/Localizable.strings"* ]]; then
+ continue
+ elif [[ $line == *"knownRegions = ("* ]]; then
+ echo "$line"
+ printf '\t\t\t\tBase,\n\t\t\t\ten,\n'
+ for l in "${!LOCALE_MAP[@]}"; do
+ printf '\t\t\t\t%s,\n' "$l"
+ done
+ inkr=1
+ elif [[ $inkr -eq 1 && $line == *");"* ]]; then
+ echo "$line"
+ inkr=0
+ elif [[ $inkr -eq 1 ]]; then
+ continue
+ elif [[ $inls -eq 0 && $line == *"/* Localizable.strings */ = {"* ]]; then
+ echo "$line"
+ inls=1
+ elif [[ $inls -eq 1 && $inlsc -eq 0 && $line == *"children = ("* ]]; then
+ echo "$line"
+ inlsc=1
+ for l in "${!LOCALE_MAP[@]}"; do
+ printf '\t\t\t\t%s /* %s */,\n' "${LOCALE_MAP["$l"]}" "$l"
+ done
+ elif [[ $inls -eq 1 && $inlsc -eq 1 && $line == *");"* ]]; then
+ echo "$line"
+ inlsc=0
+ elif [[ $inls -eq 1 && $inlsc -eq 0 && $line == *"};"* ]]; then
+ echo "$line"
+ inls=0
+ elif [[ $inls -eq 1 && $inlsc -eq 1 && $line != *" Base "* ]]; then
+ continue
+ else
+ echo "$line"
+ fi
+done < WireGuard.xcodeproj/project.pbxproj > WireGuard.xcodeproj/project.pbxproj.new
+mv WireGuard.xcodeproj/project.pbxproj.new WireGuard.xcodeproj/project.pbxproj
+git add WireGuard.xcodeproj/project.pbxproj