I hope the interactive interface supports localization
At present, only English interactive interface is inconvenient to use. I hope to provide localized interface language
Hi @bambuo, most interface elements of Scene Builder support localization. All UI text elements are declared inside of I18N property files. This exists for app and kit modules.
App:
/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n
Kit:
/kit/src/main/resources/com/oracle/javafx/scenebuilder/kit/i18n
There is always a default file (English) accompanied by locale specific files. Already there seems to be a Japanese translation and a basically set of empty files for a Chinese translation. You could possibly use the default files as a starter.
Defaults:
/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties
/kit/src/main/resources/com/oracle/javafx/scenebuilder/kit/i18n/SceneBuilderKit.properties
Japanese:
SceneBuilderApp_ja.properties
SceneBuilderKit_ja.properties
Chines (my guess):
SceneBuilderApp_zh_CN.properties
SceneBuilderKit_zh_CN.properties
Which language would you like to add?
Technically it would be like:
- fork Scene Builder
- create branch for your issue
- add localized I18N property files
- test
- create pull request
Do you need any support?
Hi: Thank you very much for your reply. According to the content in the last email, I have found the location of the localization file directory, and also made a preliminary translation locally. Unfortunately, I do not know how to compile a dmg file locally. The error prompted is related to TOKEN, so I gave up the intention of compiling a file locally, but found that I could not submit my file to github. What should I do next? Is there a guidance document?
2022年10月1日 21:56,Oliver Löffler @.***> 写道:
Hi @bambuo https://github.com/bambuo, most interface elements of Scene Builder support localization. All UI text elements are declared inside of I18N property files. This exists for app and kit modules.
App: /app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n
Kit: /kit/src/main/resources/com/oracle/javafx/scenebuilder/kit/i18n
There is always a default file (English) accompanied by locale specific files. Already there seems to be a Japanese translation and a basically set of empty files for a Chinese translation. You could possibly use the default files as a starter.
Defaults: /app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties /kit/src/main/resources/com/oracle/javafx/scenebuilder/kit/i18n/SceneBuilderKit.properties
Japanese: SceneBuilderApp_ja.properties SceneBuilderKit_ja.properties
Chines (my guess): SceneBuilderApp_zh_CN.properties SceneBuilderKit_zh_CN.properties
Which language would you like to add?
Technically it would be like:
fork Scene Builder create branch for your issue add localized I18N property files test create pull request Do you need any support?
— Reply to this email directly, view it on GitHub https://github.com/gluonhq/scenebuilder/issues/560#issuecomment-1264371791, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKQI5JG5WF3EDBOYN33CQKTWBA7HNANCNFSM56RDV66Q. You are receiving this because you were mentioned.
Hi!, well you can run Scene Builder locally to test if the translation works properly. This can be achieved by executing the 2 commands from within the Scene Builder project directory:
mvn install
mvn javafx:run -f app
Please create a pull request in Github so that the translation can be merged in main line (after review). Please refer to CONTRIBUTING.md.
Technically its like:
- fork Scene Builder here in Github (this is essential, you only can add/commit files to your own repositories),
- create branch for your issue (e.g. branch name
issue-560) in your forked version of Scene Builder, - add + commit the new localized I18N property files,
- push branch
issue-560to your Scene Builder fork, - create pull request in Github (there is the
Contributebutton in your fork, there will be a submenu itemOpen Pull Request)
There will be a little instruction when issuing the pull request, there's a small checklist.
Furthemore, I will later assemble an instruction to build a PKG file on macOS which does not require signing, so that you can build a package. But I need to test that first.
Hi @bambuo,
you can use the following script, to create a SceneBuilder Snapshot application package on macOS for testing.
Its a plain application image, not a pkg or dmg. I'll add Windows and Linux versions later.
Place the file macpac.sh into your SceneBuilder project directory. Run it from command line.
When the process finishes, you will find the snapshot application image in: app/target/install. There will be then the SceneBuilder Snapshot for macOS.
Filename: macpac.sh
if [ -d "app/target/lib" ]; then rm -Rf "app/target/lib"; fi
if [ -d "app/target/runtime" ]; then rm -Rf "app/target/runtime"; fi
if [ -d "app/target/install" ]; then rm -Rf "app/target/install"; fi
mvn package -DskipTests=True
export JPACKAGE_HOME=$JAVA_HOME
export JAVAFX_HOME='/Volumes/Daten/JavaFX/javafx-jmods-19'
export APP_VERSION='19.0.0-SNAPSHOT'
export PACKAGED_APP_VERSION='19.0.0'
export MAIN_CLASS='com.oracle.javafx.scenebuilder.app.SceneBuilderApp'
export INSTALL_DIR='app/target/install'
jdeps_modules=$(jdeps --module-path $JAVAFX_HOME --print-module-deps --ignore-missing-deps app/target/lib/scenebuilder-$APP_VERSION-all.jar)
JAVAFX_MODULES=javafx.controls,javafx.fxml,javafx.media,javafx.swing,javafx.web
$JAVA_HOME/bin/jlink --module-path $JAVAFX_HOME --add-modules $jdeps_modules,$JAVAFX_MODULES --output app/target/runtime --strip-debug --compress 2 --no-header-files --no-man-pages
$JPACKAGE_HOME/bin/jpackage \
--app-version $PACKAGED_APP_VERSION --input app/target/lib \
--main-jar scenebuilder-$APP_VERSION-all.jar \
--main-class $MAIN_CLASS \
--name "SceneBuilder Snapshot" \
--description "Scene Builder Snapshot" \
--vendor Gluon \
--verbose \
--runtime-image app/target/runtime \
--dest $INSTALL_DIR \
--icon app/assets/osx/icon-mac.icns \
--java-options '"--add-opens=javafx.fxml/javafx.fxml=ALL-UNNAMED"' \
--type app-image