fix translating times

This commit is contained in:
proddy
2022-08-25 23:04:41 +02:00
parent 1f8e6cc82b
commit 9fa59310d2
6 changed files with 104 additions and 29 deletions

View File

@@ -68,7 +68,14 @@ const de: Translation = {
'MQTT Veröffentlicht',
'API Aufrufe',
'Syslog Mitteilungen'
]
],
NUM_DEVICES: '{num} Gerät{{en}}',
NUM_TEMP_SENSORS: '{num} Temperatursensor{{en}}',
NUM_ANALOG_SENSORS: '{num} Analoger Sensor{{en}}',
NUM_DAYS: '{num} Tag{{en}}',
NUM_SECONDS: '{num} Sekund{{en}}',
NUM_HOURS: '{num} Stunde{{n}}',
NUM_MINUTES: '{num} Minute{{en}}'
};
export default de;

View File

@@ -68,7 +68,14 @@ const en: BaseTranslation = {
'MQTT Publishes',
'API Calls',
'Syslog Messages'
]
],
NUM_DEVICES: '{num} Device{{s}}',
NUM_TEMP_SENSORS: '{num} Temperature Sensor{{s}}',
NUM_ANALOG_SENSORS: '{num} Analog Sensor{{s}}',
NUM_DAYS: '{num} Day{{s}}',
NUM_SECONDS: '{num} Second{{s}}',
NUM_HOURS: '{num} Hour{{s}}',
NUM_MINUTES: '{num} Minute{{s}}'
};
export default en;

View File

@@ -280,6 +280,41 @@ type RootTranslation = {
*/
'7': string
}
/**
* {num} Device{{s}}
* @param {string | number | boolean} num
*/
NUM_DEVICES: RequiredParams<'num'>
/**
* {num} Temperature Sensor{{s}}
* @param {string | number | boolean} num
*/
NUM_TEMP_SENSORS: RequiredParams<'num'>
/**
* {num} Analog Sensor{{s}}
* @param {string | number | boolean} num
*/
NUM_ANALOG_SENSORS: RequiredParams<'num'>
/**
* {num} Day{{s}}
* @param {string | number | boolean} num
*/
NUM_DAYS: RequiredParams<'num'>
/**
* {num} Second{{s}}
* @param {string | number | boolean} num
*/
NUM_SECONDS: RequiredParams<'num'>
/**
* {num} Hour{{s}}
* @param {string | number | boolean} num
*/
NUM_HOURS: RequiredParams<'num'>
/**
* {num} Minute{{s}}
* @param {string | number | boolean} num
*/
NUM_MINUTES: RequiredParams<'num'>
}
export type TranslationFunctions = {
@@ -545,6 +580,34 @@ export type TranslationFunctions = {
*/
'7': () => LocalizedString
}
/**
* {num} Device{{s}}
*/
NUM_DEVICES: (arg: { num: string | number | boolean }) => LocalizedString
/**
* {num} Temperature Sensor{{s}}
*/
NUM_TEMP_SENSORS: (arg: { num: string | number | boolean }) => LocalizedString
/**
* {num} Analog Sensor{{s}}
*/
NUM_ANALOG_SENSORS: (arg: { num: string | number | boolean }) => LocalizedString
/**
* {num} Day{{s}}
*/
NUM_DAYS: (arg: { num: string | number | boolean }) => LocalizedString
/**
* {num} Second{{s}}
*/
NUM_SECONDS: (arg: { num: string | number | boolean }) => LocalizedString
/**
* {num} Hour{{s}}
*/
NUM_HOURS: (arg: { num: string | number | boolean }) => LocalizedString
/**
* {num} Minute{{s}}
*/
NUM_MINUTES: (arg: { num: string | number | boolean }) => LocalizedString
}
export type Formatters = {}