Localization support and transifex integration#55
Localization support and transifex integration#55NaitLee wants to merge 31 commits intoMarioSMB:masterfrom
Conversation
100% translated source file: 'lang/common.pot' on 'zh-Hant'.
100% translated source file: 'lang/common.pot' on 'zh_CN'.
100% translated source file: 'lang/common.pot' on 'zh_HK'.
100% translated source file: 'lang/common.pot' on 'zh_TW'.
…zable-strings' into NaitLee/more-localizable-strings
8c4442b to
9bfc953
Compare
|
@LegendaryGuard just have added you to the testing transifex team. I was busy for a very long time and didn't take time to manage that. |
Nice! Right now, I just entered into the testing transifex project and I translated few japanese strings to see if it updates in the next time. |
2% of minimum 1% translated source file: 'lang/common.pot' on 'ja_JP'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
I just modified the config to 1% translated before pushing to repo. It's been 50%, though I noted that the updated pot contains so many strings... :) I see a push was issued after I added a string afterwards, with some minutes delay. (I set a 5 mins cooldown as for now) |
|
Great! mkdir: created directory 'compiled/zzz-smb-l10n.pk3dir'
rm: cannot remove 'compiled/zzz-smb-l10n.pk3dir/*': No such file or directory
Merging localization files to compiled/zzz-smb-l10n.pk3dir
rm: cannot remove 'compiled': Is a directory
rm: cannot remove 'compiled/zzz-smb-l10n.*.pk3': No such file or directory
Making localization package compiled/zzz-smb-l10n.a0491c0c.pk3
adding: common.ja_JP.po (deflated 80%)
adding: common.zh_CN.po (deflated 78%)
adding: common.zh_HK.po (deflated 78%)
adding: common.zh_TW.po (deflated 78%)
adding: zzz-smb-l10n.pk3.serverpackage (stored 0%)The console/terminal output should be clean, so I made some adjustments to check the directories and pk3 file in #!/usr/bin/env bash
cwd="`pwd`"
cd "`dirname $0`/.."
base=xonotic
if [ ! -d "$base" ]; then
echo "RTFM (README.md)"
cd $cwd
exit 1
fi
pk3name=zzz-smb-l10n
dst=compiled/${pk3name}.pk3dir
if [ ! -d "$dst" ]; then
mkdir -vp $dst
fi
if [ -d "$dst" ] && [ "$(ls -A $dst)" ]; then
rm -v $dst/*
fi
echo "Merging localization files to $dst"
for i in $(ls lang); do
if [ -f lang/$i ] && [ -f $base/$i ] && [[ "$i" != "common.pot" ]]; then
msgcat --to-code UTF-8 $base/$i lang/$i > $dst/$i
fi
done
if [ ! -n "${ZIP:-}" ]; then
if [ -e "compiled/${pk3name}.*.pk3" ]; then
rm -v compiled/${pk3name}.*.pk3
fi
# unique id for different versions of localization
sha256=$(cat compiled/${pk3name}.pk3dir/* | sha256sum)
pk3path=compiled/$pk3name.${sha256:0:8}.pk3
echo "Making localization package $pk3path"
echo "localization package for smb server" >$dst/${pk3name}.pk3.serverpackage
zip -9 -j $pk3path $dst/*
fi
cd $cwdIt would be ok to update the script in the PR. Suggestion: that could be interesting is that you can see the percentage of each language of how much it's translated, an example would be something like this: That could save time going to check the completion percentage in transifex. But now I see that the percentage here is included inside commits like these: P.D. Going to add some translated japanese strings in transifex to see if it's going as expected besides than adding a new |
2% of minimum 1% translated source file: 'lang/common.pot' on 'ja_JP'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
Ok. We think that the transifex bot should check once a week, what do you think, @MarioSMB ? Or should be once a month? If not, how long do you prefer for the bot to check the updates in transifex of some languages and make a commit? Once all that is done, let's rename the transifex project name by replacing P.D. Transifex bot commit from right now: Nice, it checks and updates correctly as expected! |
|
I took a look to some details, these words aren't from the
Why do these words from another branch ( |
done
|
|
Understood. You need to clarify that requires installed this package to execute the translations (
sudo apt-get update
sudo apt-get gettext
pacman -S gettextOk, so the manual process is:
Btw, I created a new organization to attach the modpack: https://app.transifex.com/team-xonsmb/ So, I think you can replace that line in the README to the URL I just shared: https://github.com/MarioSMB/modpack/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R57 If you do, consider updating the documentation I just shared. And I guess the instructions to execute successfully from the organization are there, right? #55 (comment) |
…ts of l10n scripts
34% of minimum 1% translated source file: 'lang/common.pot' on 'zh-Hant'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
34% of minimum 1% translated source file: 'lang/common.pot' on 'zh_TW'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
34% of minimum 1% translated source file: 'lang/common.pot' on 'zh_CN'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2% of minimum 1% translated source file: 'lang/common.pot' on 'ja_JP'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
34% of minimum 1% translated source file: 'lang/common.pot' on 'zh_HK'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
|
Things are updated.
To avoid pull request spams, you may configure Transifex to directly push translations to master branch. |
|
Thank you for continuing to work on this - I've given LegendGuardian permission to set it up at the earliest convenience. |
|
@NaitLee Sorry for asking you some questions, but I want to make sure I apply everything correctly. Since the team and project have already been created, I'm not sure if I missed any steps in Transifex before running these scripts via GitHub Actions:
|
|
The project url should be ok. The "integration" should be installed, and should be confirmed by the GitHub account owning this repository, then probably configured with target .pot file(s): Note that this integration isn't GitHub Action but GitHub "App" for a repository: (Nevertheless you may create a GitHub Action to automatically build translation pk3s. I'm not experienced to this yet.) |




This contributes to progress of #54 by the following additions:
lang/makepot.shfor gathering & updating strings from source code (of all branches) for translation, and it excludes vanilla strings from this codebaselang/merge.shfor “merging” translations: merge vanilla strings when packaging for distribution as a whole as a pk3 (will also be run bybuild.shby default)lang/updatepo.shfor updating existing po files manually, useful for offline translation.transifex.ymlfor integration with the serviceBefore merge, check if the scripts work on your machine… :)
NOTE: merge these code to a local branch of official repository (not my fork) and then test. it needs other gameplay branches to work
After merging, consider:
lang/makepot.sh, to have new strings (those from other branches) included for translation; consider running it routinelylang/merge.sh, and consider to distribute itIf I missed something just ask… :)