scenebuilder icon indicating copy to clipboard operation
scenebuilder copied to clipboard

I hope the interactive interface supports localization

Open johana-cxen opened this issue 3 years ago • 3 comments

At present, only English interactive interface is inconvenient to use. I hope to provide localized interface language

johana-cxen avatar Aug 15 '22 05:08 johana-cxen

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:

  1. fork Scene Builder
  2. create branch for your issue
  3. add localized I18N property files
  4. test
  5. create pull request

Do you need any support?

Oliver-Loeffler avatar Oct 01 '22 13:10 Oliver-Loeffler

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.

johana-cxen avatar Oct 02 '22 04:10 johana-cxen

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:

  1. fork Scene Builder here in Github (this is essential, you only can add/commit files to your own repositories),
  2. create branch for your issue (e.g. branch name issue-560) in your forked version of Scene Builder,
  3. add + commit the new localized I18N property files,
  4. push branch issue-560 to your Scene Builder fork,
  5. create pull request in Github (there is the Contribute button in your fork, there will be a submenu item Open 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.

Oliver-Loeffler avatar Oct 02 '22 08:10 Oliver-Loeffler

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

Oliver-Loeffler avatar Oct 26 '22 05:10 Oliver-Loeffler