Life saver: update locale generation

This commit is contained in:
SoftFever 2023-09-05 22:36:29 +08:00
parent 86f51cd9d0
commit 76d59ac033
25 changed files with 71 additions and 12 deletions

View file

@ -1,9 +1,17 @@
@echo off
REM OrcaSlicer gettext
REM Created by SoftFever on 27/5/23.
xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost -f ./localization/i18n/list.txt -o ./localization/i18n/OrcaSlicer.pot
build\src\hints\Release\hintsToPot ./resources ./localization/i18n
REM Check for --full argument
set FULL_MODE=0
for %%a in (%*) do (
if "%%a"=="--full" set FULL_MODE=1
)
if %FULL_MODE%==1 (
xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost -f ./localization/i18n/list.txt -o ./localization/i18n/OrcaSlicer.pot
build/src/hints/Release/hintsToPot ./resources ./localization/i18n
)
REM Print the current directory
echo %cd%
set pot_file="./localization/i18n/OrcaSlicer.pot"
@ -19,6 +27,9 @@ goto :eof
set "dir=%~dp1"
set "name=%~n1"
set "lang=%name:OrcaSlicer_=%"
msgmerge -N -o "%file%" "%file%" "%pot_file%"
msgfmt --check-format -o "./resources/i18n/%lang%/OrcaSlicer.mo" "%file%"
if %FULL_MODE%==1 (
msgmerge -N -o "%file%" "%file%" "%pot_file%"
)
if not exist ./resources/i18n/%lang% mkdir ./resources/i18n/%lang%
msgfmt -o "./resources/i18n/%lang%/OrcaSlicer.mo" "%file%"
goto :eof