Project

General

Profile

Feature #16279

Research how to isolate the [[!meta directives that need translation in PO files

Added by sajolida 8 months ago. Updated 7 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/04/2019
Due date:
% Done:

0%

Feature Branch:
Type of work:
Discuss
Blueprint:
Starter:
Affected tool:

Description

From this thread on tails-l10n: http://lists.autistici.org/message/20181118.155100.286e6cc2.en.html

Translators have a hard time (and make mistakes) when translating big blobs of '[[!meta' directives in a single PO string.

This only happens on HTML files, like /install.html:

https://git.tails.boum.org/tails/tree/wiki/src/install.fr.po

And not on Markdown files, like /news/version_3.11.mdwn:

https://git.tails.boum.org/tails/tree/wiki/src/news/version_3.11.fr.po

We are using the following '[[!meta' directives:

  • All over the place
    • date
    • title
  • Sometimes
    • script
    • stylesheet
  • In very rare occasions
    • google-site-verification
    • redir
    • robots

From these, it only makes sense to translate the 'title' directives.

The rest are actually harmful to translate, so ideally they shouldn't even appear in PO files. For example, translators sometimes translate dates.

How can we make these easier to translate and less error prone?

  • Wrapping 'title' into a '<div>' seems to work remarkably well. See commit in attachment.
  • Is it realistic to patch ikiwiki/PO plugin/po4a/whoever to skip other directives? If we do this, then we would also solve the problem of isolating 'title' directives because they would be the only ones left.
  • Any other option?

0001-Wrap-title-directive-in-a-div.patch View (9.35 KB) sajolida, 01/04/2019 07:23 PM


Related issues

Related to Tails - Bug #16221: Consider stopping to use DocBook-style CSS classes Confirmed 12/13/2018
Related to Tails - Feature #16367: Wrap [[!meta title directives in <div> in HTML sources Needs Validation 01/16/2019
Related to Tails - Feature #16366: Teach po4a to ignore the [[!meta directives that shall not be translated Confirmed 01/16/2019
Blocks Tails - Feature #15941: Core work 2018Q4 → 2019Q2: Technical writing Resolved 09/11/2018

History

#1 Updated by sajolida 8 months ago

  • Related to Bug #16221: Consider stopping to use DocBook-style CSS classes added

#2 Updated by sajolida 8 months ago

  • Blocks Feature #15941: Core work 2018Q4 → 2019Q2: Technical writing added

#3 Updated by intrigeri 8 months ago

The rest are actually harmful to translate, so ideally they shouldn't even appear in PO files. For example, translators sometimes translate dates.

hefee raised this exact problem today while discussing the translation platform.

  • Is it realistic to patch ikiwiki/PO plugin/po4a/whoever to skip other directives? If we do this, then we would also solve the problem of isolating 'title' directives because they would be the only ones left.

I think that's the best long-term option. A quick look at the ikiwiki PO plugin implementation suggests that the easiest way is to teach po4a to ignore the directives that shall not be translated when it generated POT files (called by ikiwiki's sub refreshpot).

Now, if the "Wrapping 'title' into a '<div>'" trick is cheap to implement, it could be a good idea to go for it until we know who will have time & budget to do that and when (skills needed: Perl and the patience needed to survive working on a parser written in old-school Perl). It won't solve the "translators translate the meta date" issue but it should help with the rest of the problems this ticket is about.

#4 Updated by sajolida 7 months ago

  • Subject changed from Isolate in PO files [[!meta directives that need translation to Research how to isolate the [[!meta directives that need translation in PO files
  • Status changed from Confirmed to Resolved
  • Start date changed from 01/16/2019 to 01/04/2019

Ok, so I created #16367 and #16366 for implementing the 2 parts of this plan. I also changed this ticket to be about making plans and can now mark it as resolved.

#5 Updated by sajolida 7 months ago

  • Related to Feature #16367: Wrap [[!meta title directives in <div> in HTML sources added

#6 Updated by sajolida 7 months ago

  • Related to Feature #16366: Teach po4a to ignore the [[!meta directives that shall not be translated added

Also available in: Atom PDF