Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rheingoldriver/livei18n
Lightweight translation extension for MediaWiki
https://github.com/rheingoldriver/livei18n
Last synced: 24 days ago
JSON representation
Lightweight translation extension for MediaWiki
- Host: GitHub
- URL: https://github.com/rheingoldriver/livei18n
- Owner: RheingoldRiver
- License: gpl-2.0
- Created: 2022-05-15T04:35:34.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-17T11:57:17.000Z (about 2 years ago)
- Last Synced: 2024-10-08T22:23:14.079Z (about 1 month ago)
- Language: PHP
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LiveI18n
Lightweight translation extension for MediaWiki## Motivation & use
If you want to extend the translation of the interface slightly to infobox labels and navigational help, but not your main content, the Translate extension is a bit excessive. It's possible to use the MyVariables `{{USERLANGUAGECODE}}` magic word with the `#switch` parser function, but this is a bit unwieldy; and it's also possible to use the `int` magic word, but this requires sysop permissions to edit the MediaWiki namespace (and is also a bit inconvenient, because you have to edit multiple pages to edit the content).
This extension attempts to present an alternative, with a single parser function that captures the spirit of the MyVariables/switch approach:
```
{{#live_i18n:en=hello|es=hola}}
```There is also Lua support:
```lua
mw.ext.live_i18n.translate{ en = "Hello", es = "Hola" }
```## Configuration
You can set a variable `$wgLiveI18nDefaultLanguageCode` with the default language to use; this is what will display if the user's language is not present in the parser function. The default value provided by the extension is null, which makes the extension default to the value of `$wgLanguageCode`.