Skip to content

Commit

Permalink
In-context translation (#1169)
Browse files Browse the repository at this point in the history
Requires a translate flag.

Foundation builds only so we don't get confusing contributions to our Crowdin from forks that might have made text changes. Open to discussing making the Crowdin project configurable if useful to forks.

When the flag is present, change language id to lol and append CrowdIn JIPT script to header.

Related PRs (now merged)
Pyright - microbit-foundation/pyright#32
Stubs - microbit-foundation/micropython-microbit-stubs#100
  • Loading branch information
microbit-grace authored Apr 17, 2024
1 parent 22f4df9 commit ad79203
Show file tree
Hide file tree
Showing 19 changed files with 3,363 additions and 24 deletions.
2 changes: 1 addition & 1 deletion bin/update-translations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ $# -eq 0 ]; then
exit 1
fi

languages="ca de fr es-ES ja ko nl zh-CN zh-TW"
languages="ca de fr es-ES ja ko nl zh-CN zh-TW lol"

mkdir -p crowdin/translated
for language in $languages; do
Expand Down
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
window.dataLayer.push(arguments);
};
</script>
<script type="text/javascript" id="crowdin-jipt-config">
(function () {
function escape() {
window.location.href = "%VITE_FULL_URL";
}
window._jipt = [
["project", "microbitorg"],
["escape", escape],
];
})();
</script>
<% } %>
<script type="module" src="/src/index.tsx"></script>
</head>
Expand Down
Loading

0 comments on commit ad79203

Please sign in to comment.