Skip to content

Commit

Permalink
generator: Use the Label type for translations
Browse files Browse the repository at this point in the history
instead of single `fr`/`en` object type.
  • Loading branch information
tahini committed Apr 9, 2024
1 parent e6ed254 commit 0ac5b72
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/evolution-generator/src/types/inputTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ export type Labels = {
}[];
type Choice = {
value: string | number | boolean;
label: {
fr: string;
en: string;
};
label: Label;
iconPath?: string;
conditional?: Conditional;
};
Expand All @@ -59,7 +56,7 @@ export type NameFunction = (groupedObject, sequence, interview) => string;
export type HelpPopup = {
containsHtml?: ContainsHtml;
title: Title;
content: { fr: string; en: string };
content: TextKey;
};
type DefaultCenter = {
lat: number;
Expand Down Expand Up @@ -242,10 +239,10 @@ export type InputButton = InputButtonBase & {
label: Label;
confirmPopup?: {
shortname: string;
content: { fr: (interview, path) => string; en: (interview, path) => string };
content: Label;
showConfirmButton?: boolean;
cancelButtonColor?: 'blue' | 'green';
cancelButtonLabel?: { fr: string; en: string };
cancelButtonLabel?: Label;
conditional?: Conditional;
};
size?: Size;
Expand Down Expand Up @@ -274,7 +271,7 @@ export type Group = {
path: Path;
groupShortname: string;
shortname: string;
groupName: { fr: string; en: string };
groupName: Label;
name: { fr: NameFunction; en: NameFunction };
filter?: (interview, groupedObjects) => any;
conditional?: Conditional;
Expand Down

0 comments on commit 0ac5b72

Please sign in to comment.