mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-08 18:48:04 +00:00
Fix i18n from orcaslicer to snapmaker orca
This commit is contained in:
@@ -60,7 +60,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
try {
|
||||
path_to_ini = boost::filesystem::canonical(boost::filesystem::path(argv[1])).parent_path() / "resources" / "data" / "hints.ini";
|
||||
path_to_pot = boost::filesystem::canonical(boost::filesystem::path(argv[2])).parent_path() / "i18n" /"OrcaSlicer.pot";
|
||||
path_to_pot = boost::filesystem::canonical(boost::filesystem::path(argv[2])).parent_path() / "i18n" /"Snapmaker_Orca.pot";
|
||||
} catch (std::exception&) {
|
||||
std::cout << "HINTS_TO_POT FAILED: BOOST CANNONICAL" << std::endl;
|
||||
return -1;
|
||||
|
||||
@@ -22,7 +22,7 @@ Full manual for GNUgettext can be seen here: [http://www.gnu.org/software/gettex
|
||||
|
||||
### Scenario 2. How do I add a new language support
|
||||
|
||||
1. Get file OrcaSlicer.pot here :
|
||||
1. Get file Snapmaker_Orca.pot here :
|
||||
[https://github.com/softfever/OrcaSlicer/tree/master/localization/i18n](https://github.com/softfever/OrcaSlicer/tree/master/localization/i18n)
|
||||
2. Open it in PoEdit for "Create new translation"
|
||||
3. Select Translation Language (for example French).
|
||||
@@ -53,7 +53,7 @@ If you add new file resource, add it to the list of files containing macro `L()`
|
||||
2. Create template file(*.POT) with GNUgettext command:
|
||||
|
||||
```shell
|
||||
xgettext --keyword=L --add-comments=TRN --from-code=UTF-8 --debug -o OrcaSlicer.pot -f list.txt
|
||||
xgettext --keyword=L --add-comments=TRN --from-code=UTF-8 --debug -o Snapmaker_Orca.pot -f list.txt
|
||||
```
|
||||
|
||||
Use flag `--from-code=UTF-8` to specify that the source strings are in UTF-8 encoding
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -9,12 +9,12 @@ for %%a in (%*) do (
|
||||
)
|
||||
|
||||
if %FULL_MODE%==1 (
|
||||
.\tools\xgettext.exe --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
|
||||
.\tools\xgettext.exe --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/Snapmaker_Orca.pot
|
||||
python scripts/HintsToPot.py ./resources ./localization/i18n
|
||||
)
|
||||
REM Print the current directory
|
||||
echo %cd%
|
||||
set pot_file="./localization/i18n/OrcaSlicer.pot"
|
||||
set pot_file="./localization/i18n/Snapmaker_Orca.pot"
|
||||
|
||||
REM Run the script for each .po file
|
||||
for /r "./localization/i18n/" %%f in (*.po) do (
|
||||
|
||||
@@ -14,13 +14,13 @@ do
|
||||
done
|
||||
|
||||
if $FULL_MODE; then
|
||||
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
|
||||
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/Snapmaker_Orca.pot
|
||||
python3 scripts/HintsToPot.py ./resources ./localization/i18n
|
||||
fi
|
||||
|
||||
|
||||
echo "$0: working dir = $PWD"
|
||||
pot_file="./localization/i18n/OrcaSlicer.pot"
|
||||
pot_file="./localization/i18n/Snapmaker_Orca.pot"
|
||||
for dir in ./localization/i18n/*/
|
||||
do
|
||||
dir=${dir%*/} # remove the trailing "/"
|
||||
|
||||
Reference in New Issue
Block a user