Hi Want to implement Internationalization concept(for Hindi language) with JavaFx which runs effectively on lower processor.
Configuration :- Processor - Intel Atom CPUD425@ 1.80GHz x 2 RAM - 2 GB OS - 32 Bit Fedora 15
Implemented Internationalization concept with Resource Bundle. But it is quite slow on that low platform. And same slowness occurs for English and Hindi Language(2-4sec) though implemented correctly as suggested in How to implement language support for JavaFX in FXML documents?.
So, tried other approach as took one global variable, set that variable to 1 if language changed to Hindi. And for each fxml controllers initialize method check for that variable if it is 1 then set fxml label and button text to directly Hindi string as shown below.
@Override
public void initialize(URL location, ResourceBundle resources) {
// TODO Auto-generated method stub
if(Configuration.getLangSelected()==1){
label1.setText("आप क्या करना पसंद करेंगे?");
button1.setText("ई-कैश प्राप्त करें");
button2.setText("सेवा का उपयोग करें");
button3.setText("वापस");
}
}
It improves performance than resource bundle way for low hardware configuration and Flow is fine for English But for Hindi rendering took time(2.8sec). But 2.8 sec is not accepted here. Is there other way to accomplish this task in minimum time?
For curiousity, As replaced Hindi string with English String in initialization as follows:-
@Override
public void initialize(URL location, ResourceBundle resources) {
// TODO Auto-generated method stub
if(Configuration.getLangSelected()==1){
label1.setText("What you want to do?");
button1.setText("Get E-cash");
button2.setText("Use Service");
button3.setText("Back");
}
}
Same files loaded fast for this change. Is there any problem as we can not set directly other language string to the labels and buttons such things, Is there way to set text directly and loading that fxml fastly?