New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 616684 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

ToLanguageCode in user metrics assumes that language code is always 2 letters long

Project Member Reported by js...@chromium.org, Jun 2 2016

Issue description

From https://cs.chromium.org/chromium/src/components/language_usage_metrics/language_usage_metrics.h?rcl=1464823126&l=31

 // Parses |locale| and returns the language code. Returns 0 in case of errors.
  // The language code is calculated from two alphabets. For example, if
  // |locale| is 'en' which represents 'English', the codes of 'e' and 'n' are
  // 101 and 110 respectively, and the language code will be 101 * 256 + 100 =
  // 25966.
  // |locale| should consist of only lower-case letters. This function doesn't
  // check whether |locale| is valid locale or not strictly.
  static int ToLanguageCode(const std::string &locale);

One of Chrome's UI language has 3-letter code ('fil' : Filipino) 

The above code would conflate 'fi' (Finnish) with 'fil' (Filipino) unless 'fil' is mapped to its 'legacy' code ('ta') before being fed to the above fucntion. 

As a result, 'fil'(Filipino) would not be counted at all. 



 
Components: Internals>Metrics

Sign in to add a comment