Page MenuHomePhabricator

Reduce CSS and image code in Developer Portal translatable messages
Closed, ResolvedPublic1 Estimated Story Points

Description

I've started translating the messages on translatewiki. An immediate thing I'm noticing is code in messages such as:

  • [Get started](get-started/){ .md-button .md-button--primary } - "Get started" definitely needs a translation. "(get-started/)" can be left in for consistency with other messages that have link targets, although removing it would be nice, too. But "{ .md-button .md-button--primary }" looks like CSS code that probably shouldn't be in a translatable message.
  • ![](/assets/book.svg#only-light) ![](/assets/book-dark.svg#only-dark) looks like pure code. It's possible to mark it as ignored on translatewiki, but ideally, it shouldn't come to translatewiki at all.
  • ![](/assets/chemistry.svg#only-light) ![](/assets/chemistry-dark.svg#only-dark) - as above.

There are more example, but I hope that this is enough for first examples.

Event Timeline

Aklapper renamed this task from Reduce code in Developer Portal translatable messages to Reduce CSS and image code in Developer Portal translatable messages.May 18 2022, 6:38 AM

Thanks for starting this discussion @Amire80. The issues you are flagging are all things that I saw myself while working on the code that extracts these translation units from the markdown source.

The main issue we have in taking any useful actions here is that there are very few hook points in the 3rd party mdpo library that we are relying on in both the message catalog creation phase (which puts these units into the English PO file that serves as our POT) and also in the localization phase where we generate pages based on the other PO files that TWN sends back to us.

It would be ideal to have some magic similar to <tvar/> from the Translate extension, but I have not yet been able to devise a clever way to do this. Software engineering resource reality for this project today makes it unlikely that we will be able to make major advances in how the catalog is created in any reasonable amount of time.

Maybe there is some configuration on the TWN side that we can do which would provide partial help in the near term? @abi_ setup some patterns in https://gerrit.wikimedia.org/r/c/translatewiki/+/792180/4/groups/Wikimedia/WikimediaDeveloperPortal.yaml#28 that capture whole link and image markdown phrases as insertables. Adding something like '/\{.+\}/' to catch attribute list syntax as well might be useful.

abi_ changed the task status from Open to In Progress.May 19 2022, 9:04 AM
abi_ claimed this task.
abi_ set the point value for this task to 1.

Change 793413 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[translatewiki@master] WikimediaDeveloperPortal: Improve insertable & add messages to ignore

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

Change 793413 merged by jenkins-bot:

[translatewiki@master] WikimediaDeveloperPortal: Improve insertable & add messages to ignore

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

Change 793431 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[translatewiki@master] WikimediaDeveloperPortal: Wrap regex with "/"

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

Change 793431 merged by jenkins-bot:

[translatewiki@master] WikimediaDeveloperPortal: Wrap regex with "/"

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

abi_ moved this task from In Review to Done on the Language-Team (Language-2022-April-June) board.

Updated the existing insertable to handle attribute list syntax:

image.png (365×834 px, 36 KB)

Also added the messages that have nothing to translate to the ignored list.