[Project_owners] Localization

Laeb (hotmail) laebcontact at hotmail.com
Fri Nov 7 12:32:47 EST 2003


Thank you David.
It works, but unfortunatly, not in an install file (.xpi) !!!

To sum up the situation: during installation, there is no way to know what
language is installed (without having to change access rights necessary for
"Components.class..." code) and there is no method for prompting the user
for the language he wants.

To choose a language, the only way i found is this:

var language;
var end;

do {
 end = true;
 if (confirm("English : [ click 'OK' to install english version ] \n\n>
Français: cliquer 'Annuler' pour le choix du Français\n> Deutsch : klicken
'Löschen' für Deutsch wahl")) language = "en-US";
 else
  if (confirm("Français: [ cliquer 'OK' pour installer la version
française ]\n\n> Deutsch: klicken 'Löschen' für Deutsch wahl")) language =
"fr-FR";
  else
   if (confirm("Deutsch : [ klicken 'OK' für deutsch version
anzubringen ]\n\n")) language = "de-DE";
   else end = false;
}while (!end)


----- Original Message ----- 
From: David Murray
To: Mozdev Project Owners List
Sent: Friday, November 07, 2003 5:04 AM
Subject: Re: [Project_owners] Localization


Wouldn't just a simple navigator.language work?

ie. alert(navigator.language);


Biju G C wrote:

> --- "Laeb (hotmail)" <laebcontact at hotmail.com> wrote:
>
>
>>Thank you Biju G C !
>>
>>
>
>no probs.
>
>
>
>>Do you know if this is the right way to get the UI language ?
>>
>>
>
>I also dont know :(
>Somebody else may be able to comment on this.
>
>FYI:
>After I saw your mail, thought it will be useful
>to all, so i googled.
>and got GetCategory( "NSILOCALE_MESSAGES" ) function.
>
>
>
>>Because this didn't give me the expected result (en-US)
>>but another language code.
>>
>>----- Original Message ----- 
>>From: Biju G C
>>To: Mozdev Project Owners List
>>Sent: Monday, November 03, 2003 9:54 PM
>>Subject: Re: [Project_owners] Localization
>>
>>
>>--- "Laeb (hotmail)" <laebcontact at hotmail.com> wrote:
>>
>>
>>>var localeService = Components.classes[
>>>
>>>
>>>
>>"@mozilla.org/intl/nslocaleservice;1"].getServiceComponents.interfaces.nsI
Lo
>>
>>
>>>caleService);
>>>var locale=localeService.GetApplicationLocale();
>>>
>>>
>>>
>>try
>>var locale  = Components.classes["@mozilla.org/intl/nslocaleservice;1"]
>>         .getService( Components.interfaces.nsILocaleService )
>>         .GetApplicationLocale()
>>         .GetCategory( "NSILOCALE_MESSAGES" );
>>
>>alert( locale );
>>
>>
>>you were missing "(" in getServiceComponents
>>and "GetCategory()"
>>
>>________________________________________________________________________
>>Want to chat instantly with your online friends?  Get the FREE Yahoo!
>>Messenger http://mail.messenger.yahoo.co.uk
>>_______________________________________________
>>Project_owners mailing list
>>Project_owners at mozdev.org
>>http://mozdev.org/mailman/listinfo/project_owners
>>_______________________________________________
>>Project_owners mailing list
>>Project_owners at mozdev.org
>>http://mozdev.org/mailman/listinfo/project_owners
>>
>>
>
>________________________________________________________________________
>Want to chat instantly with your online friends?  Get the FREE Yahoo!
>Messenger http://mail.messenger.yahoo.co.uk
>_______________________________________________
>Project_owners mailing list
>Project_owners at mozdev.org
>http://mozdev.org/mailman/listinfo/project_owners
>
>
>
>
>


_______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
http://mozdev.org/mailman/listinfo/project_owners


More information about the Project_owners mailing list