Extract markdown from content pages into localization jsons #612
+446
−529
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.
This change make it possible to translate content pages into jsons, to be translated using Weblate.
Changes:
src/locales/LANG.json
, not thesrc/content/LANG/PAGE.md
!!!yarn extract-content
. Script will read all *.md pages insrc/content
and REPLACEcontent.PAGE
keys insrc/locales/LANG.json
with new values (extracted fromPAGE.md
). Other keys are not overriden, but file might be reformatted (effect ofJSON.parse
andJSON.stringify
). Keep in mind this is no 2way sync, so extract will override changes from weblate. See TODOStaticPage
remains the same, but there is newTranslatableStaticPage
that takes single proplocaleKey
As consequence, router.js is much simplified :)
TODO:
src/content
just once and then remove it from source tree and just have it in Weblate (if weblate has decent markdown support?). This way we avoid problems if content is changed in md file and in weblate.