:: Forum >>

Internationalization

I see the code still contains lines like obj.shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
As far as I know there is no method or property to change these labels for other languages. This makes the grid very unilingual.
With v1 I replaced such code myself to something like obj.shortMonths=[MM_JANUARY,MM_FEBRUARY,MM_MARCH,MM_APRIL,MM_MAY,MM_JUNE,MM_JULY,MM_AUGUST,MM_SEPTEMBER,MM_OCTOBER,MM_NOVEMBER,MM_DECEMBER];
This way I can use a seperate language file (eg en.js for english or nl.js for dutch) which defines these variables like this :
var MM_JANUARY = "Jan";
var MM_FEBRUARY = "Feb";
var MM_MARCH = "Maa";
var MM_APRIL = "Apr";
var MM_MAY = "Mei";
var MM_JUNE = "Jun";
var MM_JULY = "Jul";
var MM_AUGUST = "Aug";
var MM_SEPTEMBER = "Sep";
var MM_OCTOBER = "Okt";
var MM_NOVEMBER = "Nov";
var MM_DECEMBER = "Dec";

Alex, might I suggest that v2 should include something like this too. Which technique you use is up to you of course, but I feel there should be a relative easy way to change the interface language of aw.js

Keep up the good work. I'm looking forward to the official release of version 2 !!!
Roebie
Wednesday, October 26, 2005
Roebie,

I think this is a great idea. I don't think there are too many hard coded strings and it might not be too difficult to pull them out into variables since this is a product that can be used by everyone. And it might not be too hard on the programmer to ask up front for a language to use, set a variable, then use the correct include file for the constant declarations. What do you think Alex, is this doable?
Jim Hunter
Wednesday, October 26, 2005
It is possible to do similar thing with the current code. It just requires slightly different syntax:

new AW.Formats.Date; // initialize class/prototype

AW.Formats.Date.prototype.shortMonths = [
"Jan",
"Feb",
"Maa",
"Apr",
"Mei",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dec"
]


this code should go into nl.js and loaded after aw.js


Roebie, if you could send me Dutch translations of other strings (full months, weekdays) I will prepare such file and include it into 2.0. If somebody can do it for the other languages (or point me to the place where I can easily get this information) that would be great.
Alex (ActiveWidgets)
Wednesday, October 26, 2005
It's a very good idea to translate your widget in different language.
I can help you for French translation, if you want.
Pascal
Friday, October 28, 2005

This topic is archived.


Back to support forum

Forum search