问题
I have a question about how to add new languages to the installer. We are currently internationalizing our application. For testing purposes we want to display the installer in our test language.
My initial work around was first to copy the contents of the "messages_en.utf8"
file in the
install4j ->resources -> messages directory
and added a messages_xx.utf8
file to said
directory, containing said contents. I then ran that file through a
standalone translator tool that I built that just translates the String
following the equal sign, giving me a key value pair containing the "translated"
String.
So now I have the appropriate xx_messages.utf8
file. Then, I go to
the languages file and add my new language, "xx=NewLanguage"
. So now I have a
language that will show up in the language tab as well as a corresponding
message file.
Now, Everything works just as it's expected to, however, my actual question is, Is this the correct way to add arbitrary languages? So If I want the installer to be rendered in Chittagonian in the future, would this be the proper way to achieve that goal, or is there a better way to go about creating new languages for the installer?
回答1:
Now, Everything works just as it's expected to, however, my actual question is, Is this the correct way to add arbitrary languages?
Yes, that's correct. You also would have to add the key:
languages.xx=Language name
to messages_en.utf8 and possibly to other support language files. This is for the language selection dialog.
So If I want the installer to be rendered in Chittagonian in the future, would this be the proper way to achieve that goal
Yes, just note there is no proper RTL support in install4j as of 5.1.6 and the GUI may not look good for RTL languages.
Update 2018-02-03
As of install4j 6.1, RTL support has been added.
来源:https://stackoverflow.com/questions/17729372/creating-custom-languages-for-install4j-installer