This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | I18N - users language choice in browser not followed for download page | ||
---|---|---|---|
Product: | installer | Reporter: | Ken Frank <kfrank> |
Component: | Code | Assignee: | issues@installer <issues> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | CC: | jpirek |
Priority: | P2 | Keywords: | I18N |
Version: | 6.x | ||
Hardware: | Sun | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Ken Frank
2008-01-05 17:53:17 UTC
As far as I see the language preference has no influence on any known JavaScript vars (navigator.language, navigator.userLanguage, navigator.browserLanguage, navigator.systemLanguage, navigator.userAgent) that can in theory contain lang preferences. If I understand it correctly, the language preferences are passed via Accept-Language in HTTP header. And as far as I know there is no way to get it using JavaScript. Jan, am I right? Is there any way to workaround this situation? This might be might misunderstanding of navigator.userLanguage, navigator.browserLanguage, navigator.systemLanguage for IE - I had thought that one of those represented what user had chosen in browser options as preferred language; if not then I agree this part is not doable. But about user running non localized browser but in that locale, perhaps that can be gotten by one of above variables ? of course in either case or in case of user running localized IE in that locale, if the preferred language is not known, we are assuming they want to see download page in that language, even if it might not be true sometimes, that is, if they have preferred lang set to something else, but thats probably very small case. ken.frank@sun.com Ken, > This might be might misunderstanding of navigator.userLanguage, navigator.browserLanguage, navigator.systemLanguage > for IE - I had thought that one of those represented what user had chosen in browser options as > preferred language; if not then I agree this part is not doable. Unfortunately none of those vars contain the prefered language information. > But about user running non localized browser but in that locale, > perhaps that can be gotten by one of above variables ? Actually it IS defined now by: 1) navigator.userLanguage or, if it is not set, 2) navigator.language > of course in either case or in case of user running localized IE in that locale, > if the preferred language is not known, we are assuming they want to see download > page in that language, even if it might not be true sometimes, that is, if they > have preferred lang set to something else, but thats probably very small case. You can check the values by saving the following code as .html file and opening it in the browser): <html><body> <script type="text/javascript">document.write('Lang = ' + navigator.language + '<br>');</script> <script type="text/javascript">document.write('User Lang = ' + navigator.userLanguage + '<br>');</script> <script type="text/javascript">document.write('Browser Lang = ' + navigator.browserLanguage + '<br>');</script> <script type="text/javascript">document.write('System Lang = ' + navigator.systemLanguage + '<br>');</script> </body></html> In my IE (IE is english itself, ru_RU is set in the regional settings, no matter what is set in the list prefered languages): Lang = undefined User Lang = ru Browser Lang = en-us System Lang = ru As the result, "ru" is used as the right language (in case we have "ru" translation...). So I see no issue here. since none of those 3 navigator.* calls don't have the needed info, am closing this as wont fix (actually it can be fixed since we don't have access to server variables for this without asking user to confirm via a popup, nor can we run server side scripts to get this value. ken.frank@sun.com |