mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Strings for file sizes
This commit is contained in:
parent
1b42dd4a6b
commit
74149bbdc5
@ -176,13 +176,15 @@ int Parser::format_bytes(size_t filesize, char* buf, size_t len)
|
||||
|
||||
filesize = filesize / D_FILE_SIZE_DIVIDER; // multiply by 10 for 1 decimal place
|
||||
if(filesize < D_FILE_SIZE_DIVIDER * 10)
|
||||
return snprintf_P(buf, len, PSTR(D_FILE_SIZE_DECIMAL " " D_FILE_SIZE_KILOBYTES), filesize / 10, filesize % 10);
|
||||
return snprintf_P(buf, len, PSTR("%d" D_DECIMAL_POINT "%d " D_FILE_SIZE_KILOBYTES), filesize / 10,
|
||||
filesize % 10);
|
||||
|
||||
filesize = filesize / D_FILE_SIZE_DIVIDER; // multiply by 10 for 1 decimal place
|
||||
if(filesize < D_FILE_SIZE_DIVIDER * 10)
|
||||
return snprintf_P(buf, len, PSTR(D_FILE_SIZE_DECIMAL " " D_FILE_SIZE_MEGABYTES), filesize / 10, filesize % 10);
|
||||
return snprintf_P(buf, len, PSTR("%d" D_DECIMAL_POINT "%d " D_FILE_SIZE_MEGABYTES), filesize / 10,
|
||||
filesize % 10);
|
||||
|
||||
return snprintf_P(buf, len, PSTR(D_FILE_SIZE_DECIMAL " " D_FILE_SIZE_GIGABYTES), filesize / 10, filesize % 10);
|
||||
return snprintf_P(buf, len, PSTR("%d" D_DECIMAL_POINT "%d " D_FILE_SIZE_GIGABYTES), filesize / 10, filesize % 10);
|
||||
}
|
||||
|
||||
uint8_t Parser::get_action_id(const char* action)
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define D_FILE_SIZE_MEGABYTES "MiB" // new
|
||||
#define D_FILE_SIZE_GIGABYTES "GiB" // new
|
||||
#define D_FILE_SIZE_DIVIDER 1024 // new, kibi or kilo bytes
|
||||
#define F_FILE_SIZE_DECIMAL "%d.%d" // new, decimal comma or point
|
||||
#define D_DECIMAL_POINT "." // new, decimal comma or point
|
||||
|
||||
#define D_SERVICE_STARTING "Starting..."
|
||||
#define D_SERVICE_STARTED "Started"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef HASP_LANG_EN_US_H
|
||||
#define HASP_LANG_EN_US_H
|
||||
#ifndef HASP_LANG_ES_ES_H
|
||||
#define HASP_LANG_ES_ES_H
|
||||
|
||||
#define D_USERNAME "Usuario:"
|
||||
#define D_PASSWORD "Contraseña:"
|
||||
@ -26,7 +26,7 @@
|
||||
#define D_FILE_SIZE_MEGABYTES "MiB" // new
|
||||
#define D_FILE_SIZE_GIGABYTES "GiB" // new
|
||||
#define D_FILE_SIZE_DIVIDER 1024 // new, kibi or kilo bytes
|
||||
#define F_FILE_SIZE_DECIMAL "%d,%d" // new, decimal comma or point
|
||||
#define D_DECIMAL_POINT "," // new, decimal comma or point
|
||||
|
||||
#define D_SERVICE_STARTING "Inicializando..."
|
||||
#define D_SERVICE_STARTED "Inicializado"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef HASP_LANG_EN_US_H
|
||||
#define HASP_LANG_EN_US_H
|
||||
#ifndef HASP_LANG_FR_FR_H
|
||||
#define HASP_LANG_FR_FR_H
|
||||
|
||||
#define D_USERNAME "Utilisateur:"
|
||||
#define D_PASSWORD "Mot de passe:"
|
||||
@ -25,8 +25,8 @@
|
||||
#define D_FILE_SIZE_KILOBYTES "Kio"
|
||||
#define D_FILE_SIZE_MEGABYTES "Mio"
|
||||
#define D_FILE_SIZE_GIGABYTES "Gio"
|
||||
#define D_FILE_SIZE_DIVIDER 1024 // new, kibi or kilo bytes
|
||||
#define F_FILE_SIZE_DECIMAL "%d,%d" // new, decimal comma or point
|
||||
#define D_FILE_SIZE_DIVIDER 1024 // new, kibi or kilo bytes
|
||||
#define D_DECIMAL_POINT "," // new, decimal comma or point
|
||||
|
||||
#define D_SERVICE_STARTING "Démarer..."
|
||||
#define D_SERVICE_STARTED "Démaré"
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define D_FILE_SIZE_MEGABYTES "MiB" // new
|
||||
#define D_FILE_SIZE_GIGABYTES "GiB" // new
|
||||
#define D_FILE_SIZE_DIVIDER 1024 // new, kibi or kilo bytes
|
||||
#define F_FILE_SIZE_DECIMAL "%d,%d" // new, decimal comma or point
|
||||
#define D_DECIMAL_POINT "," // new, decimal comma or point
|
||||
|
||||
#define D_SERVICE_STARTING "Indítás..."
|
||||
#define D_SERVICE_STARTED "Elindítva"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef HASP_LANG_EN_US_H
|
||||
#define HASP_LANG_EN_US_H
|
||||
#ifndef HASP_LANG_NL_NL_H
|
||||
#define HASP_LANG_NL_NL_H
|
||||
|
||||
#define D_USERNAME "Gebruikersnaam:"
|
||||
#define D_PASSWORD "Wachtwoord:"
|
||||
@ -25,8 +25,8 @@
|
||||
#define D_FILE_SIZE_KILOBYTES "KiB"
|
||||
#define D_FILE_SIZE_MEGABYTES "MiB"
|
||||
#define D_FILE_SIZE_GIGABYTES "GiB"
|
||||
#define D_FILE_SIZE_DIVIDER 1024 // kibi or kilo bytes
|
||||
#define F_FILE_SIZE_DECIMAL "%d,%d" // decimal comma or point
|
||||
#define D_FILE_SIZE_DIVIDER 1024 // kibi or kilo bytes
|
||||
#define D_DECIMAL_POINT "," // decimal comma or point
|
||||
|
||||
#define D_SETTING_ENABLED "Ingeschakeld"
|
||||
#define D_SETTING_DISABLED "Uitgeschakeld"
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define D_FILE_SIZE_MEGABYTES "MiB" // new
|
||||
#define D_FILE_SIZE_GIGABYTES "GiB" // new
|
||||
#define D_FILE_SIZE_DIVIDER 1024 // new, kibi or kilo bytes
|
||||
#define F_FILE_SIZE_DECIMAL "%d,%d" // new, decimal comma or point
|
||||
#define D_DECIMAL_POINT "," // new, decimal comma or point
|
||||
|
||||
#define D_SETTING_ENABLED "Activ"
|
||||
#define D_SETTING_DISABLED "Inactiv"
|
||||
|
Loading…
x
Reference in New Issue
Block a user