Skip to content

Commit c4a56fb

Browse files
Use a Welsh link on the home page in Welsh (#236)
Fix a reactivity bug that meant it didn't change.
1 parent bc57103 commit c4a56fb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/components/HtmlFormattedMessage.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
6464
export let options: Options | undefined = undefined;
6565
66-
const adaptedOptions = {
66+
$: adaptedOptions = {
6767
...options,
6868
values: Object.fromEntries(
6969
Object.entries(options?.values ?? {}).map(([k, v]) => {

src/pages/Homepage.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
import { locale as currentLocale } from 'svelte-i18n';
3737
import { get } from 'svelte/store';
3838
39-
const playgroundSurveyUrl =
40-
'https://microbit.org/teach/playground-survey/exploring-machine-learning/';
39+
const playgroundSurveyUrlByLang: Record<string, string> = {
40+
en: 'https://microbit.org/teach/playground-survey/exploring-machine-learning/',
41+
cy: 'https://microbit.org/cy/teach/playground-survey/exploring-machine-learning/',
42+
};
4143
4244
$: hasExistingSession = $gestures.some(g => g.name || g.recordings.length);
4345
let showDataLossWarning = false;
@@ -69,6 +71,9 @@
6971
};
7072
7173
$: title = getTitle(Paths.HOME, $t);
74+
$: playgroundSurveyUrl =
75+
($currentLocale ? playgroundSurveyUrlByLang[$currentLocale] : undefined) ??
76+
playgroundSurveyUrlByLang.en;
7277
</script>
7378

7479
<svelte:head>

0 commit comments

Comments
 (0)