✨ Help Wanted! | Add Weblate i18n Support #1106
Labels
No Label
🔍🤖 Search Engines
approved
dependencies
duplicate
feedback wanted
high priority
I2P
iOS
low priority
OS
Self-contained networks
Social media
stale
streaming
todo
Tor
WIP
wontfix
XMPP
[m]
₿ cryptocurrency
ℹ️ help wanted
↔️ file sharing
⚙️ web extensions
✨ enhancement
❌ software removal
💬 discussion
🤖 Android
🐛 bug
💢 conflicting
📝 correction
🆘 critical
📧 email
🔒 file encryption
📁 file storage
🦊 Firefox
💻 hardware
🌐 hosting
🏠 housekeeping
🔐 password managers
🧰 productivity tools
🔎 research required
🌐 Social News Aggregators
🆕 software suggestion
👥 team chat
🔒 VPN
🌐 website issue
🚫 Windows
👁️ browsers
🖊️ digital notebooks
🗄️ DNS
🗨️ instant messaging (im)
🇦🇶 translations
No Milestone
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: privacyguides/privacytools.io#1106
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
cb2ae143ed
)Description
Alright. So it turns out if we use jekyll-multiple-languages-plugin and throw every single string on the site into
/_i18n/en.yml
we can then use our Weblate install to translate the site much easier.The problem of course, is moving all the strings manually 😅
So that's going to be my project for now. As of
df38bc4
I have successfully moved... the index page toen.yml
, which took about an hour 🙄If anyone wants to help me out with this (which I would greatly appreciate), I'm doing this work in the
i18n
branch of this repo. If you aren't an org member you can create Pull Requests to that branch (as opposed to master), by selecting i18n instead as the base branch in your pull request:What needs to be done
Every English text string in every (HTML and Markdown) file needs to be moved to a key in
en.yml
. For example, lets look this line in_includes/sections/privacy-resources.html
:That is of course the More Privacy Resources header on the homepage. What I've done is taken the English text out of that line, and placed it
en.yml
, like so:Then, back in the HTML file, I replaced the English text with
{% t privacy_resources.header %}
(which is a Jekyll tag saying tot
ranslate the stringprivacy_resources.header
(from the lines above). Like so:Which really isn't that hard! It's simply time consuming to copy/paste everything into this file.
Extra note about translating
{% include card.html
sOkay, so there is one slightly more complicated bit. You can't add the
{% t
tags inside the {% include` tags. For example, you cannot do this:You must instead use some fancy
{% capture
tags, like so:It isn't too complicated, just some extra steps. Look at what I did in
resources.html
for a more complete example.en.yml
You can see how I've formatted this file already, but basically it should be like:
Where "Page" is the section being translated, Key is a brief description, and "String" is the English text. At the top there is also a "Global" section, for strings that are reused a bunch on different pages:
Pretty much everything needs to go into this file, and then this file will automatically be used as the base in Weblate upon which all translations will be based on (which will be far easier).
How is this going so far? I'm the main Portuguese maintainer at https://www.privacidade.digital/ (https://github.com/PrivacidadeDigital/privacidade.digital)
I confess I was a little concerned with this idea because if you separate the strings in some ways, it would be difficult or impossible to translate to certain languages (if you break sentences). Also, the privacytools domain and basically all of its services (including forum posts that are referenced on the site) are not translated to other languages. There is also a lot of links to external sites that are only available in English. Making all of the strings available as yaml files and on one domain would not allow other language maintainers to change these links to more appropriate ones, or add sections related to their countries.
However, there might be some way to work around this with jekyll-multiple-language-plugins using translated pages and permalinks.
It's meh.
Yeah, that's an issue.
We can add
<a href="">
links to yaml file.This is probably the main issue to figure out. Jekyll is not super fantastic as an easily translatable platform.
Yeah, I have used jekyll-multiple-languages-plugin before and I had a hard time doing the SEO as well. I used jekyll-seo plugin but it does not work together with this translation plugin, so I had to stop using it and implementing the SEO myself with Liquid template language and the translation plugin.
There have been a lot of updates in general over the past few months to the strings and etc., so master may need to be merged into i18n again if possible.
It seems that my general fixes to typos in the strings from PR https://github.com/privacytoolsIO/privacytools.io/pull/1418 will have to reapplied to this branch, but I suppose that will happen after we've moved all the existing strings over first.
Should we be bolding the service/software/addon name when it appears in the first sentence of a description paragraph? (Related issue: https://github.com/privacytoolsIO/privacytools.io/issues/1420) This seems to only hold currently for the browser addons; as a result, this bold formatting looks inconsistent across the site.
For example, these are the strings for Decentraleyes:
The corresponding lines of .html:
Notice how there are
<strong> </strong>
tags around the title in the description.But this is the string for LineageOS:
and the corresponding lines of .html at
mobile-operating-systems.html
:With
218a610c3f (diff-510dea53868741105f8d9db818243f0f)
comes the use of{{ site.name }}
and similar. These variables don't work when you put them intoen.yml
and it seems the only solution so far is to break sentences up which isn't optimal since sentence structures vary between languages.👍 I guess I'm most likely going to revert most of those changes.
@JonahAragon Here is a crude solution that I have found.
Have the string in
en.yml
some sort of format specifier for the site name:In the corresponding .html file (in this case, sponsors.html), capture it and use the replace filter:
Such a solution will have to be done for every string that has to use
site.name
. Does this sound acceptable?I know we might be in a bit too deep into jekyll-multiple-languages, but I was wondering why we chose to use jekyll-multiple-languages plugin.
If we're open to changes, there is also this plugin that Signal uses: https://github.com/signalapp/jekyll-simple-i18n
From what I saw, their way of doing it makes the source more readable. Here is what a part of index.html of their demo site looks like:
The raw strings come out automatically into a YAML after building (although the IDs are a bit verbose):
It's initially aimed towards Transifex but it's possible to use it for other translation systems too such as our Weblate install. I don't work with Ruby though, so not sure how to implement it.
This has now been solved in
9d2f363e31
@djoate I'm removing most of the {{ site.name }} variables in #1508 (pending review) because they didn't make sense anyways.
Almost all of the site has been keyed into separate PRs. See https://github.com/privacytoolsIO/privacytools.io/pull/1509#issuecomment-557949464 for more details.
Just chiming in to say I'm happy to help providing new Italian translations or contribute to the technology-related discussion 👍
How can I help you guys with this?
I can see there are many things left to do according to OP, but also @djoate mentioning separate PRs that solves most things?
@jonaharagon Should probably be able to help you out
@abbluiz Our work wasn't done in time, so we would likely need to rekey large portions of the site to start up work again.
Most of the existing work is in the
i18n-simple
branch (https://github.com/privacytools/privacytools.io/pull/1509/commits) which is where I pretty much single handedly keyed almost the entire site at that time. My comment on the draft pull request https://github.com/privacytools/privacytools.io/pull/1509#issuecomment-578556388 gives some things left to do, but might be changed since more things have been changed on the site:A simple merging of
master
into thisi18n-simple
branch to update the contents won't work cleanly due to the fundamental changes in how the strings are used betweenmaster
andi18n-simple
This has been a massive timesink for me in the past, and it's also time-sensitive work (if we wait too long, things get out of date quickly). I think we should be hesitant about progressing with this until we get some commitment to review and merge from a member of the @privacytools team. Would also need someone from the team to setup Weblate support again
Is the link down? https://weblate.nablahost.com/projects/privacytoolsio/