JDK-6676491 : Incorrect locale specified in the URL embedded in the register[_].html
  • Type: Bug
  • Component: install
  • Sub-Component: servicetags
  • Affected Version: 6u6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-03-18
  • Updated: 2010-09-24
  • Resolved: 2008-03-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u6 b02Fixed
The offline registration page embeds the URL to post the data to Sun and open the JDK registration page in the browser.  The URL parameter for all register.html, register_ja.html, and register_zh_CN.html should have the corresponding locale set in the locale parameter.  Currently it is incorrectly set to the default locale as the link for the online registration page.
In addition, the Registration Relay Service (RRS) doesn't support all 3 forms of locales:
 Locale(String language)
 Locale(String language, String country)
 Locale(String language, String country, String variant)

It's one-to-one mapping of a given locale parameter passed in the URL. 

The offline registration page should have the locale parameter matched to the locale for that page. i.e. locale=en for register.html, locale=ja for register_ja.html, and locale=zh_CN for register_zh_CN.html.  Ideally the RRS should recognize all 3 forms of locales and show the best candidate.  Due to the one-to-one mapping design, we have to leave with this restriction and with the assumption that only ja and zh_CN are only supported. The URL for the online registration will also have the locale parameter set to either a JDK supported locale or the default one.

 If the registration is translated for a new locale in the future, JDK will have to make change

SUGGESTED FIX sccs diffs Installer.java SunConnection.java ------- Installer.java ------- 627,632c627,630 < List<Locale> candidateLocales = getCandidateLocales(Locale.getDefault()); < for (Locale l : candidateLocales) { < if (!locale.equals(locale) && supportedLocales.contains(l)) { < name = REGISTRATION_HTML_NAME + "_" + l.toString(); < break; < } --- > Locale locale = getDefaultLocale(); > if (supportedLocales.contains(locale)) { > // if the default locale is supported > name = REGISTRATION_HTML_NAME + "_" + locale.toString(); 647a646,655 > private static Locale getDefaultLocale() { > List<Locale> candidateLocales = getCandidateLocales(Locale.getDefault()); > for (Locale l : candidateLocales) { > if (supportedLocales.contains(l)) { > return l; > } > } > return Locale.getDefault(); > } > 753,754d760 < String registerURL = SunConnection.getRegistrationURL( < regData.getRegistrationURN()).toString(); 783a790,792 > String registerURL = SunConnection. > getRegistrationURL(regData.getRegistrationURN(), > locale).toString(); 888c897 < SunConnection.register(regData); --- > SunConnection.register(regData, getDefaultLocale()); ------- SunConnection.java ------- 50c50 < * <registration-url>/<registry_urn>?product=jdk&locale=<default-locale>--- > * <registration-url>/<registry_urn>?product=jdk&locale=<locale> 62c62 < static URL getRegistrationURL(String registrationURN) { --- > static URL getRegistrationURL(String registrationURN, Locale locale) { 80c80 < String registerURL = rewriteURL(url, registrationURN); --- > String registerURL = rewriteURL(url, registrationURN, locale); 92c92 < private static String rewriteURL(String url, String registryURN) { --- > private static String rewriteURL(String url, String registryURN, Locale locale) { 102c102 < sb.append("locale=").append(Locale.getDefault().toString()); --- > sb.append("locale=").append(locale.toString()); 112a113 > * @param locale Locale 116c117 < public static void register(RegistrationData regData) throws IOException {--- > public static void register(RegistrationData regData, Locale locale) throws IOException { 118c119,120 < URL url = getRegistrationURL(regData.getRegistrationURN()); --- > URL url = getRegistrationURL(regData.getRegistrationURN(), > locale);

EVALUATION We need to fix in JDK 6u6. The Sun Connection registration web application will support L10N in the March release. Once it hosts the translated page, the users may see a Japanese translated page even for Chinese developers.