mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-22 11:42:00 +00:00
Fix i18n
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
REM OrcaSlicer gettext
|
||||
REM Snapmaker_Orca gettext
|
||||
REM Created by SoftFever on 27/5/23.
|
||||
|
||||
REM Check for --full argument
|
||||
@@ -26,10 +26,10 @@ goto :eof
|
||||
set "file=%~1"
|
||||
set "dir=%~dp1"
|
||||
set "name=%~n1"
|
||||
set "lang=%name:OrcaSlicer_=%"
|
||||
set "lang=%name:Snapmaker_Orca_=%"
|
||||
if %FULL_MODE%==1 (
|
||||
.\tools\msgmerge.exe -N -o "%file%" "%file%" "%pot_file%"
|
||||
)
|
||||
if not exist "./resources/i18n/%lang%" mkdir "./resources/i18n/%lang%"
|
||||
.\tools\msgfmt.exe --check-format -o "./resources/i18n/%lang%/OrcaSlicer.mo" "%file%"
|
||||
.\tools\msgfmt.exe --check-format -o "./resources/i18n/%lang%/Snapmaker_Orca.mo" "%file%"
|
||||
goto :eof
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# OrcaSlicer gettext
|
||||
# Snapmaker_Orca gettext
|
||||
# Created by SoftFever on 27/5/23.
|
||||
#
|
||||
|
||||
@@ -26,12 +26,12 @@ do
|
||||
dir=${dir%*/} # remove the trailing "/"
|
||||
lang=${dir##*/} # extract the language identifier
|
||||
|
||||
if [ -f "$dir/OrcaSlicer_${lang}.po" ]; then
|
||||
if [ -f "$dir/Snapmaker_Orca_${lang}.po" ]; then
|
||||
if $FULL_MODE; then
|
||||
msgmerge -N -o "$dir/OrcaSlicer_${lang}.po" "$dir/OrcaSlicer_${lang}.po" "$pot_file"
|
||||
msgmerge -N -o "$dir/Snapmaker_Orca_${lang}.po" "$dir/Snapmaker_Orca_${lang}.po" "$pot_file"
|
||||
fi
|
||||
mkdir -p "resources/i18n/${lang}"
|
||||
if ! msgfmt --check-format -o "resources/i18n/${lang}/OrcaSlicer.mo" "$dir/OrcaSlicer_${lang}.po"; then
|
||||
if ! msgfmt --check-format -o "resources/i18n/${lang}/Snapmaker_Orca.mo" "$dir/Snapmaker_Orca_${lang}.po"; then
|
||||
echo "Error encountered with msgfmt command for language ${lang}."
|
||||
exit 1 # Exit the script with an error status
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user