Skip to content

Commit ad79203

Browse files
In-context translation (#1169)
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
1 parent 22f4df9 commit ad79203

19 files changed

+3363
-24
lines changed

bin/update-translations.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [ $# -eq 0 ]; then
1515
exit 1
1616
fi
1717

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

2020
mkdir -p crowdin/translated
2121
for language in $languages; do

index.html

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@
3535
window.dataLayer.push(arguments);
3636
};
3737
</script>
38+
<script type="text/javascript" id="crowdin-jipt-config">
39+
(function () {
40+
function escape() {
41+
window.location.href = "%VITE_FULL_URL";
42+
}
43+
window._jipt = [
44+
["project", "microbitorg"],
45+
["escape", escape],
46+
];
47+
})();
48+
</script>
3849
<% } %>
3950
<script type="module" src="/src/index.tsx"></script>
4051
</head>

0 commit comments

Comments
 (0)