Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

disallowBlankTranslations should allow exceptions #69

Open
niedzielski opened this issue Jan 17, 2019 · 6 comments
Open

disallowBlankTranslations should allow exceptions #69

niedzielski opened this issue Jan 17, 2019 · 6 comments

Comments

@niedzielski
Copy link

The disallowBlankTranslations option is global and useful to enable. However, some strings support an empty state and should be excluded. This circumstance occurred recently for a string in MobileFrontend.. The translator wishes to suppress this messaging but it is not permitted by banana checker.

@Krinkle
Copy link
Member

Krinkle commented Jan 17, 2019

Yep, for the same reason, this rule is also disabled in MediaWiki core.

Perhaps one way to make this work is to build on top of the existing conventions we have that communicate with translatewiki.net translators. In particular, we use the {{Ignore}} and {{Optional}} annotations in the qqq-entry for interface messages that are intentionally left empty.

Banana checker could look for that, and tolerance emptiness in those case.

@jdlrobson
Copy link
Member

Can {{Ignore}} be used in translations themselves or just qqq at the moment?

@Krinkle
Copy link
Member

Krinkle commented Jan 18, 2019

@jdlrobson I'm not sure I understand the question, or rather, why.

It is technically valid for the characters {{Ignore}} to be used as part of a translation, as would be any other (wiki)text. But doing that would (and should), in that case, be considered an actual translation - not something for a linter to inspect and think about.

Within the localisation system, we've designated exactly one non-language message file to host information that isn't intended for end-users as a translation: qqq. (That is uselang=qqq will fallback to uselang=en the same way uselang=somethingelseinvalid would).

Instead, the qqq values are shown to translators on translatewiki.net where there is conventions and semi-automation in place around its format. Including these template tags, which Niklas and Raimond monitor to update their "Ignore" list in the configuration of the translation software (source) - this in turn excludes these messages from the list of "Messages needing translation" in their UI, etc. It's an existing convention we can leverage by having banana-checker inspect qqq values for things like {{Ignore}}

Having said that, I'm quite open to solving this a different way. Is there a different place you have in mind to store this information?

@jdforrester
Copy link
Member

I'm not in love with inspecting the values of qqq messages, but if that's the only sane way forward so be it. Changing disallowBlankTranslations to accept an allowList would be pretty easy, but it sounds like that wouldn't suffice?

@Krinkle
Copy link
Member

Krinkle commented Jul 30, 2019

The main reason I'd like to explore inspecting {{Ignore}} is because that is currently the canonical indicator as used by translatewiki for the same purpose.

We could require developers to manually enumerate all keys they want to ignore, but then they would still also have to set their documentation keys to {{Ignore}}. At that point, it seems more efficient for everyone if we use that as our declarative interface directly.

@jdforrester
Copy link
Member

My concerns about this are two-fold:

  • this isn't structured data controlled by the developer, unlike the rest of the control flags; and
  • we're potentially going to have to hack in support for quite a few versions of the tags – for instance, it's not {{Ignore}} canonically, but {{notranslate}} (See the what links here)

Also, PR #74 will fixe the request as opened, but let's leave this open for wider discussion?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants