Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 559667

Summary: [DateTime] Territory is not parsed from the browser locale when the separator is a hyphen
Product: [RT] RAP Reporter: Kevin Emerson <kemerson>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.12   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/157872
https://git.eclipse.org/c/rap/org.eclipse.rap.git/commit/?id=1614216834f7bc3a379ceba9896ef7e2dd2205dd
Whiteboard:

Description Kevin Emerson CLA 2020-01-29 11:49:36 EST
Client.js in org.eclipse.rap.rwt splits the locale only by an underscore. A hyphen should also be supported because it is a commonly used separator between the language and territory returned by browsers for the locale. This impacts the Calendar within the DateTime widget in how it determines the first day of week for instance as it reads the locale from the navigator. 

See line 160 at:
https://github.com/eclipse/rap/blob/master/bundles/org.eclipse.rap.rwt/js/rwt/client/Client.js

  /**
   * @description Returns the region part from the browser locale.
   */
  getTerritory : function() {
    return this.getLocale().split( "_" )[ 1 ] || "";
  },


Bug 547507 may be related to this issue.
Comment 1 Ivan Furnadjiev CLA 2020-02-17 03:58:28 EST
Could you please provide a Gerrit change with proposed solution?
Comment 2 Eclipse Genie CLA 2020-02-18 02:57:09 EST
New Gerrit change created: https://git.eclipse.org/r/157872