Skip to content

Commit

Permalink
Merge pull request #784 from digirati-co-uk/NS-36/hotfix/model-transl…
Browse files Browse the repository at this point in the history
…ations

fix no translation on choice cards
  • Loading branch information
Heather0K committed Aug 14, 2023
2 parents 3809283 + 4631374 commit 2f75259
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export function ModelTranslation(props: { children?: string }) {
const converted = tModel(props.children.replace(':', ':'));
return <span dangerouslySetInnerHTML={{ __html: converted }} />;
}
return <>{props.children}</>;
return <>{tModel(props.children)}</>;
}
7 changes: 7 additions & 0 deletions services/madoc-ts/src/routes/admin/localisation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { castBool } from '../../utility/cast-bool';
import { parseEtag } from '../../utility/parse-etag';
import { traverseStructure } from '../../utility/traverse-structure';
import { optionalUserWithScope, userWithScope } from '../../utility/user-with-scope';
import { CheckboxFieldProps } from '../../frontend/shared/capture-models/editor/input-types/CheckboxField/CheckboxField';

export type LocalisationSiteConfig = {
defaultLanguage: string;
Expand Down Expand Up @@ -131,6 +132,12 @@ async function loadLocaleTemplate(userApi: ApiClientWithoutExtensions, namespace
if ((field as TextFieldProps).placeholder) {
foundStrings.add((field as TextFieldProps).placeholder as string);
}
if ((field as CheckboxFieldProps).inlineLabel) {
foundStrings.add((field as CheckboxFieldProps).inlineLabel as string);
}
if ((field as CheckboxFieldProps).inlineDescription) {
foundStrings.add((field as CheckboxFieldProps).inlineDescription as string);
}
},
visitEntity(entity) {
if (entity.label) foundStrings.add(entity.label);
Expand Down

0 comments on commit 2f75259

Please sign in to comment.