Suggestions: Internationalization

Upload core product.
Post Reply
onyii5119
Posts: 19
Joined: Sun Dec 20, 2009 6:27 pm

Suggestions: Internationalization

Post by onyii5119 »

As a Java Architect/Developer myself, I am not pleased with the way you implemented your localization feature. I would have preferred that a parameter be set that would indicate the locale desired. Then the applet can then read the param value and load the appropriate resource bundle.

For instance, a user might be using a computer that was setup with the en_US locale but the user might want to work in de. With your current system this use case will fail. But if the user can select a desired locale, then the integrating program could take the selected locale and dynamically set the appropriate param values for the applet to use.

I believe if you implement this feature it would make the internationalization feature of your products more usable and less cumbersome.

By the way, how many locales have you created resources for?

Thanks.
Jonathan

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Suggestions: Internationalization

Post by support »

Jonathan,

What you're asking for is already possible. Just use:
<PARAM NAME="resources" VALUE="i18n">
Then, make sure that i18n.properties includes your translated properties.
The applet will try to detect i18n_locale.properties but it will fail because of HTTP 404. Then it will load the i18n.properties. You can have have one i18n.properties per language and load the correct one depending on custom locale.

If you need a dynamic i18n.properties such as i18n.properties.php then use:
<PARAM NAME="resources" VALUE="i18n">
<PARAM NAME="localeresources" VALUE="false">
<PARAM NAME="localeresourcesextension" VALUE=".properties.php">

Does it make sense ?

onyii5119
Posts: 19
Joined: Sun Dec 20, 2009 6:27 pm

Re: Suggestions: Internationalization

Post by onyii5119 »

>>Does it make sense ?
Not quite. What is this: i18n.properties.php? Please elaborate with a concrete example.

You did not answer my previous question. Let me ask the question again:
How many locales have you created resources for? In other words, which languages have you created i18n_de.properties etc for?

Thanks

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Suggestions: Internationalization

Post by support »

We just have the english resources. If you need another language then you have to translate i18n.properties file. If you want a dynamic generated .properties file then you can use PHP on server side, that's why extension could be updated to .properties.php.

onyii5119
Posts: 19
Joined: Sun Dec 20, 2009 6:27 pm

Re: Suggestions: Internationalization

Post by onyii5119 »

I write Java code not PHP.
Do you have a sample PHP code, I can take a look at? I will handle the translation to Java myself.

Since you do not have any other language bundles it is then obvious that you have not even tested what you are proposing. To be honest with you I really don't understand what you are proposing as a solution. Why not give a concrete example and eventually any other potential customer that requires such functionality will know what to do.

Again, if you think it is not feasible as of the current version of your product, be honest about it and say so. Customer suggestions can always be built into a later version.

Thanks.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Suggestions: Internationalization

Post by support »

I can provide a full sample. Tell me how you will select your language. Can you build the APPLET tag in a JSP ? Could you pass the wanted language in the JSP session ?

onyii5119
Posts: 19
Joined: Sun Dec 20, 2009 6:27 pm

Re: Suggestions: Internationalization

Post by onyii5119 »

To make it simple, lets assume that the current language/locale selected by the user is always available in a JavaScript variable:

var selectedLocale = 'de';

You can take it up from there.

Thanks so much. I appreciate your efforts.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Suggestions: Internationalization

Post by support »

Here is the sample:

The JavaScript includes the following code:

Code: Select all

var selectedLocale = 'de';
var resourcesfile = 'i18n_' + selectedLocale+'.properties';
...
document.write('resources="'+resourcesfile+'" ');
document.write('localeresources="false" ');
...
document.writeln('<PARAM NAME="resources" VALUE="'+resourcesfile+'">');
document.writeln('<PARAM NAME="localeresources" VALUE="false">');
...
Depending on selectedLocale = 'de' or selectedLocale = 'en' you will see:
jfu_de.GIF
With i18n_de.properties
(5.11 KiB) Downloaded 207 times
jfu_en.GIF
With i18n_en.properties
(4.27 KiB) Downloaded 207 times
I enclose the full JavaScript + i18n_de.properties + i18n_en.properties.
jfu_i18n.zip
(5.8 KiB) Downloaded 828 times
Notice that i18n_de.properties is not fully translated in german. I've just translated a few properties with Google translate.

Does it help ?

onyii5119
Posts: 19
Joined: Sun Dec 20, 2009 6:27 pm

Re: Suggestions: Internationalization

Post by onyii5119 »

Thanks so much. I appreciate your support.

Post Reply