translation
Audit
- Macro ID
- translation
- Source
- XS
- Type
- Generator
- Classification reason
- The output is the text of the translation key given as parameter, in the current language; the content is only a fallback, displayed when the key has no translation, so it is classified as a generator.
- Status
- Reviewed
- Criteria version
- 15.20
- XWiki version
- 18.8.0
- Audit date
- 2026-10-19
- Auditor
- Compared macros
- id display
Sources
Where to gather the information the criteria are checked against, see Gather the sources.
| Other sources specific to this macro |
|---|
|
| Criterion | Result | Notes |
|---|---|---|
| D1 wording | OK | "Translation" is the word for a translated text, which the macro displays from a UI translation key, like {{translation key="core.menu.create"/}} giving "Create". It is unrelated to the translations of a whole page, offered by the Page Translations panel. |
| D2 summary | KO | "Display a translation message." mostly repeats the name and does not say what the macro adds: the text of a translation key, in the language of the current user, with its parameters filled in. The German description, "Zeigt den übersetzten Text für einen Übersetzungsschlüssel an.", says it. |
| D3 category | KO | minor: Content, like the compared macro display, but the macro needs developer knowledge, the translation keys of the wiki, which only developers know: the XWiki pages use it in application sheets and administration pages. Development, where developers would also look for it, is missing. |
| D4 quick-action | KO | "translation", "Translation" and the French name "Traduction" give the macro first, and the synonym "message" fourth, after the Info, Warning and Error Box entries. The synonyms "localization", "i18n", "label" and "localized" give no result: typing "/localization" lists nothing. |
| L1 consistency | OK | compared with id and display: like them the macro has a mandatory target, the key, so its Quick Action and the Insert Macro dialog open the Edit Macro dialog, and the other parameters are optional with no declared default. Like display, it renders a fallback rather than an error when the target is missing, see E2. |
| L2 doc-parameters | KO | the parameters are only documented on the legacy extensions.xwiki.org page, not in the new documentation, and the content, the message displayed when the key has no translation, is not documented at all. |
| L3 doc-example | OK | the documentation gives the most common call, {{translation key="some.translation"/}} , and examples with parameters, a locale and script parameters; all render without error. The key "some.translation" does not exist, so each example only displays its key, and the documentation does not say where keys come from. The audit uses an existing key: {{translation key="core.menu.create"/}} , which displays "Create". |
| I1 pattern | OK | compared with children, the reference generator, and id. From Quick Actions, the "Translation" entry opens the Edit Macro dialog, since the key is mandatory, the generic behavior seen for id and display. From the Insert Macro dialog, the same Edit Macro dialog opens. |
| I2 zero-config | OK | submitting the Edit Macro dialog with the empty mandatory key keeps the dialog open with no message, the generic behavior of the dialog. {{translation/}} typed in the source gives "Invalid macro parameters used for the [translation] macro. Cause: [Property [key] mandatory]." in view mode, acceptable for a generator that needs its target. |
| I3 instant | N/A | |
| I4 cursor | N/A | |
| I5 focus | OK | the mandatory Key field comes first, above the tabs, visible without scrolling, and has the focus when the dialog opens. |
| E1 wysiwyg | OK | {{translation key="core.menu.create"/}} shows "Create" in the editor as in view mode. |
| E2 errors | KO | invalid values are accepted silently. A key that does not exist, a typo or a wrong case, like {{translation key="Core.Menu.Create"/}} , displays the key itself, "Core.Menu.Create", with no message; this is the documented fallback, but the user cannot tell a missing key from a translation. {{translation key=""/}} displays nothing. {{translation key="core.menu.create" locale="zz"/}} falls back to the current language silently. {{translation key="core.footer.creation" parameters="Alice"/}} gives "Created by Alice on {1}", the missing parameter left as a placeholder, and {{translation key="core.menu.create" scriptParameters="nosuchvar"/}} ignores the unknown variable. Only a malformed locale gives a message, {{translation key="core.menu.create" locale="xx_bogus"/}} : "Invalid macro parameters used for the [translation] macro. Cause: [Invalid locale format: xx_bogus].", which does not say the expected format, like "fr" or "fr_FR", and whose details are a stack trace. |
| E3 nesting | OK | in a list item, a table cell and a box, {{translation key="core.menu.create"/}} renders its text with no error, inline in the list item and the table cell, and the macro is edited through its dialog as at the top level. The content is only a fallback, typed in the dialog: a list, a table or a box in it render with no error when the key is missing. |
| E4 inline-support | OK | the macro declares inline support and renders {{translation key="core.menu.create"/}} inline in the middle of a sentence, in one paragraph, with no block breaking the line. |
| E5 empty | N/A | |
| E6 inplace | N/A |
Parameters
| Parameter | C1 clarity | C2 mandatory | C3 defaults | C4 input-assistance | C5 groups | C6 order | C7 alternatives | C8 advanced | C9 technical | C13 constraints | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| $content | KO | OK | N/A | OK | N/A | OK | N/A | N/A | N/A | N/A | C1: "The default translation message" does not say when it is shown, when the key has no translation, nor that it is wiki syntax; "default" reads as the message in the default language. The German "Der Standardtext, der angezeigt wird, wenn keine Übersetzung für die gesuchte Sprache gefunden wurde" says it. C2: optional, which is right: without it, the key itself is displayed. C4: a text area of the Edit Macro dialog, which fits a short fallback text typed once; the content is not the output of the macro, so it is not expected to be edited in place. C6: in the Optional parameters tab, before Locale; the most common example sets neither. |
| key | KO | OK | N/A | KO | OK | OK | N/A | OK | OK | N/A | C1: "The key associated with the translation" does not say what a key is, the identifier of a text in the translation files or Translations pages of the wiki, like core.menu.create, nor where to find the keys; the macro is in Content, so it is audited as a user macro, see D3. C2: mandatory with no default, which is right: the key is the text to display. C4: a plain text field, so the user has to know the exact key, case included: a typo displays the key, see E2. A picker suggesting the keys of the wiki with their text in the current language could be used. C13: N/A, a key is any text, not a range or a format; the missing picker is counted under C4. |
| locale | KO | OK | OK | KO | OK | OK | N/A | KO | OK | N/A | C1: the name "locale" is the parameter ID, shown "Locale" by the dialog, and the description "The locale in which to resolve the translation." uses the developer term locale where the users and the administration say language; it does not say the expected value, like "fr" or "fr_FR". The French "langue" and German "Sprache" use the user term. C3: the field opens empty, which stands for the current language, the value used in most cases, and the description says it: "Current one is used if not set." C4: a free text field, although the useful values are the languages of the wiki: an unknown language, like "zz", falls back silently, see E2. A select of the languages, like the one of the Localization administration, could be used. C8: not marked as advanced, although displaying a text in a fixed language is rare: no XWiki page sets it, only one example of the documentation. C9: an example of the documentation sets it. C13: N/A, the value is a language, checked by the select C4 asks for. |
| parameters | KO | OK | OK | OK | OK | OK | OK | OK | OK | N/A | C1: "The parameters to pass to the translation" does not say what they are, the values that replace the {0}, {1} placeholders of the translated text, nor that they are separated by commas. C3: the field opens empty, no parameters, the value used in most cases. C4: a text field, which fits a list of free values; a field per placeholder of the chosen key would be better but needs the key picker of C4 on key first. C7: shown with scriptParameters as one feature, the Parameters tab, whose alternatives are selected with radio buttons; neither is required, which is right. C9: two examples of the documentation set it. C13: N/A, a list of free texts. |
| scriptParameters | KO | OK | OK | OK | OK | OK | OK | KO | OK | N/A | C1, minor: "The name of the script variable containing the parameters to pass to the translation" is accurate for a developer, but does not say that the variable must hold a list, nor that the macro must be written by a user with script right, as the documentation says. C3: the field opens empty, the value used in most cases. C4: a text field, which fits the name of a script variable. C7: shown with parameters as one feature, see parameters. C8: not marked as advanced, although it only works inside a script macro and needs script right: it is for developers writing sheets. C9: an example of the documentation sets it, and XWiki sheets use it to pass values computed in Velocity. C13: N/A, a variable name. |
Other notes
The Parameters tab of the Edit Macro dialog, which holds the parameters feature, is titled "parameters", the feature ID, in every language: the feature has no translated name.
KOs and tickets
Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.
| KO | Criterion | Existing tickets | New tickets |
|---|---|---|---|
| D2 | D2 summary | XWIKI-25490 | |
| D3 | D3 category | XWIKI-25490 | |
| D4 | D4 quick-action | XWIKI-25444 | |
| L2 | L2 doc-parameters | XINFRA-525 | |
| E2 | E2 errors | XCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25505 (partial) | |
| C1:$content | C1 clarity, $content | XWIKI-25490 | |
| C1:key | C1 clarity, key | XWIKI-25490 | |
| C4:key | C4 input-assistance, key | XWIKI-23045 (partial) | XWIKI-25505 |
| C1:locale | C1 clarity, locale | XWIKI-25490 | |
| C4:locale | C4 input-assistance, locale | XWIKI-23045 (partial) | XWIKI-25505 |
| C8:locale | C8 advanced, locale | XWIKI-25491 | |
| C1:parameters | C1 clarity, parameters | XWIKI-25490 | |
| C1:scriptParameters | C1 clarity, scriptParameters | XWIKI-25490 | |
| C8:scriptParameters | C8 advanced, scriptParameters | XWIKI-25491 |
Tickets
| Ticket | Origin | KOs covered | KOs partly covered |
|---|---|---|---|
| XCOMMONS-3847 | New | E2 | |
| XRENDERING-823 | New | E2 | |
| XWIKI-25444 | New | D4 | |
| XWIKI-25490 | New | C1:$content C1:key C1:locale C1:parameters C1:scriptParameters D2 D3 | |
| XWIKI-25491 | New | C8:locale C8:scriptParameters | |
| XWIKI-23045 | Existing | C4:key C4:locale | |
| XWIKI-25505 | New | C4:key C4:locale | E2 |
| XINFRA-525 | New | L2 |
Known issues of this macro
No known issue is specific to this macro.
68 more known issues affect every macro: see the Known issues.
Lucas Charpentier