r79896 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79895‎ | r79896 | r79897 >
Date:13:10, 9 January 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
* (bug 26208) Mark directionality of some interlanguage links
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/languages/Names.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Names.php
@@ -33,8 +33,8 @@
3434 'bcc' => 'بلوچی مکرانی', # Southern Balochi
3535 'bcl' => 'Bikol Central', # Bikol: Central Bicolano language
3636 'be' => 'Беларуская', # Belarusian normative
37 - 'be-tarask' => 'Беларуская (тарашкевіца)', # Belarusian in Taraskievica orthography
38 - 'be-x-old' => 'Беларуская (тарашкевіца)', # Belarusian in Taraskievica orthography; compat link
 37+ 'be-tarask' => "\xE2\x80\xAAБеларуская (тарашкевіца)\xE2\x80\xAC", # Belarusian in Taraskievica orthography
 38+ 'be-x-old' => "\xE2\x80\xAAБеларуская (тарашкевіца)\xE2\x80\xAC", # Belarusian in Taraskievica orthography; compat link
3939 'bg' => 'Български', # Bulgarian
4040 'bh' => 'भोजपुरी', # Bhojpuri
4141 'bi' => 'Bislama', # Bislama
@@ -73,7 +73,7 @@
7474 'de' => 'Deutsch', # German ("Du")
7575 'de-at' => 'Österreichisches Deutsch', # Austrian German
7676 'de-ch' => 'Schweizer Hochdeutsch', # Swiss Standard German
77 - 'de-formal' => 'Deutsch (Sie-Form)', # German - formal address ("Sie")
 77+ 'de-formal' => "\xE2\x80\xAADeutsch (Sie-Form)\xE2\x80\xAC", # German - formal address ("Sie")
7878 'diq' => 'Zazaki', # Zazaki
7979 'dsb' => 'Dolnoserbski', # Lower Sorbian
8080 'dv' => 'ދިވެހިބަސް', # Dhivehi
@@ -103,8 +103,8 @@
104104 'ga' => 'Gaeilge', # Irish
105105 'gag' => 'Gagauz', # Gagauz
106106 'gan' => '贛語', # Gan (multiple scripts - defaults to Traditional)
107 - 'gan-hans' => '赣语(简体)', # Gan (Simplified Han)
108 - 'gan-hant' => '贛語(繁體)', # Gan (Traditional Han)
 107+ 'gan-hans' => "\xE2\x80\xAA赣语(简体)\xE2\x80\xAC", # Gan (Simplified Han)
 108+ 'gan-hant' => "\xE2\x80\xAA贛語(繁體)\xE2\x80\xAC", # Gan (Traditional Han)
109109 'gd' => 'Gàidhlig', # Scots Gaelic
110110 'gl' => 'Galego', # Galician
111111 'glk' => 'گیلکی', # Gilaki
@@ -232,7 +232,7 @@
233233 'ng' => 'Oshiwambo', # Ndonga
234234 'niu' => 'Niuē', # Niuean
235235 'nl' => 'Nederlands', # Dutch
236 - 'nl-informal' => 'Nederlands (informeel)', # Dutch (informal address ("je"))
 236+ 'nl-informal' => "\xE2\x80\xAANederlands (informeel)\xE2\x80\xAC", # Dutch (informal address ("je"))
237237 'nn' => "\xE2\x80\xAANorsk (nynorsk)\xE2\x80\xAC", # Norwegian (Nynorsk)
238238 'no' => "\xE2\x80\xAANorsk (bokmål)\xE2\x80\xAC", # Norwegian
239239 'nov' => 'Novial', # Novial
@@ -302,8 +302,8 @@
303303 'so' => 'Soomaaliga', # Somali
304304 'sq' => 'Shqip', # Albanian
305305 'sr' => 'Српски / Srpski', # Serbian (multiple scripts - defaults to Cyrillic)
306 - 'sr-ec' => 'Српски (ћирилица)', # Serbian Cyrillic ekavian
307 - 'sr-el' => 'Srpski (latinica)', # Serbian Latin ekavian
 306+ 'sr-ec' => "\xE2\x80\xAAСрпски (ћирилица)\xE2\x80\xAC", # Serbian Cyrillic ekavian
 307+ 'sr-el' => "\xE2\x80\xAASrpski (latinica)\xE2\x80\xAC", # Serbian Latin ekavian
308308 'srn' => 'Sranantongo', # Sranan Tongo
309309 'ss' => 'SiSwati', # Swati
310310 'st' => 'Sesotho', # Southern Sotho
Index: trunk/phase3/RELEASE-NOTES
@@ -70,6 +70,7 @@
7171 * (bug 26187) Confirmrecreate no longer parses the edit summary
7272 * (bug 25506) Exception is thrown if OutputPage::parse is called inside a tag hook,
7373 which would reset parser state
 74+* (bug 26208) Mark directionality of some interlanguage links
7475
7576 === API changes in 1.18 ===
7677 * (bug 26339) Throw warning when truncating an overlarge API result

Follow-up revisions

RevisionCommit summaryAuthorDate
r81350MFT r78808, r79896siebrand23:23, 1 February 2011

Comments

#Comment by Hashar (talk | contribs)   10:39, 2 February 2011

Could we make "\xE2\x80\xAA" and "\xE2\x80\xAC" constants?

Another idea would be to split the array in RTL and LTR language names, apply the constants and merge the arrays.

#Comment by Nikerabbit (talk | contribs)   10:43, 2 February 2011

I don't see enough benefit in such complication.

#Comment by Verdy p (talk | contribs)   06:35, 21 November 2013

if the problem is only with final parentheses, why using parentheses if you can use separation with hyphens? e.g. - 'Nederlands (informeel)' + 'Nederlands - informeel'

Also removes the leading control but not the final one.

I think it will be just safer to have separate lists for RTL and LTR languages. And for generating the HTML display of the language list on the side bar, there are other solutions: you can add these controls there. Leave returning clean values that won't break the layout of the rest (you seem to assume that the final parenthese will be using a LRM direction, this proves to be wrong when the autonoym of "be-x-old" would be followed by "fa": by forcing the next character to be LTR (withut knowing what it will be), this character will not be laid out correctly in the following name.

The W3C is right when it says that Bidi control characters should not be used in HTML, use CSS styles instead to generate the correct embedding or internal layout of the embedded text (e.g. absolute positioning of the block containing a language name, within a parent block element with relative positining).

You never need any RLM/LRM to create the correct layout of language names in a vertical or horizontal list for the side bar. You can also use the standard dir="" attribute in the absolutely positioned child block element (benefit: the alignment of the language name will be to the correct left or right margin, indepenantly of the directionality of the document in its own local language, even if it positions its vertical language bar on the other left or right side of the screen (yes bullets won't align, this is expected: you can sort languages into two separate lists: the LTR list then the RTL list (on LTR wikis) or the inverse (on RTL wikis), so that bullets will not alternate between left and right sides. Readability of these lists will also be improved by the placement of the name to their correct and expected side margin.

Status & tagging log