Page MenuHomePhabricator

Use the "colon-separator" message rather than a hard-coded colon so that it can be internationalised
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  1. Go to https://www.wikifunctions.org/view/ty/Z12448 . This is a function shown in Tahitian (ty). Its first input name is defined in French (fr), but not in Tahitian (ty).
  2. Go to https://www.wikifunctions.org/view/fr/Z12448 . This is the same function shown in French.

What happens?:

  1. When viewing in Tahitian, the first input's name is shown as Sans titre: chaîne (Untitled: String)
  2. When viewing in French, the first input's name is shown as base verbale: chaîne.

What should have happened instead?:

When "Untitled" has to be shown, it should be shown as Sans titre : chaîne, with a space before the ':' character (or however the French language localizers decide to translate it).

When a translated label is available, it should be shown as base verbale : chaîne.

Unlike in most other languages, in French, a space is usually written before the colon character.

Here, it cannot be written because it is not a part of the message, as it should be (this convention is documented at https://www.mediawiki.org/wiki/Help:System_message#Do_not_expect_symbols_and_punctuation_to_survive_translation ).

I don't know Vue well, but if I'm reading the code correctly, it is probably hard-coded in resources/ext.wikilambda.app/components/widgets/about/AboutLanguageBlock.vue:

<span
        v-else
        class="ext-wikilambda-app-about-language-block__input-label
                ext-wikilambda-app-about-language-block__unavailable"
>{{ $i18n( 'wikilambda-editor-default-name' ).text() }}<span>:</span>
</span>&nbsp;<wl-z-object-to-string :row-id="input.typeRowId"></wl-z-object-to-string>

The colon should definitely be a part of the message. Beyond French, there are probably other languages that need to write it differently and not as a : character concatenated immediately to the end of the message. For example, Chinese and some other languages use an entirely different character.

I recommend going even further and putting the thing that comes after the colon within the message. If I understand correctly, in the case of listing inputs, it is always a link to a type. Currently, there appears to be a hardcoded &nbsp; there. It probably doesn't have to be an &nbsp; at all, and the translators should be allowed to write whatever they want here. The link to the type should be inserted as a parameter, so the English message would probably be $1: $2, where $1 is "Untitled" or the translated label, and $2 is the link to the type.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Deployed on wikifunctions.org.

Other information (browser name/version, screenshots, etc.):

Event Timeline

Amire80 renamed this task from Hardcoded colon character is shown after "Untitiled" in functions without defined input names to Hardcoded colon character is shown after "Untitiled" or input name.Feb 5 2025, 1:28 PM
Amire80 renamed this task from Hardcoded colon character is shown after "Untitiled" or input name to On Wikifunctions function pages, hardcoded colon character is shown after "Untitiled" or input name.
Amire80 updated the task description. (Show Details)
Jdforrester-WMF renamed this task from On Wikifunctions function pages, hardcoded colon character is shown after "Untitiled" or input name to Use the "colon-separator" message rather than a hard-coded colon so that it can be internationalised.Feb 5 2025, 5:52 PM
Jdforrester-WMF triaged this task as Low priority.

Change #1130646 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Don't use a raw ':' but fetch it from MW's i18n, as it's over-ridden in some languages

https://gerrit.wikimedia.org/r/1130646

Jdforrester-WMF changed the task status from Open to In Progress.Mar 24 2025, 3:59 PM
Jdforrester-WMF claimed this task.

Change #1130646 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Don't use a raw ':' but fetch it from MW's i18n, as it's over-ridden in some languages

https://gerrit.wikimedia.org/r/1130646