Bug #16867

ikiwiki's PO plugin doesn't include inline in language stats

Added by sajolida 2019-07-09 09:30:32 . Updated 2019-08-17 16:09:08 .

Status:
Resolved
Priority:
Low
Assignee:
Category:
Internationalization
Target version:
Start date:
Due date:
% Done:

100%

Feature Branch:
web/16867-remove-percent-translated
Type of work:
Test
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

For example, right now:

https://tails.boum.org/install/win/usb/

is advertised as 100% translated in Italian while it’s not. It’s more like 10% translated.

I guess that’s because what counts in the stats is only the strings of wiki/src/install/win/usb.it.po and not the strings in wiki/src/install/inc/steps/install_with_etcher.inline.it.po for example.

An algorithm to compute better stats could be:

  • If an inline directive is translated in the parent PO file and corresponds to a translated inline, count the strings in the inline PO file. Almost all inlines have translations but not all (eg. @wiki/src/inc).
  • Otherwise, count the inline directive itself.

Subtasks


History

#1 Updated by intrigeri 2019-07-09 09:46:35

Indeed, right.

Wrt. how to fix this, one needs to consider ikiwiki as a whole, and there might be a deeper semantic problem: most ikiwiki operations act on the page itself, not inlines. For example, deleting a page won’t delete pages it inlines, even if it’s the only place where they were used; page history / last updated is about the “parent” page as well. Changing one operation (translation percentage) to act on the page + its inlines would introduce some inconsistency. I’m not sure how much of a problem this is and whether other operations would make more sense if they also acted on inlined pages. I’m afraid that’s a deep can of worms :/ But perhaps one can take shortcuts :)

Additionally, I don’t know if it makes sense to change how we compute this on the ikiwiki side, but not on the Weblate side (which I expect is where most translators will be looking soon).

In any case, this is not trivial to fix so don’t hold your breathe. If the current number causes more harm than the benefits it gives, we should hide it.

#2 Updated by sajolida 2019-07-10 08:32:22

  • Status changed from New to Confirmed
  • Priority changed from Normal to Low

Thanks for the initial analysis. I mostly reported this bug to be less silent about ikiwiki’s shortcoming in general (something we’ve discussed in the past) but I’m not sure how important this is. It’s funny that you mentioned this number being useful to translators, until now I only considered how useful it could be to visitors.

@xin: Do you have any clue how useful this number is to translators? Do you think it would be worth asking other translators?

#3 Updated by intrigeri 2019-07-10 08:40:39

> It’s funny that you mentioned this number being useful to translators

Indeed, I initially implemented this feature merely in order to provide a status overview and todo list for translators. Adding the figure to the page template was kind of an afterthought.

#4 Updated by xin 2019-07-14 16:28:57

> @xin: Do you have any clue how useful this number is to translators? Do you think it would be worth asking other translators?

Personally I use the number in combination with the “Translation progress” page. So for me the number isn’t wrong, it’s the percentage of the po file.

Now we have Weblate so I thing it don’t worth to work on this and instead we can discuss about removing both number and “Translation progress” page to increase build time.

I have no clue about other translators, sorry.

#5 Updated by intrigeri 2019-07-14 19:21:13

> Now we have Weblate so I thing it don’t worth to work on this and instead we can discuss about removing both number and “Translation progress” page to increase build time.

I confirm that ikiwiki does not compute this number at all if these two conditions are met:

  • PERCENTTRANSLATED is not used in the page template
  • needstranslation() is not used anywhere

So build time could indeed decrease if we remove both.

#6 Updated by sajolida 2019-07-17 09:46:49

  • Assignee set to sajolida
  • Type of work changed from Code to Test

I’ll benchmark that!

#7 Updated by sajolida 2019-07-20 14:40:48

  • Status changed from Confirmed to Resolved
  • % Done changed from 0 to 100

Applied in changeset commit:tails|f96ff0157f87b0416c48dcd96d3d99ec7b2af56b.

#8 Updated by sajolida 2019-07-20 14:45:29

  • Status changed from Resolved to In Progress
  • Target version set to Tails_3.16

Not yet! :)

#9 Updated by sajolida 2019-07-20 15:47:00

  • Status changed from In Progress to Resolved

Applied in changeset commit:tails|1bdafcd79768a918786067e1cb5aae454402990a.

#10 Updated by sajolida 2019-07-20 17:05:15

  • Status changed from Resolved to Needs Validation
  • Assignee deleted (sajolida)
  • Feature Branch set to web/16867-remove-percent-translated

Here is a branch.

#11 Updated by sajolida 2019-07-21 14:01:34

It’s bring a 4% improvement on the build time :)

#12 Updated by intrigeri 2019-07-31 00:21:20

  • Assignee set to intrigeri

#13 Updated by intrigeri 2019-07-31 00:27:16

  • Status changed from Needs Validation to Resolved

Applied in changeset commit:tails|825c6122b5b4906134a96f7a21cf57463a168c79.

#14 Updated by intrigeri 2019-07-31 11:39:43

  • Status changed from Resolved to Needs Validation
  • Assignee changed from intrigeri to sajolida

Merged, pushing. I’ve added commit:7e973fe2ba0d156e01b13df0e6f833e6fd0a4808 on top, please review.

#15 Updated by sajolida 2019-08-17 09:53:46

  • Status changed from Needs Validation to Resolved
  • Assignee deleted (sajolida)

Of course :)

#16 Updated by xin 2019-08-17 12:04:18

@intrigeri the new link for “l10n tricks” page (instead of translation progress link):
https://translate.tails.boum.org/projects/tails/#languages

#17 Updated by intrigeri 2019-08-17 16:09:08

> the new link for “l10n tricks” page (instead of translation progress link):

Thank you @xin, I’ve added this link there :)