Java Reference
In-Depth Information
Save the file as Localization.fx and compile. Now, create a text file named
Localization_fr.fxproperties and type in the following:
"Lift the cover"="Soulevez le couvercle"
"red button"="Appuyez sur le bouton rouge pour d├ętruire"
Notice that JavaFX can use either the actual string or a string key ( red button ) to do the
substitution for the localized string. When the code is compiled and executed, the output is:
Soulevez le couvercle
Appuyez sur le bouton rouge pour d├ętruire
The strings are substituted automatically by the JavaFX runtime with their French translation.
If no properties file is found for the locale, JavaFX defaults to the actual String assigned to
the variable.
Search WWH ::

Custom Search