Project

General

Profile

Bug #15461

The homepage of the Unsafe Browser cannot be translated

Added by sajolida 4 months ago. Updated 20 days ago.

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

100%

Estimated time:
5.00 h
QA Check:
Pass
Feature Branch:
https://0xacab.org/Hefee/tails/tree/bugfix/15461-translate-unsafe-browser-homepage
Type of work:
Code
Blueprint:
Starter:
Affected tool:
Unsafe Browser

Description

Due to #14962, we had to apply a temporary workaround: 08259afa449f3dcd916fe03db5775f3652f5a7e8, a02aafefe1c3850461d28a44befd2378fe527741, 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 #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 #14962#note-22 and follow-ups.


Related issues

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

Associated revisions

Revision 9125cce8 (diff)
Added by Sandro Knauß 30 days ago

Use normal wiki translating system for unsafe_browser_warning.

Because of #14962, we can't use the normal page.tmpl, as we are not
allowed to use CSS.

Fixes: #15461

Revision 40d31655 (diff)
Added by intrigeri 28 days ago

Reapply custom CSS for the Unsafe Browser homepage (refs: #15461)

Revision 09e4089f
Added by intrigeri 27 days ago

Merge branch 'bugfix/15461-translate-unsafe-browser-homepage' into stable (Fix-committed: #15461)

History

#1 Updated by sajolida 4 months ago

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

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

#4 Updated by intrigeri 4 months ago

(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 3 months ago

  • Assignee deleted (anonym)

#6 Updated by intrigeri 3 months ago

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

#7 Updated by emmapeel 2 months ago

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

#8 Updated by bertagaz 2 months ago

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

#9 Updated by intrigeri about 2 months ago

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

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

#10 Updated by intrigeri about 2 months ago

  • Description updated (diff)
  • Assignee changed from intrigeri to hefee

#11 Updated by intrigeri about 1 month ago

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 30 days ago

  • % 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 29 days ago

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 29 days ago

  • 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 29 days ago

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 28 days ago

Code review passes flawlessly!

#17 Updated by intrigeri 28 days ago

Before 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 #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 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 28 days ago

  • Status changed from Confirmed to In Progress
  • Assignee changed from intrigeri to hefee
  • % Done changed from 70 to 80
  • Estimated time changed from 2.00 h to 5.00 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 28 days ago

  • 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 28 days ago

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

#21 Updated by intrigeri 27 days ago

  • 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 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 20 days ago

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

#23 Updated by intrigeri 20 days ago

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

#24 Updated by intrigeri 20 days ago

  • Status changed from Fix committed to Resolved

Also available in: Atom PDF