forked from valora-inc/wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: script to replace Valora in locales
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
# ======================================== | ||
# Replace the branded name in translation locale files | ||
# ======================================== | ||
|
||
# Flags: | ||
# -b (Optional): Name of the branding to use: celo or valora (default) | ||
|
||
branding=Kolektivo | ||
|
||
# Get the branding name from the command line arguments | ||
while getopts 'b:' flag; do | ||
case "${flag}" in | ||
b) branding="$OPTARG" ;; | ||
*) error "Unexpected option ${flag}" ;; | ||
esac | ||
done | ||
|
||
# Get the root directory of the mobile project | ||
mobile_root="$(dirname "$(dirname "$0")")" | ||
|
||
# Change the directory to the root directory of the localization files | ||
cd "$mobile_root/locales" | ||
|
||
# Get all the locale files in the locales directory which may be nested | ||
locale_files=$(find . -type f -name '*.json') | ||
|
||
# Replace the branded name in the locale files | ||
for locale_file in $locale_files; do | ||
sed -i '' "s/Valora/$branding/g" "$locale_file" | ||
done |