Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update psypal translations #6422

Merged
merged 11 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion client/src/lib/components/VideoLooper/VideoLooper.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import React, {
import {VideoLooperProperties} from './VideoLooper';
import styled from 'styled-components';

const useCanvasColorCorrection = !(
const useCanvasColorCorrection = false; // Currently disabled because of rendering issues on Windows
/*
!(
typeof window !== 'undefined' &&
/^((?!chrome|android).)*safari/i.test(navigator.userAgent)
); // Not Safari
*/

const Wrapper = styled.div({
position: 'relative',
Expand Down
7 changes: 4 additions & 3 deletions content/importFromCsv.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {mergeDeepLeft, uniq} from 'ramda';
import {mergeDeepWith, uniq} from 'ramda';
import {unflatten} from 'safe-flat';
import * as csv from '@fast-csv/parse';
import {getContentByType} from './src/utils/utils';
import {getContentByType, mergeWithArrays} from './src/utils/utils';
import {DEFAULT_LANGUAGE_TAG, LANGUAGE_TAG} from '../shared/src/i18n/constants';
import fs from 'fs';
import path from 'path';
Expand Down Expand Up @@ -65,7 +65,8 @@ const main = async () => {
const filePath = path.resolve('src', type, `${fileKey}.json`);
const fileContent = {
...content,
[TO_LANGUAGE_TAG]: mergeDeepLeft(
[TO_LANGUAGE_TAG]: mergeDeepWith(
mergeWithArrays,
unflatten(fileTranslations),
skipLanguageMergeForTypes.includes(type)
? {}
Expand Down
226 changes: 119 additions & 107 deletions content/src/exercises/3adeb40b-b9f8-4b13-b1a8-02f6106df9e5.json

Large diffs are not rendered by default.

257 changes: 129 additions & 128 deletions content/src/exercises/b6de2e28-325e-4ce1-8894-09ac12a6c19f.json

Large diffs are not rendered by default.

192 changes: 98 additions & 94 deletions content/src/exercises/b9001702-8502-46de-bc7b-3ebf2b812c0e.json

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions content/src/ui/Component.TimerControls.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
"text": "Start the timer to take a minute to reflect"
},
"pt": {
"text": "Inicia o cronómetro e reserva um momento para refletir"
"text": "Inicie o cronómetro e tire um momento para refletir"
},
"sv": {
"text": "Starta timern och ta en stund att reflektera"
},
"ja": {},
"da": {},
"cs": {},
"nl": {},
"da": {
"text": "Start timeren og tag et øjebblik til at reflektere"
},
"cs": {
"text": "Spusťte časovač a chvíli se zamyslete"
},
"nl": {
"text": "Start de timer en neem een moment om te reflecteren"
},
"es": {
"text": "Inicia el temporizador y tómate un momento para reflexionar"
}
Expand Down
15 changes: 12 additions & 3 deletions content/src/ui/Screen.Portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,18 @@
"leavePortal": "Lämna"
},
"ja": {},
"da": {},
"cs": {},
"nl": {},
"da": {
"leavePortal": "Forlad",
"startSession": "Start session"
},
"cs": {
"leavePortal": "Odejít",
"startSession": "Začít sezení"
},
"nl": {
"leavePortal": "Verlaten",
"startSession": "Sessie starten"
},
"es": {
"counterLabel": {
"shortly": "Pronto",
Expand Down
30 changes: 27 additions & 3 deletions content/src/ui/Screen.Session.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,33 @@
}
},
"ja": {},
"da": {},
"cs": {},
"nl": {},
"da": {
"controls": {
"end": "Afslut",
"next": "Næste",
"prev": "Tilbage",
"start": "Start"
},
"endButton": "Afslut session"
},
"cs": {
"controls": {
"end": "Dokončit",
"next": "Další",
"prev": "Zpět",
"start": "Začít"
},
"endButton": "Ukončit sezení"
},
"nl": {
"controls": {
"end": "Afronden",
"next": "Volgende",
"prev": "Terug",
"start": "Starten"
},
"endButton": "Sessie afronden"
},
"es": {
"controls": {
"end": "Terminar",
Expand Down
23 changes: 22 additions & 1 deletion content/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ import {
LANGUAGE_TAG,
LANGUAGE_TAGS,
} from '../../../shared/src/i18n/constants';
import {keys, mergeDeepRight, reduce, unapply, without} from 'ramda';
import {
is,
isNil,
keys,
mergeDeepRight,
mergeDeepWith,
reduce,
unapply,
without,
} from 'ramda';

type LocalizedContent<T> = Record<LANGUAGE_TAG, Record<string, T>>;
type Content<T> = Record<string, LocalizedContent<T>>;
Expand Down Expand Up @@ -102,3 +111,15 @@ export const generateI18NResources = <T>(
);

export const mergeDeepAll = unapply(reduce(mergeDeepRight, {}));

export const mergeWithArrays = (a: unknown, b: unknown) => {
if (is(Array, a) && is(Array, b)) {
return b.map((item, index) => mergeWithArrays(a[index], item));
}

if (is(Object, a) && is(Object, b)) {
return mergeDeepWith(mergeWithArrays, a, b);
}

return isNil(a) ? b : a;
};
3 changes: 2 additions & 1 deletion web/src/app/[language]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {Metadata} from 'next';
import {
CLIENT_LANGUAGE_TAGS,
LANGUAGE_TAG,
LANGUAGE_TAGS,
} from '../../../../shared/src/i18n/constants';
import I18nProvider from '@/lib/I18nProvider';

Expand All @@ -15,7 +16,7 @@ export const metadata: Metadata = {
};

export function generateStaticParams() {
return CLIENT_LANGUAGE_TAGS.map(language => ({
return LANGUAGE_TAGS.map(language => ({
language,
}));
}
Expand Down
Loading