orcaslicer/run_gettext.bat

25 lines
838 B
Batchfile
Raw Normal View History

2023-05-28 01:55:05 +00:00
@echo off
REM OrcaSlicer gettext
REM Created by SoftFever on 27/5/23.
2023-08-09 05:06:58 +00:00
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
2023-05-28 01:55:05 +00:00
REM Print the current directory
echo %cd%
2023-08-09 05:06:58 +00:00
set pot_file="./localization/i18n/OrcaSlicer.pot"
2023-05-28 01:55:05 +00:00
REM Run the script for each .po file
2023-08-09 05:06:58 +00:00
for /r "./localization/i18n/" %%f in (*.po) do (
2023-05-28 01:55:05 +00:00
call :processFile "%%f"
)
goto :eof
:processFile
set "file=%~1"
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%"
goto :eof