WebSafe 3.7mediawiki.org
|
|
🏠
Jump to content

Wikimedia Language and Product Localization/ULS Rewrite

From mediawiki.org

The Universal Language Selector (ULS) is a MediaWiki extension. Its main features are a language selector with search, support for web fonts and input methods, and entry points for changing user language, navigating to other language projects and language settings.

ULS was one of the earliest extensions created by the then-Language team (now Language and Product Localization, LPL). Over time, its aging codebase has become increasingly difficult to maintain. Any change carries a high risk of regressions, discouraging improvements or new feature development. Additionally, ULS suffers from performance issues and lacks proper dark mode support.

ULS will continue to generate technical debt and stand out from the rest of the user experience on our sites unless a full rewrite is done. With the Codex design system now stable, we believe the right time to modernize ULS is now.

Project goals

[edit]
  • Simplification. Drop deprecated dependencies. Use Codex design system and modern JavaScript. Use native JavaScript and CSS features that were not previously available. This will make maintenance easier and enable new feature development in the future.
  • Unified experience. Since ULS currently lives in an extension, MediaWiki core cannot use it, and it is hard for other extensions to depend on it. The new version will be available in MediaWiki Core and should be the default language selector everywhere in MediaWiki, including mobile skins, for consistent user experience.
  • Extensibility. There will be a clean, performant way to extend ULS to provide entry points to other tools or modify its behavior.
  • Modern experience. Thanks to Codex and use of native browser features we are expecting improvements to accessibility and performance. We will get the standard dark mode support.

Non-goals

[edit]
  • 1:1 copy of existing ULS. We want to take advantage of the learnings over a decade and make changes that align with the project goals. This is a chance to do things in a better way and remove functionality that is no longer justified.
  • Webfonts modernization. While webfonts will be minimally supported, broader redesign is out of scope. There is a growing need to support webfonts for issues beyond pure language support.
  • Updating non-MediaWiki uses of ULS. External software can continue to use jquery.uls for now, though it is in maintenance only mode already. We are hoping, but not promising, that the new language selector component can also be used outside of MediaWiki to provide a migration path away from jquery.uls.

Execution plan

[edit]

Phase 0: planning (Feb-Oct 2025)

[edit]

We spent time upfront clarifying scope, execution plan, dependencies, and risks. The outcome is this plan.

Phase 1: new language selector component (November-December 2025)

[edit]

We will implement a new Codex-based language selector component. This component will be included in MediaWiki Core either directly or via a library.

The new language selector component has responsive design with language search. It will support single/multiple language selection and have a non-JavaScript fallback.

To support language search, we will move the language search API to MediaWiki Core.

The language selector depends on the language-data library. We will bring this library as a new dependency to MediaWiki core and provide both PHP and JavaScript interfaces to access it. This is preparatory work to allow other code to start migrating away from $.uls.data.

We will replace existing language selectors in core and in select extensions (at least in those maintained by LPL team). We will not touch the main ULS entry points yet. This will help us validate and polish core functionality in a less risky way. ULS extension will stay available with minimal changes.

Phase 2: main desktop entry point (~January-June 2025; ample time reserved for phased roll-out)

[edit]

The main desktop entry point is the prominent interlanguage links (“X languages”) button in the Vector 2022 skin. We will review the entry point behavior in various use cases that depend on the availability of Wikibase, Content Translation, language variants, and the Translate extensions. This means that the button label will be different or not present in different situations.

The existing entry points of Content Translation, Translate, and Wikibase within the ULS main entry point will be updated to support the new version.

We will do the minimal work necessary to keep web fonts and input methods supported and accessible.

To allow for gradual roll-out, the new version will be behind a feature flag. It may also be conditional on a beta feature or user preference for a limited time. Tentative phased roll-out order is:

  • translatewiki.net
  • pilot wikis (TBD) as a beta feature for early feedback
  • special wikis
  • pilot wikis
  • rest non-Wikipedia
  • All Wikipedias

We are also considering this as an opportunity to move the translatable page (of the Translate extension) language switching to the main entry point out of the page content area. This is already technically possible, but requires community consultations.

Phase 3: unification and deprecation (~February-June 2026; work can start before roll-out has finished)

[edit]

We will be updating support for other skins and the mobile site to use the new language selector. Old ULS code will be deprecated and we'll contact maintainers of code that uses old ULS to ask and help them to migrate. There are many extensions and gadgets, user scripts. Some of them bundle jquery.uls, some use it via the ULS extension.

We are planning to remove the unused ULS code after MediaWiki 1.46 and associated MediaWiki Language Extension Bundle has been released.

Phase 4 (stretch goal): input methods rewrite (if time left after Phase 3)

[edit]

We will rewrite jquery.uls library to be data-only vanilla JavaScript and re-write the MediaWiki integration.