Page MenuHomePhabricator

Make babel extension case aware in order to avoid clashes with existing user templates
Closed, ResolvedPublic

Description

The commons babel template has the special feature "Bitmap graphics editors" (and others which are working, but it is not working with the babel extension because it is conflicting with Bulgarian (?). See also related discussion at
https://commons.wikimedia.org/wiki/Category_talk:Graphics_abilities#update_tag

regards


Version: unspecified
Severity: normal

Details

Reference
bz34680

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:12 AM
bzimport set Reference to bz34680.

Currently {{#babel}} function does not differentiate between upper and lower case codes. However at least on on commons and EN Wikipedia we seem to have many existing user templates which only differ by the capitalization, for example [[commons:template:User BG-3]] gives 'This user is able to contribute at an advanced level to bitmap graphics (JPEG, PNG,...)." message and is unrelated to [[commons:template:User bg-3]] about user knowledge of Bulgarian language.
See [[commons: User_talk:JarektBot#.22bitmap_graphics.22_and_.22audio_file.22_became_bulgarian_and_afrikaans]] and [[w:en:User:Jarekt/b ]]for more examples. As a result every box in {{Babel|BG-3|AF-1|ANI-3|VI|win|bot|CID|align=left}} {{#babel:BG-3|AF-1|ANI-3|VI|win|bot|CID}} would get rendered differently.

In many cases the clash can be avoided if Babel extension would pay attention to capitalization. May be the ideal approach would be to use 3 step procedure:

  1. treat lower case codes as language code,
  2. if the code uses any capital letters than check if there is a match to existing template first
  3. if no local template exist that matches the capitalization than convert the code to lower case and try matching to the language codes again.

In some cases the clashes can not be avoided since local templates commons:template:User bot or commons:template:User win use lower case and clash with Ho-Chunk and Bongo languages. However in those cases local template can be renamed to commons:template:User Bot or commons:template:User Win to keep them separate.

Fixed in r112402 (uses 3 steps as described in comment 2).