mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
Add fr, es and zh_CN Weblate PO files
Using `./update.sh --add-langs`. Further langs will be added directly via Weblate.
This commit is contained in:
18
update.sh
18
update.sh
@@ -10,11 +10,15 @@ WEBLATE_DIR="weblate"
|
||||
WEBLATE_TEMPLATE="$WEBLATE_DIR/docs.pot"
|
||||
WEBLATE_POFILES=$(find $WEBLATE_DIR -type f -name "*.po")
|
||||
|
||||
# Used only for --add-langs - languages will mostly be added via Weblate directly
|
||||
LANGS="es fr zh_CN"
|
||||
|
||||
# Options
|
||||
update_sphinx_pot=false
|
||||
update_sphinx_po=false
|
||||
update_weblate_pot=false
|
||||
update_weblate_po=false
|
||||
add_langs=false
|
||||
|
||||
# Command line arguments
|
||||
while [ $# -gt 0 ]; do
|
||||
@@ -45,6 +49,10 @@ while [ $# -gt 0 ]; do
|
||||
update_weblate_pot=true
|
||||
update_weblate_po=true
|
||||
;;
|
||||
--add-langs|-l)
|
||||
add_langs=true
|
||||
make_sphinx_po_symlinks=true
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument."
|
||||
esac
|
||||
@@ -82,6 +90,16 @@ if [ "$update_weblate_po" = true ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Manual method to generate new Weblate PO files to bootstrap a lang
|
||||
if [ "$add_langs" = true ]; then
|
||||
for lang in $LANGS; do
|
||||
if [ ! -f "$WEBLATE_DIR/$lang.po" ]; then
|
||||
msginit --no-translator -i $WEBLATE_TEMPLATE -o "$WEBLATE_DIR/$lang.po";
|
||||
fi
|
||||
done
|
||||
WEBLATE_POFILES=$(find $WEBLATE_DIR -type f -name "*.po")
|
||||
fi
|
||||
|
||||
# Generate/Merge Sphinx PO files from Weblate PO file
|
||||
if [ "$update_sphinx_po" = true ]; then
|
||||
echo "=== Merging Sphinx PO files with their template and Weblate PO file ==="
|
||||
|
||||
51480
weblate/es.po
Normal file
51480
weblate/es.po
Normal file
File diff suppressed because it is too large
Load Diff
51480
weblate/fr.po
Normal file
51480
weblate/fr.po
Normal file
File diff suppressed because it is too large
Load Diff
51480
weblate/zh_CN.po
Normal file
51480
weblate/zh_CN.po
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user