I might be biased because I recently spent a couple days wrestling with it, but I think the Turkish case is more interesting. There are two vowels that use the letter I forms: İ/i and I/ı So the lowercase and uppercase are essentially split into two letters and then a new uppercase and lowercase form is created based on growing or shrinking the originals. I'm sure it seemed quite the elegant solution in the 1920s whe…
CSS text-transform is language-dependant: the Dutch case explained
11–19 of 19 posts
Re: CSS text-transform is language-dependant: the Dutch case explained
#12Earlier quoted context omitted.
It's really weird that they just add special cases like that. Though I expect it's just because they don't have enough special cases yet (went from one — for the Turkish I — to two). I'd have expected something like a generic Unicode-aware/y text management layer, and CSS text transforms would just go through that layer.
Eek. Not only are they hardcoding the logic but they mix their CSS-specific code into the function. I understand that they are handling a limited number of cases now but if I came across that kind of code in my work I'd be very sceptical.
Making something more complicated doesn't make it better. Make it more complicated when you need to, not before.
Re: CSS text-transform is language-dependant: the Dutch case explained
#13Earlier quoted context omitted.
Here's the diff: https://hg.mozilla.org/mozilla-central/rev/bb53aec4a302 Doesn't look too bad
It's really weird that they just add special cases like that. Though I expect it's just because they don't have enough special cases yet (went from one — for the Turkish I — to two). I'd have expected something like a generic Unicode-aware/y text management layer, and CSS text transforms would just go through that layer.
Re: CSS text-transform is language-dependant: the Dutch case explained
#14Re: CSS text-transform is language-dependant: the Dutch case explained
#15Earlier quoted context omitted.
It's really weird that they just add special cases like that. Though I expect it's just because they don't have enough special cases yet (went from one — for the Turkish I — to two). I'd have expected something like a generic Unicode-aware/y text management layer, and CSS text transforms would just go through that layer.
I wonder how the German ß is handled. Having no clue about the implementation of these transforms, wouldn't that be a similar case?
There is some specific cases with accented Greek diphthongs, where the diacritic position changes in upper and lower case, but Mozilla is working on a fix.
Re: CSS text-transform is language-dependant: the Dutch case explained
#16Of course, this can't possibly work with Kanji without some special hack around.
Re: CSS text-transform is language-dependant: the Dutch case explained
#17there is no such word as "dependant." it's "dependent." really sorry to be that guy but it would hugely brighten my day if you could fix the spelling in the title.
A more constructive comment might be, "the spelling variant you have used is normally a noun meaning 'a person who depends on another for their upkeep or care', where here you want the more normal adjectival spelling 'dependent'."
Although fwiw it seems that even as an adjective "dependant" might fly: http://www.wordnik.com/words/dependant
Re: CSS text-transform is language-dependant: the Dutch case explained
#18Earlier quoted context omitted.
Here's the diff: https://hg.mozilla.org/mozilla-central/rev/bb53aec4a302 Doesn't look too bad
It's really weird that they just add special cases like that. Though I expect it's just because they don't have enough special cases yet (went from one — for the Turkish I — to two). I'd have expected something like a generic Unicode-aware/y text management layer, and CSS text transforms would just go through that layer.
Language-aware bits are more gross, but then language often is. It's not nicely structured like most of the other things we encounter when transforming data.
Re: CSS text-transform is language-dependant: the Dutch case explained
#19Earlier quoted context omitted.
It's really weird that they just add special cases like that. Though I expect it's just because they don't have enough special cases yet (went from one — for the Turkish I — to two). I'd have expected something like a generic Unicode-aware/y text management layer, and CSS text transforms would just go through that layer.
The problem is that Unicode doesn't know about language. Unicode is just characters. Language-aware bits are more gross, but then language often is. It's not nicely structured like most of the other things we encounter when transforming data.
I won't blame you for this, it is a common mistake, but Unicode goes far beyond merely mapping characters to integers. The Standard Annexes, Technical Reports and Technical Specifications cover pretty much all things localization from line breaking [UAX14] to regular expressions [UTS18] through date and time formatting [UTS35] or sorting [UTS10].
And as it turns out, both uppercasing and titlecasing are covered by [UAX44] as part of the SpecialCasing.txt file which provides lower, upper and title-casing (along with optional conditions) for characters with non-trivial mappings (trivial 1:1 mappings are covered in the base UnicodeData.txt file)
[UAX14] http://www.unicode.org/reports/tr14/
[UTS18] http://www.unicode.org/reports/tr18/
[UTS35] http://www.unicode.org/reports/tr35/