Add locale script (#945)

* Add locales script

* Add gitignore exception

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
This commit is contained in:
Daniel 2022-02-07 01:17:43 +11:00 committed by GitHub
parent 1ea6fea1d8
commit 20e23dcecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ SAFETY_LOCK
**/**dist
**/**.egg*
**/**.sh
!archinstall/locales/locales_generator.sh
**/**.egg-info/
**/**build/
**/**src/

View File

@ -0,0 +1,12 @@
#!/bin/bash
cd $(dirname "$0")/..
find . -type f -iname "*.py" | xargs xgettext -j --omit-header -d base -o locales/base.pot
for file in $(find locales/ -name "base.po"); do
echo "Updating: $file"
path=$(dirname $file)
msgmerge --quiet --width 512 --update $file locales/base.pot
msgfmt -o $path/base.mo $file
done