Page MenuHomePhabricator

Implement Lua alternative to {{int:Lang}} / wgUserLanguage
Open, HighPublic

Description

Central modules can help users and helpers, in their own languages and the wiki languages, using errors, warnings, categories, reports and tests.

Example: display a category in the helper language and link to the category in wiki language.

A module could find the user language from mw.uri.new().userLanguage

See in examples and the draft proposition of Central modules.

Details

Reference
bz66051

Related Objects

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 3:25 AM
bzimport set Reference to bz66051.
bzimport added a subscriber: Unknown Object (MLST).
Rical created this task.Jun 2 2014, 9:30 PM
Anomie added a comment.Jun 2 2014, 9:48 PM

The user language is not likely to be available in Scribunto, as it would cause cache fragmentation issues.

Rical added a comment.Jun 2 2014, 11:01 PM

The ask is only to read the user language code by a value or a function getUserLanguageCode() which return "en" or "fr"... Then the module can choose the right table in its own i18n tables. Then the module can display its messages in the best language for the user or the admin who maintains the page or the module.

Anomie added a comment.Jun 3 2014, 4:18 PM

Bottom line: this isn't going to happen unless the feature requested in bug 2085 gets implemented, for all the reasons that feature hasn't been implemented yet.

Rical added a subscriber: Rical.Dec 12 2014, 8:03 PM
Rical renamed this task from Get and use the user language to help to maintain a module or a template to Get the user language to help admins to maintain a module or a template.Jul 12 2015, 9:05 AM
Rical set Security to None.
Rical updated the task description. (Show Details)Dec 1 2015, 5:30 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 1 2015, 5:30 PM
Rical renamed this task from Get the user language to help admins to maintain a module or a template to Give at modules the user language to display errors and categories names for him.Apr 26 2016, 7:16 AM
Rical updated the task description. (Show Details)
Rical renamed this task from Give at modules the user language to display errors and categories names for him to Central modules need the user language to display errors and categories names for him.May 23 2016, 2:53 PM
Rical updated the task description. (Show Details)
Multichill raised the priority of this task from Lowest to High.Feb 18 2017, 2:50 PM

Bumping this one to high as T158470 got closed with a comment that it should happen here.

On https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua the user language is already offered, but always in combination with something else.
Currently things like "args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language" are being used to achieve this result.

IMO, it was a bad idea for {{int:}} to ever work on user language instead of on content/page/site language. I don't think we should extend that mistake.

Rical added a comment.EditedFeb 19 2017, 5:39 PM

For 2 months I use translate.init_wiki_user_page_lang() for your ask of 3 languages.
For this, central modules need T68051 and T142906.
I have also a marginal task to create:
T20170211 : in mw.language.fetchLanguageNames( 'fr' ) some languages names are not in French.
Search "versioning_tasks_report()" in Central-s-fr.

IMO, it was a bad idea for {{int:}} to ever work on user language instead of on content/page/site language. I don't think we should extend that mistake.

What you're saying is that we should only display Wikimedia Commons in English. Judging from your English Wikipedia user page you're a monolingual speaker of English. So you probably don't need it, but we have many other users for which we would like to display the interface in another language.

What you're saying is that we should only display Wikimedia Commons in English.

No. I just meant that a parser function is too early in the parse for internationalization to happen. I think it should happen later in the parse, like the language converter does.

Nemo_bis renamed this task from Central modules need the user language to display errors and categories names for him to Central modules need the user language to display errors and category names.Feb 27 2017, 9:44 AM
Rical added a comment.Apr 7 2017, 5:11 PM

We could have mw.language.getUserLanguage() with getContentLanguage() and getPageLanguage() to complete languages needs of any modules. See T161976

Lydia_Pintscher moved this task from incoming to monitoring on the Wikidata board.May 5 2017, 3:07 PM
Anomie renamed this task from Central modules need the user language to display errors and category names to Implement Lua alternative to {{int:Lang}} / wgUserLanguage.May 6 2019, 1:34 PM
Anomie added subscribers: Ricordisamoa, daniel.
Krinkle changed the status of subtask T4085: Add a {{USERLANGUAGE}} magic word from Open to Stalled.May 9 2019, 4:11 PM
Dvorapa added a subscriber: Dvorapa.May 9 2019, 4:34 PM

Is there any progress in this task?

IKhitron added a subscriber: IKhitron.