Every Member Settings page, and the three Date pages, now has the same sections: What it is, Read more, How to use it, How the numbers are calculated, How it works in WeKan, and Commits. Checked against the code; where the old text no longer matched, it is corrected: - Change Settings: the switches save at once, Save applies only the card-count number; the switches that were not documented (drag handles, marking changed cards, Submit editors with Enter, Open many cards at once, the checklist sound, the card count, the description rescue) are listed, and the count shows from that number of cards on, not only above it. - Edit Profile: a member's own username and e-mail change is saved when the Admin Panel allows it, not only for an administrator. - Support: a signed-out visitor is no longer sent to sign-in; the Public setting decides. - Calendar systems: the calendar is chosen in the Date popup; the date picker's Today button and year, month and day controls are described, and the heading shows the month and year. - Change Password: a change signs every session out. - Member Settings menu: Workload and Budget and billing entries, and the current labels Search All Boards and Archive. Thanks to xet7 !
5.6 KiB
Member Settings / Change Language
What it is
Change Language chooses the language of the WeKan interface for you. WeKan offers 245 languages and regional variants; the choice is saved to your profile, so it follows you to every browser. Until you choose one, WeKan follows the languages your browser asks for, and falls back to English. A site administrator can also set the language of all users at once in the database, as shown below.
Read more
- Language localisation and IETF language tag on Wikipedia.
- Accept-Language on MDN - the browser's language list that WeKan follows when you have not chosen one.
- Language browser settings - issue comment on how browser language settings affect WeKan.
- MongoDB Shell, used in the script below.
- Member Settings / Date - the date format is chosen there, not by the language.
How to use it
Choose your own language
- Click your username or avatar at the top right, then Change Language.
- The popup lists every language by its own name, with a flag, the region on a second line for regional variants, and (RTL) for languages written right to left. The current one has a check mark.
- Click a language. The interface switches at once and the choice is saved.
Change language for all users
Using MongoDB Shell with WeKan Snap Candidate, to change English date format to
DD/MM/YY by setting every user's language to en-GB. (Today the date format
can also be chosen directly in Member Settings / Date, by the
board and by the site, without changing the language.)
MongoDB Shell Download: https://www.mongodb.com/try/download/shell
language.sh:
mongosh --quiet \
--host 127.0.0.1 \
--port 27019 \
--eval 'use wekan' \
--eval 'db.users.updateMany({}, { $set: {"profile.language": "en-GB" }});'
Set script as executeable:
chmod +x language.sh
Running script, when 5 new users of total 20 users did not have language set correctly yet:
$ ./language.sh
{
acknowledged: true,
insertedId: null,
matchedCount: 20,
modifiedCount: 5,
upsertedCount: 0
}
Language browser settings
https://github.com/wekan/wekan/issues/4518#issuecomment-1133763518
How the numbers are calculated
- 245 languages: the entries of
languageMetadatain imports/i18n/languages.js; each loads its ownimports/i18n/data/<tag>.i18n.jsononly when it is chosen. - Columns: the popup fills the whole window and lays the languages out in
as many columns as fit, each at least 280px wide (or the full width on a
narrow screen):
repeat(auto-fill, minmax(min(100%, 280px), 1fr))in client/components/main/popup.css. - In the script output above,
matchedCountis how many user documents the filter{}found (all 20) andmodifiedCounthow many actually changed (the 5 that did not haveen-GByet).
How it works in WeKan
- Popup:
changeLanguagePopupin client/components/users/userHeader.jade; clicking a language (click .js-set-languagein userHeader.js) calls the methodsetLanguageand switches the page withTAPi18n.setLanguage(). - Method:
setLanguage(language)in server/models/users.js refuses a caller who is not signed in and a languageTAPi18n.isLanguageSupported()does not know, then savesprofile.language. - Browser fallback: with no saved language, the browser's ordered
languages are matched against the registry, with
_and@treated as-(normalizeLanguageTag()in imports/i18n/browserLanguage.js), so for exampleca@valenciaresolves to Valencian. - Tests: tests/browserLanguageFallback.test.cjs, tests/changeLanguageColumns.test.cjs, tests/newLanguageWiring.test.cjs and tests/i18nLazyLoading.test.cjs.
Commits
- a saved language with @ resolves, so ca@valencia shows Valencian
- language and country flags stay together on one row
- the RTL marker stays on the first line of the picker
- full-width language picker with separate language and region lines
- regional flags inside the language labels, and RTL layout reversed
- country and language flags for every regional locale
- the browser's ordered languages are used when no language is saved
- languages in several columns when there is width