mirror of
https://github.com/aphrody-labs/mullvadvpn-app.git
synced 2026-10-13 22:10:39 +00:00
Add script to check apostrophe style
The script checks for straight apostrophes in our user-facing strings since curly ones shall be used per an internal decision. It generates an error on matches in our English strings, since those are our source of truth.
This commit is contained in:
1 file changed
+29
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
CURLY_APOSTROPHE_STYLE="’"
|
||||
UNSUPPORTED_APOSTROPHE_STYLES="'\`´'′ʼ"
|
||||
ERROR_MESSAGE="Error: Use curly apostrophes ($CURLY_APOSTROPHE_STYLE) \
|
||||
instead of unsupported ones ($UNSUPPORTED_APOSTROPHE_STYLES)."
|
||||
|
||||
# Check Desktop/Android strings (English only).
|
||||
if grep "^msgid" desktop/packages/mullvad-vpn/locales/messages.pot | \
|
||||
grep "[$UNSUPPORTED_APOSTROPHE_STYLES]"; then
|
||||
echo "$ERROR_MESSAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check Android strings (English only).
|
||||
if awk '/<string/,/<\/string>/' \
|
||||
android/lib/ui/resource/src/main/res/values/strings.xml | \
|
||||
grep "[$UNSUPPORTED_APOSTROPHE_STYLES]"; then
|
||||
echo "$ERROR_MESSAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check iOS strings (English only).
|
||||
if jq -r '.strings | keys[]' ios/Assets/Localizable.xcstrings | \
|
||||
grep "[$UNSUPPORTED_APOSTROPHE_STYLES]"; then
|
||||
echo "$ERROR_MESSAGE"
|
||||
exit 1
|
||||
fi
|
||||
Reference in new issue
Block a user