Bug #15461

The homepage of the Unsafe Browser cannot be translated

Added by sajolida 2018-03-27 15:19:21 . Updated 2018-06-26 16:26:16 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Target version:
Start date:
2018-03-27
Due date:
% Done:

100%

Feature Branch:
https://0xacab.org/Hefee/tails/tree/bugfix/15461-translate-unsafe-browser-homepage
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Unsafe Browser
Deliverable for:

Description

Due to Bug #14962, we had to apply a temporary workaround: commit:08259afa449f3dcd916fe03db5775f3652f5a7e8, commit:a02aafefe1c3850461d28a44befd2378fe527741, commit:527b2c3779e22a955d5c506dd02957c4ecbdbbcd.

But that’s problematic: translators can’t easily update/fix translations in PO files for that web page, and newly enabled languages don’t get a translated page (e.g. we’ve enabled Spanish and guess what? of course nobody thought of manually translating that HTML file).

So, we should:

  • either do something clever to avoid using markup/CSS that won’t render due to Bug #14962 (can we use a custom page template? last time I check we could not) and then reintegrate this HTML file into our ikiwiki+po setup to make that page translatable again; likely that won’t work so let’s not spend too much time of it before switching to:
  • or keep most of the current hacks, treat that web page as something outside of ikiwiki’s scope, and make it translatable via Transifex:
    • move the source page out of wiki/src
    • integrate it with our non-ikiwiki translation setup (po/, refresh-translations, etc.)
    • replace fixup_14962_workaround with something that copies the generated translated pages to config/chroot_local-includes/usr/share/doc/tails/website/misc
  • or find a nicer, cheap enough solution to this problem :)

For future plans, see Bug #14962#note-22 and follow-ups.


Subtasks


Related issues

Related to Tails - Bug #14962: Tor Browser >= 7.0.8 fails to render local pages correctly Resolved 2017-11-16
Blocks Tails - Feature #15139: Core work 2018Q2: Foundations Team Resolved 2018-01-01

History

#1 Updated by sajolida 2018-03-27 15:20:53

  • Assignee set to intrigeri
  • Target version set to Tails_3.7
  • Affected tool set to Unsafe Browser

Assigning to the Foundations team.

#2 Updated by intrigeri 2018-03-27 15:38:39

  • Assignee changed from intrigeri to anonym

anonym, can you take this one? IMO it should be fixed for 3.7 or 3.8.

#3 Updated by intrigeri 2018-03-27 15:44:10

#4 Updated by intrigeri 2018-03-27 15:44:45

(Alternatively I could add this to my list of candidates for new FT members, but I suspect this one might be a bit tricky for “beginners”.)

#5 Updated by intrigeri 2018-04-13 11:37:51

  • Assignee deleted (anonym)

#6 Updated by intrigeri 2018-04-13 13:44:55

I don’t think we can work on this before a conclusion is reached on Bug #14962.

#7 Updated by emmapeel 2018-05-03 17:16:17

  • blocked by Bug #14962: Tor Browser >= 7.0.8 fails to render local pages correctly added

#8 Updated by bertagaz 2018-05-10 11:09:33

  • Target version changed from Tails_3.7 to Tails_3.8

#9 Updated by intrigeri 2018-05-28 14:35:21

  • Assignee set to intrigeri
  • Estimated time set to 2 h

I’ll describe what needs to be done and then hefee will take it.

#10 Updated by intrigeri 2018-05-28 15:48:37

  • Description updated
  • Assignee changed from intrigeri to hefee

#11 Updated by intrigeri 2018-06-16 08:34:19

FYI the deadline for having this reviewed and merged in time for Tails 3.8 is June 24. Taking into account some time to review and possibly some review/improvements roundtrips, ideally a working branch should be submitted by June 20. Seems doable? If not, well, let’s instead target 3.9.

#12 Updated by hefee 2018-06-17 00:26:13

  • % Done changed from 0 to 70
  • Feature Branch set to https://0xacab.org/Hefee/tails/tree/bugfix/15461-translate-unsafe-browser-homepage

We can use the pagetemplate plugin and that works nicely. The diff between the generated html and the wiki/src/misc/unsafe_browser_warning.en.html are only newline changes. I kind of stuck as I don’t find how to gernerate the pot file for the new wiki/src/misc/unsafe_browser_warning.html to be able to port the translations to the po files.

Additionally we could also use mdwn instead of html if that would gain a easier way for translators.

I spend now 1h 45mins.

#13 Updated by intrigeri 2018-06-17 07:31:21

Great that you’ve made progress!

FTR it’s not clear to me if you’re asking for help or not.

#14 Updated by hefee 2018-06-17 13:04:53

  • Assignee changed from hefee to intrigeri
  • QA Check set to Ready for QA

Okay I now found that I needed to modify po_translatable_pages in ikiwiki.setup to enable translations for the page.

By now I now have moved all translations into the po files and checked if the pages are the same like before. Okay I unified the spaces before:

```
sed -e ‘:a;N;$!ba;s/[ \t\n]\+/ /g;s/\s\(<[^>]>\)\s*/\1/g’ config/chroot_local-includes/usr/share/doc/tails/website/misc/unsafe_browser_warning.fa.html | xmllint —format output /tmp/format/unsafe_browser_warning.fa.output
```

So this should be ready for review now.

I spent 4.5h for this task now.

#15 Updated by intrigeri 2018-06-17 13:32:20

> So this should be ready for review now.

Woohoo! \o/

I’ll try to take a first look at it in the next 2 days, so there’s some time left for a potential additional roundtrip before the 3.8 code is frozen.

#16 Updated by intrigeri 2018-06-18 05:53:43

Code review passes flawlessly!

#17 Updated by intrigeri 2018-06-18 06:14:30

Before commit:08259afa449f3dcd916fe03db5775f3652f5a7e8 we applied a custom stylesheet to the Unsafe Browser homepage; it’s kinda orthogonal to this ticket but still, it’s part of the regressions brought by our workarounds for Bug #14962. We can’t load an external CSS anymore but according to https://trac.torproject.org/projects/tor/ticket/24243 we can use inline CSS. I’ve done this in commit:40d31655a27c655398ef4907a6da691722f427d9, will now build an ISO, test, reassign to hefee for one last review, and then if he’s happy with this additional commit I’ll merge.

#18 Updated by intrigeri 2018-06-18 07:07:28

  • Status changed from Confirmed to In Progress
  • Assignee changed from intrigeri to hefee
  • % Done changed from 70 to 80
  • Estimated time changed from 2 h to 5 h
  • Feature Branch changed from https://0xacab.org/Hefee/tails/tree/bugfix/15461-translate-unsafe-browser-homepage to bugfix/15461-translate-unsafe-browser-homepage

Works fine, please take a look :)

#19 Updated by hefee 2018-06-18 16:56:47

  • Assignee changed from hefee to intrigeri
  • % Done changed from 80 to 90
  • Feature Branch changed from bugfix/15461-translate-unsafe-browser-homepage to https://0xacab.org/Hefee/tails/tree/bugfix/15461-translate-unsafe-browser-homepage

Your patch to add css looks fine. But I haven’t found this inline css in the master branch, that’s why I haven’t had add this.

I updated the po files (just header moving and removing unnecessary newlines in the Farsi po), thaty why I switched back the feature branch.

I havn’t test this on a ISO, as the filepatch wasn’t changed. Do I need to test this on a ISO too?

#20 Updated by Anonymous 2018-06-18 18:05:04

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Applied in changeset commit:9125cce8fcbac26c4cc2c26e3e67fc27435aafce.

#21 Updated by intrigeri 2018-06-19 16:08:23

  • Status changed from Resolved to Fix committed
  • Assignee deleted (intrigeri)
  • QA Check changed from Ready for QA to Pass

hefee wrote:
> Your patch to add css looks fine.

Cool!

> But I haven’t found this inline css in the master branch, that’s why I haven’t had add this.

It was removed in commit:08259afa449f3dcd916fe03db5775f3652f5a7e8 that’s mentioned in the ticket description.

> I updated the po files (just header moving and removing unnecessary newlines in the Farsi po), thaty why I switched back the feature branch.
>
> I havn’t test this on a ISO, as the filepatch wasn’t changed. Do I need to test this on a ISO too?

No, that’s fine. Merged!

#22 Updated by intrigeri 2018-06-26 16:25:43

  • blocks deleted (Bug #14962: Tor Browser >= 7.0.8 fails to render local pages correctly)

#23 Updated by intrigeri 2018-06-26 16:25:49

  • related to Bug #14962: Tor Browser >= 7.0.8 fails to render local pages correctly added

#24 Updated by intrigeri 2018-06-26 16:26:16

  • Status changed from Fix committed to Resolved