Index: trunk/phase3/tests/phpunit/languages/LanguageTrTest.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | * @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I |
26 | 26 | * @dataProvider provideDottedAndDotlessI |
27 | 27 | */ |
28 | | - function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) { |
| 28 | + function testChangeCaseOfFirstCharBeingDottedAndDotlessI( $func, $input, $inputCase, $expected ) { |
29 | 29 | if( $func == 'ucfirst' ) { |
30 | 30 | $res = $this->lang->ucfirst( $input ); |
31 | 31 | } elseif( $func == 'lcfirst' ) { |
— | — | @@ -62,6 +62,60 @@ |
63 | 63 | array( 'lcfirst', 'IPhone', 'upper', 'ıPhone' ), |
64 | 64 | |
65 | 65 | ); |
| 66 | + } |
| 67 | + |
| 68 | +##### LanguageTr specificities ############################################# |
| 69 | + /** |
| 70 | + * @cover LanguageTr:lc |
| 71 | + * See @bug 28040 |
| 72 | + */ |
| 73 | + function testLanguageTrLowerCasingOverride() { |
| 74 | + $this->assertEquals( 'ııııı', $this->lang->lc( 'IIIII') ); |
66 | 75 | } |
| 76 | + /** |
| 77 | + * @cover LanguageTr:uc |
| 78 | + * See @bug 28040 |
| 79 | + */ |
| 80 | + function testLanguageTrUpperCasingOverride() { |
| 81 | + $this->assertEquals( 'İİİİİ', $this->lang->uc( 'iiiii') ); |
| 82 | + } |
67 | 83 | |
| 84 | +##### Upper casing a string ################################################# |
| 85 | + /** |
| 86 | + * Generic test for the Turkish dotted and dotless I strings |
| 87 | + * See @bug 28040 |
| 88 | + * @dataProvider provideUppercaseStringsWithDottedAndDotlessI |
| 89 | + */ |
| 90 | + function testUpperCasingOfAStringWithDottedAndDotLessI( $expected, $input ) { |
| 91 | + $this->assertEquals( $expected, $this->lang->uc( $input ) ); |
| 92 | + } |
| 93 | + function provideUppercaseStringsWithDottedAndDotlessI() { |
| 94 | + return array( |
| 95 | + # expected, input string to uc() |
| 96 | + array( 'IIIII', 'ııııı' ), |
| 97 | + array( 'IIIII', 'IIIII' ), #identity |
| 98 | + array( 'İİİİİ', 'iiiii' ), # Specifically handled by LanguageTr:uc |
| 99 | + array( 'İİİİİ', 'İİİİİ' ), #identity |
| 100 | + ); |
| 101 | + } |
| 102 | + |
| 103 | +##### Lower casing a string ################################################# |
| 104 | + /** |
| 105 | + * Generic test for the Turkish dotted and dotless I strings |
| 106 | + * See @bug 28040 |
| 107 | + * @dataProvider provideLowercaseStringsWithDottedAndDotlessI |
| 108 | + */ |
| 109 | + function testLowerCasingOfAStringWithDottedAndDotLessI( $expected, $input ) { |
| 110 | + $this->assertEquals( $expected, $this->lang->lc( $input ) ); |
| 111 | + } |
| 112 | + function provideLowercaseStringsWithDottedAndDotlessI() { |
| 113 | + return array( |
| 114 | + # expected, input string to lc() |
| 115 | + array( 'ııııı', 'IIIII' ), # Specifically handled by LanguageTr:lc |
| 116 | + array( 'ııııı', 'ııııı' ), #identity |
| 117 | + array( 'iiiii', 'İİİİİ' ), |
| 118 | + array( 'iiiii', 'iiiii' ), #identity |
| 119 | + ); |
| 120 | + } |
| 121 | + |
68 | 122 | } |
Index: trunk/phase3/languages/classes/LanguageTr.php |
— | — | @@ -28,4 +28,16 @@ |
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
| 32 | + /** @see bug 28040 */ |
| 33 | + function uc( $string ) { |
| 34 | + $string = preg_replace( '/i/', 'İ', $string ); |
| 35 | + return parent::uc( $string ); |
| 36 | + } |
| 37 | + |
| 38 | + /** @see bug 28040 */ |
| 39 | + function lc( $string ) { |
| 40 | + $string = preg_replace( '/I/', 'ı', $string ); |
| 41 | + return parent::lc( $string ); |
| 42 | + } |
| 43 | + |
32 | 44 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -277,7 +277,8 @@ |
278 | 278 | * (bug 27681) Set $namespaceGenderAliases for Portuguese (pt and pt-br) |
279 | 279 | * (bug 27785) Fallback language for Kabardian (kbd) is English now. |
280 | 280 | * (bug 27825) Raw watchlist edit message now uses formatted numbers. |
281 | | -* (bug 28040) Turkish: properly lower case 'I' to 'ı' (dotless i) |
| 281 | +* (bug 28040) Turkish: properly lower case 'I' to 'ı' (dotless i) and |
| 282 | + uppercase 'i' to 'İ' (dotted i) |
282 | 283 | |
283 | 284 | == Compatibility == |
284 | 285 | |