Poll: URI language identifier in core? You do not have permission to vote in this poll. |
|||
yes | 22 | 52.38% | |
no | 11 | 26.19% | |
maybe | 9 | 21.43% | |
Total | 42 vote(s) | 100% |
* You voted for this item. | [Show Results] |
Add URI Language Identifier to core? |
(04-21-2015, 11:03 AM)ivantcholakov Wrote: I took the values from the JSON files, codes there are with dashes (pt-BR, es-419), here is copy/paste of the English one: Apparently, I was mistaken, Unicode LDML specifies that either a dash or underscore may be used as a separator, and that BCP 47 identifiers are used in most cases. (BCP 47 being the same IETF syntax used by the W3C standard for language tags in HTML/XML.) Of course, BCP 47 does not permit underscores as separators, but the primary area of interest is the language/locale tags themselves, which are generally derived from the ISO 639 series of standards. (04-21-2015, 11:03 AM)ivantcholakov Wrote: @mwhitney That's all, more or less, my point. The routing is the portion most subject to the whims of the individual user. Language and locale tags have standards which define them in ISO 639-x and a series of IETF RFCs referenced as BCP 47 which have been adopted by the W3C for use in language attributes in HTML/XML. If the Lang class could understand language tags with a reasonable amount of variance (e.g. allow definition of the separator as a method argument), all of these other issues become much easier for the developer to solve in a manner that adheres to best practices. (04-21-2015, 11:03 AM)ivantcholakov Wrote: The tricky part is how external components (PHP or JavaScripts) identify languages, well, they do this in different ways: I agree that this is inevitable (and even necessary for short-term compatibility within CI itself, given the current language "idioms"). I even like the way you have implemented it so far. I don't think it's particularly tricky, once you have a method for dealing with standardized language identifiers. As you've shown in your own case, a simple mapping between the standard identifiers you already have and the component's non-standard identifiers is all that's needed. PHPMailer and CKEditor may not even need any significant mapping, in this case, and any mapping can be handled when integrating the component into your project. It may even be the case for any given project that someone has already created a mapping like this. |