Project

General

Profile

Bug #16867

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

Added by sajolida 5 months ago. Updated 4 months ago.

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:

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.

Associated revisions

Revision f96ff015 (diff)
Added by sajolida 5 months ago

Stop using "percent translated" (Closes: #16867)

See the ticket for the reasons why and the gain in performance.

Revision 1bdafcd7 (diff)
Added by sajolida 5 months ago

Stop using "percent translated" (Closes: #16867)

See the ticket for the reasons why and the gain in performance.

Revision 825c6122
Added by intrigeri 5 months ago

Merge remote-tracking branch 'origin/web/16867-remove-percent-translated'

Closes: #16867

Revision 7e973fe2 (diff)
Added by intrigeri 5 months ago

Remove remaining references to contribute/how/translate/translation_progress (refs: #16867)

History

#1 Updated by intrigeri 5 months ago

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 5 months ago

  • 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 5 months ago

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 5 months ago

@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 5 months ago

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 5 months ago

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

I'll benchmark that!

#7 Updated by sajolida 5 months ago

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

#8 Updated by sajolida 5 months ago

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

Not yet! :)

#9 Updated by sajolida 5 months ago

  • Status changed from In Progress to Resolved

#10 Updated by sajolida 5 months ago

  • 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 5 months ago

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

#12 Updated by intrigeri 5 months ago

  • Assignee set to intrigeri

#13 Updated by intrigeri 5 months ago

  • Status changed from Needs Validation to Resolved

#14 Updated by intrigeri 5 months ago

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

Merged, pushing. I've added 7e973fe2ba0d156e01b13df0e6f833e6fd0a4808 on top, please review.

#15 Updated by sajolida 4 months ago

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

Of course :)

#16 Updated by xin 4 months ago

@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 4 months ago

the new link for "l10n tricks" page (instead of translation progress link):

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

Also available in: Atom PDF