This repository was archived by the owner on Jun 24, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 381
[WIP] Add Weblate Support, Move Strings to YAML Files #1458
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML code doesn't belong in en.yml
…ng more descriptive
|
Deploy preview for privacytools-io ready! Built with commit 86eb0a8 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
✨ enhancement
ℹ️ help wanted
🇦🇶 translations
Anything covering a translated version of the site
WIP
active work in progress, do not merge or PR (yet)!
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
➡️ Info and checklist to-do @ #1106 ⬅️
11/02: Oops, I accidentally closed #1105. Continuing this discussion here!
Alright. So it turns out if we use jekyll-multiple-languages-plugin and throw every single string on the site into
/_i18n/en.ymlwe 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 to
en.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
i18nbranch 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 totranslate 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.
en.ymlYou 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).
Closes #1106