mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 17:45:18 -05:00
- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. Thanks to xet7 !
6.3 KiB
6.3 KiB
Admin Panel / Settings / Translation
What it is
Custom translation strings: a language, the string to replace, and what it should say instead. They override the built-in translations for this instance, for example to use your organization's own word for "board" or to correct a string before the fix arrives from Transifex.
A string is stored per language, so the same string can be overridden differently in each. WeKan's own translations are not edited here — they come from Transifex.
Read more
- Internationalization and localization on Wikipedia.
- WeKan on Transifex - where the built-in translations are made.
- Table page - the shared table this pane is drawn with.
How to use it
Add a string
- Open Admin Panel / Settings / Translation
(
/admin/settings/translation). - Press New, the header of the first column.
- Language - the language tag,
enby default; it must be one of the languages WeKan has (as listed in imports/i18n/languages.js). - Text - the key of the string to replace, as it is in
imports/i18n/data/en.i18n.json,
for example
add-board. It is not the English sentence. - Translation text - what it should say instead.
- Press Save. If that language already has an override for that key, the popup says Edit custom translation string with the key and language, and nothing is saved.
Change or delete a string
- Press Edit on its row: only Translation text can be changed (Language and Text are read-only). Press Save.
- Or press ⋯ on its row, then Delete. Are you sure you want to delete this custom translation string? There is no undo.
Find a string
- Type in the search box and press Enter. It matches the language, the text and the translation text.
- Use prev/next to move between pages.
How the numbers are calculated
- Rows per page: 10 (
TABLE_PAGE_ROWS_PER_PAGEin models/lib/tablePage.js). One page is fetched at a time, server-side, newest-modified first. - The total (The number of custom translation strings is:) is the number of
strings that match the search, counted on the server by
getTranslationsCollectionCount. It is counted when the pane opens and when the search changes, not on prev/next. - page X / N:
N = max(1, ceil(total / 10)); the page is clamped to1 ... N, so deleting the last row of the last page lands on a real page (pageInfo()in the same file). - Search is a case-insensitive substring match; the characters of a regular expression are escaped, so what you type is matched literally.
How it works in WeKan
- Collection
translation(models/translation.js):language(allowed values: the tags inlanguages.js),text,translationText,createdAt,modifiedAt. - Methods in server/models/translation.js,
each site-admin only:
setCreateTranslation(refuses a second override of the same language and key withtext-already-taken),setTranslationText,deleteTranslationandgetTranslationsCollectionCount. - Permission: client-side insert, update and remove are site-admin only (server/permissions/translation.js), because several strings render as HTML.
- Publication
translation(server/publications/translation.js) returns one page, and only to a site administrator; a selector carrying an execution operator such as$whereis refused (safeSelector). - Where the overrides are applied:
loadLanguage()in imports/i18n/tap.js reads the overrides of that language and lays them over the built-in file. A value that is empty, only spaces or equal to the key is ignored, so the built-in text stays visible. On the server (emails and other server-made text) every override applies. In the browser the overrides come through the sametranslationpublication, which sends rows only to site administrators, so in the current code a user who is not a site administrator sees the built-in text. - The pane: client/components/settings/translationBody.jade and translationBody.js, through the shared table page.
- Tests: tests/translationPane.test.cjs and tests/tablePage.test.cjs.
Commits
- Custom translations are site-admin only, closing a MegaBleed/TenantBleed sibling
- The selector of the publication and the count is checked (WhereBleed)
- The table fits the pane
- The table lists its rows again
- Translation becomes a Settings pane, below Accessibility
- The pane gets the shared left menu
- The pane stops loading every custom string at once
- Some translations were not visible; the New link moves to the left
- Only a site administrator may create a custom translation
- A translation text may be set to an empty string
- Custom translation strings in the Admin Panel