i18n: Keying the site (1/5) - Card/cardv2, misc, navbar, and providers #1510
No reviewers
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#1510
Loading…
Reference in New Issue
No description provided.
Delete Branch "i18n-simple"
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?
Keying the site, part 1 - Card/cardv2, misc, navbar, Providers
Related to PR https://github.com/privacytoolsIO/privacytools.io/pull/1509
Card/cardv2 content, navbar text, misc, and everything under Providers in the navbar.
Everything under Browsers in the navbar
Everything under Software in the navbar
Everything under OS in the navbar
Merging
master
intoi18n-simple
to fix conflicts, and fixing loose endsTo prevent myself from constantly merging due to changes on
master
, Part 5 to clean up loose ends and mergingmaster
intoi18n-simple
will not be opened until all of the other parts have been reviewed and merged.Since there are going to be changes to every string on the site, I'm splitting the keying process in multiple PRs. This PR aims to key
The migration to jekyll-simple-i18n makes keying of some pages trivial with regexp replacements.
This PR also adds in two new filters to aid the keying process.
translate_text
adds strings to the source file in the same manner as the tag. This lets us key contents of card and cardv2, which is as simple as just using{{ include.title | translate_text}}
in card.html/cardv2.html. This allows us to not use capture tags for every single card. This also lets us key external links.translate_page
ensures proper redirection to the appropriate local page. For example, on the original site, a link going to/providers/
is just/providers/
, but the same link in thees
version would be changed to/es/providers
.Some comments:
Known issues
Capture tags
I've opted to still use capture tags for the extra buttons inside of
_includes/sections/participate.html
as I thought that it would be better not to include entire buttons in the source file (e.g.,'<a class="btn btn-warning mb-1" href="https://github.com/privacytoolsIO/privacytools.io/graphs/contributors">Contributor List</a>
)New lines in strings
Refrain from putting newlines in strings, otherwise the plugin will think it's a new key. The
description
string in_includes/section/browser-recommendation.html
was automatically keyed as
The plugin thinks "recommendations:" is another key. The fix is to remove the newline in the original string.
This string in
email-alternatives
caused an error in the build process (there's a line break between "trustless," and "meaning"):I've had to fix these two issues for it to key properly.
Found some other strings that are giving compile errors
I've built this locally and there doesn't seem to be any problems with using href inside of the source file. The source strings may look messy with all of the
<a
andhref
, but at least it lets us specify language-specific sites for any links we include in our descriptions.Not sure if the same should be done all links though. For example, we could also key the links that these buttons point to:
This would let translators specify links to specific locales. For instance, Firefox offers multiple translations (https://www.mozilla.org/en-US/firefox/windows/, https://www.mozilla.org/es-MX/firefox/windows/, https://www.mozilla.org/it/firefox/windows/, etc.)
EDIT: This is now done in
3629ad6509
The 404 page is defined in Nginx on the server-side. Even if we had language-specific files, I’m not sure how the server would determine whether or not to use them. That’s not a super big priority to me.
This PR is now done and awaiting review.
Just to recall, this PR aims to key
I have not the touched breadcrumbs and the 404 page in this PR
Just added support for using the right HTML page language and hreflang tags. For example, the "Spanish" version of cloud providers has this in the source:
Though maybe we should also key those keywords and description
@JonahAragon After this part gets merged, see if you can get this some of this stuff working with Weblate