diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-06-13 21:08:22 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-06-13 21:08:22 +0200 |
| commit | 3ff255b3f75d3c2d860ccd84aa06032f840ce0e6 (patch) | |
| tree | a693e36f007e5e4f3c20ecfffc91b2f2ad77b0ce /apps/projects/src/app/lib | |
| parent | 39735309b2f2831ea8fe94104139fa0e9f6ace56 (diff) | |
| download | greatoffice-3ff255b3f75d3c2d860ccd84aa06032f840ce0e6.tar.xz greatoffice-3ff255b3f75d3c2d860ccd84aa06032f840ce0e6.zip | |
refactor: Introduce templated translation string for getting logged time today string
Diffstat (limited to 'apps/projects/src/app/lib')
| -rw-r--r-- | apps/projects/src/app/lib/i18n/en/index.ts | 3 | ||||
| -rw-r--r-- | apps/projects/src/app/lib/i18n/i18n-types.ts | 26 | ||||
| -rw-r--r-- | apps/projects/src/app/lib/i18n/nb/index.ts | 3 |
3 files changed, 12 insertions, 20 deletions
diff --git a/apps/projects/src/app/lib/i18n/en/index.ts b/apps/projects/src/app/lib/i18n/en/index.ts index 9d74481..a85af7b 100644 --- a/apps/projects/src/app/lib/i18n/en/index.ts +++ b/apps/projects/src/app/lib/i18n/en/index.ts @@ -101,13 +101,12 @@ const en: BaseTranslation = { use: "Use", }, home: { - hourSingleChar: "h", - minSingleChar: "m", confirmDeleteEntry: "Are you sure you want to delete this entry?", newEntry: "New entry", editEntry: "Edit entry", deleteEntry: "Delete entry", loggedTimeToday: "Logged time today", + loggedTimeTodayString: "{hours}h{minutes}m", currentTime: "Current time", loading: "Loading", stopwatch: "Stopwatch", diff --git a/apps/projects/src/app/lib/i18n/i18n-types.ts b/apps/projects/src/app/lib/i18n/i18n-types.ts index b0031f6..acba223 100644 --- a/apps/projects/src/app/lib/i18n/i18n-types.ts +++ b/apps/projects/src/app/lib/i18n/i18n-types.ts @@ -344,14 +344,6 @@ type RootTranslation = { } home: { /** - * h - */ - hourSingleChar: string - /** - * m - */ - minSingleChar: string - /** * Are you sure you want to delete this entry? */ confirmDeleteEntry: string @@ -372,6 +364,12 @@ type RootTranslation = { */ loggedTimeToday: string /** + * {hours}h{minutes}m + * @param {unknown} hours + * @param {unknown} minutes + */ + loggedTimeTodayString: RequiredParams<'hours' | 'minutes'> + /** * Current time */ currentTime: string @@ -749,14 +747,6 @@ export type TranslationFunctions = { } home: { /** - * h - */ - hourSingleChar: () => LocalizedString - /** - * m - */ - minSingleChar: () => LocalizedString - /** * Are you sure you want to delete this entry? */ confirmDeleteEntry: () => LocalizedString @@ -777,6 +767,10 @@ export type TranslationFunctions = { */ loggedTimeToday: () => LocalizedString /** + * {hours}h{minutes}m + */ + loggedTimeTodayString: (arg: { hours: unknown, minutes: unknown }) => LocalizedString + /** * Current time */ currentTime: () => LocalizedString diff --git a/apps/projects/src/app/lib/i18n/nb/index.ts b/apps/projects/src/app/lib/i18n/nb/index.ts index 28e4bc1..1638345 100644 --- a/apps/projects/src/app/lib/i18n/nb/index.ts +++ b/apps/projects/src/app/lib/i18n/nb/index.ts @@ -101,8 +101,7 @@ const nb: Translation = { use: "Bruk", }, home: { - hourSingleChar: "t", - minSingleChar: "m", + loggedTimeTodayString: "{hours}t{minutes}m", confirmDeleteEntry: "Er du sikker på at du vil slette denne raden?", newEntry: "Ny tidsoppføring", editEntry: "Rediger rad", |
