Page MenuHomePhabricator

Provide banana-i18n module in ResourceLoader
Open, LowPublicFeature

Description

Feature summary (what you would like to be able to do and where):
Currently jquery.i18n is available as a ResourceLoader module. As I understand it, jquery.i18n seems to be deprecated in favour of banana-i18n, which is not available through ResourceLoader.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
As a userscript developer who wants to internationalise UI elements, having a modern i18n framework that is compatible with other parts of the MW ecosystem (e.g. TranslateWiki) is important. Another concern as a userscript developer is bundle size - having banana-i18n available through ResourceLoader would reduce the amount of external dependencies that need to be bundled into the userscript.

Benefits (why should this be implemented?):

  • ResourceLoader's caching of assets helps improve performance (userscripts are not able to be cached by default, but can be cached with the help of other tools)
  • Reduced bundle size for userscripts/gadgets that use banana-i18n

Details

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Sportzpikachu renamed this task from banana-i18n in ResourceLoader to Provide banana-i18n module in ResourceLoader.Dec 3 2023, 2:31 PM
Jdforrester-WMF subscribed.

This is not a request for the ResourceLoader library itself, but a use of that, so un-tagging; tagging in the Language Team who maintain this module.

Nikerabbit moved this task from Backlog to Potential tasks on the Language-Team board.

We discussed this among the engineers. This makes sense when building code that doesn't use jQuery. It should be quite easy to add this using the foreign resources framework.

Change #1034979 had a related patch set uploaded (by Sportzpikachu; author: Sportzpikachu):

[mediawiki/core@master] foreign-resources: Add banana-i18n library (v2.3.3)

https://gerrit.wikimedia.org/r/1034979