-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Youtube shorts locale changes (#583)
* ok * Cleaning locale files: Tue Sep 10 23:01:04 UTC 2024 * ok --------- Co-authored-by: Automated <[email protected]>
- Loading branch information
Showing
18 changed files
with
376 additions
and
15 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 |
---|---|---|
@@ -1,28 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# if a locale file name is passed as an argument, use it | ||
# If a locale file name is passed as an argument, use it | ||
if [ $# -eq 1 ]; then | ||
LOCALE_FILE=$1 | ||
LOCALE_FILE=$1 | ||
else | ||
LOCALE_FILE="*" | ||
LOCALE_FILE="*" | ||
fi | ||
|
||
# Set sorting flag | ||
if [ "$DO_SORT" = "true" ]; then | ||
DO_SORT=true | ||
DO_SORT=true | ||
else | ||
DO_SORT=false | ||
DO_SORT=false | ||
fi | ||
|
||
for domain in $(ls en_US/LC_MESSAGES/$LOCALE_FILE.po|xargs -L1 basename); do | ||
for domain in $(ls en_US/LC_MESSAGES/$LOCALE_FILE.po | xargs -L1 basename); do | ||
for lang in $(echo ??_??); do | ||
# Don't sort unless we edit in the -s flag | ||
# This way we don't cause massive merge conflicts all the time | ||
if $DO_SORT; then | ||
echo "Cleaning and sorting $lang/LC_MESSAGES/$domain" | ||
msgcat -s --to-code=UTF-8 --no-wrap --lang=$lang $lang/LC_MESSAGES/$domain -o $lang/LC_MESSAGES/$domain | ||
else | ||
echo "Cleaning $lang/LC_MESSAGES/$domain" | ||
msgcat --to-code=UTF-8 --no-wrap --lang=$lang $lang/LC_MESSAGES/$domain -o $lang/LC_MESSAGES/$domain | ||
fi | ||
# Remove duplicates first using msguniq | ||
# echo "Removing duplicates from $lang/LC_MESSAGES/$domain" | ||
# msguniq --to-code=UTF-8 --no-wrap $lang/LC_MESSAGES/$domain -o $lang/LC_MESSAGES/$domain | ||
|
||
# Clean and optionally sort | ||
if $DO_SORT; then | ||
echo "Cleaning and sorting $lang/LC_MESSAGES/$domain" | ||
msgcat -s --to-code=UTF-8 --no-wrap --lang=$lang $lang/LC_MESSAGES/$domain -o $lang/LC_MESSAGES/$domain | ||
else | ||
echo "Cleaning $lang/LC_MESSAGES/$domain" | ||
msgcat --to-code=UTF-8 --no-wrap --lang=$lang $lang/LC_MESSAGES/$domain -o $lang/LC_MESSAGES/$domain | ||
fi | ||
done | ||
done |
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
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
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
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
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
Oops, something went wrong.