Someone created a language "gsw-berne" that is swiss german. This is an incorrect ISO code and it should be "de-CH".

This breaks in several places. e.g. we need the proper lang code for reCAPTCHA, see https://developers.google.com/recaptcha/docs/language what Google supports.

British English is en-GB and is correct in Drupal just as one example.

Comments

hass’s picture

Issue summary: View changes
liam morland’s picture

Issue summary: View changes
gábor hojtsy’s picture

Version: » 7.x-1.x-dev

gsw is Swiss German according to the W3C specs, see http://r12a.github.io/apps/subtags/ (which is the official search/verification tool linked from http://www.w3.org/International/articles/language-tags/).

de-ch may not mean the same language, see #1328690: Add "German, Switzerland" language to l.d.o for example.

hass’s picture

That is not correct. "Schweizerdeutsch" (swiss german) is lang code "de-CH". In every software. Just because it is German prefixed does not mean it need to be located in Germany. In Austria, Switzerland and Germany we speak German, but there are "dialects" and this is what de-CH and de-AT was made for. To allow swiss people to write swiss german.

Check out Firefox, Windows, IE and others.

gábor hojtsy’s picture

Yeah see the discussion in #600438: Add Swiss German language to l.d.o including me pushing back 6 years ago to use de-CH instead and then conceding to the actual Swiss community.

hass’s picture

Ok. I think this explains it.

Can you correct at least the project title of https://localize.drupal.org/translate/languages/gsw-berne to "Bernese German", please?

"Swiss German" is an incorrect title and caused the main confusion.

hass’s picture

Title: Rename incorrect language "gsw-berne" to "de-CH" » Rename incorrect language title "Swiss German" to "Bernese German"
gábor hojtsy’s picture

Status: Active » Closed (works as designed)

As per http://r12a.github.io/apps/subtags/ (enter "gsw" into the lookup field), "gsw" is either Swiss German or Alemannic or Alsatian, not Bernese German. (BTW more info from that page going to http://www.ethnologue.com/language/gsw)

The source database of language codes the W3C refers to is maintained by IANA ("The Internet Assigned Numbers Authority (IANA) is responsible for the global coordination of the DNS Root, IP addressing, and other Internet protocol resources."). According to the IANA registry that W3C refers to (http://www.iana.org/assignments/language-subtag-registry/language-subtag...), other than gsw there are sgg, slf and ssr for Swiss German **Sign Language** and de-CH-1901 and de-CH-1996 are maintained as redundant (see http://www.w3.org/International/articles/language-tags/#grandfathered for explanation on redundant as "in the registry mostly 'as a matter of historical curiosity'").

According to the official IANA registry that the W3C's accepted language codes are based on it is neither correct to say "gsw" is Bernese German, neither correct to say "de-CH" is Swiss German. I suggest you contact the IANA for corrections.

gábor hojtsy’s picture

BTW Drupal 8 has this fancy mappings system for languages (http://cgit.drupalcode.org/drupal/tree/core/modules/language/config/inst...) with the understanding that some systems don't follow the W3C standards for language codes. It is easy to add a de-CH mapping to this file in Drupal 8. The browser language detection (which is also used to pick your suggested installation language) as well as CKEditor's translation integration uses this mapping (see #2050097: Map CKEditor languages to Drupal languages) to map to alternate language codes, when the external system understands different standards. Drupal 7 does not have a similar mapping system unfortunately that I know.

liam morland’s picture

It might be helpful to point out that ISO 639-1 is 2-letter codes for each language while ISO 639-2 and ISO 639-3 are 3-letter codes. In ISO 639-2 and ISO 639-3, GSW refers to Swiss German. There is no separate code for Swiss German in ISO 639-1, so DE-CH is used.

gábor hojtsy’s picture

Well, W3C language tags is based on BCP47, not one ISO standard directly. BCP47 in turn is based on different ISO standards. The BCP47 text itself has this to say on Swiss:

   The choice of subtags used to form a language tag SHOULD follow these
   guidelines:

   1.  Use as precise a tag as possible, but no more specific than is
       justified.  Avoid using subtags that are not important for
       distinguishing content in an application.

       *  For example, 'de' might suffice for tagging an email written
          in German, while "de-CH-1996" is probably unnecessarily
          precise for such a task.

       *  Note that some subtag sequences might not represent the
          language a casual user might expect.  For example, the Swiss
          German (Schweizerdeutsch) language is represented by "gsw-CH"
          and not by "de-CH".  This latter tag represents German ('de')
          as used in Switzerland ('CH'), also known as Swiss High German
          (Schweizer Hochdeutsch).  Both are real languages, and
          distinguishing between them could be important to an
          application.