[SHLWAPI] Localize StrFormatByteSizeA/W (#3051)

CORE-14011
This commit is contained in:
Katayama Hirofumi MZ 2020-08-17 06:40:39 +09:00 committed by GitHub
parent f0d6d9896d
commit 8f907ea83a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 242 additions and 0 deletions

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hr"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sec"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -28,6 +28,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " Std"
IDS_TIME_INTERVAL_MINUTES " Min"
IDS_TIME_INTERVAL_SECONDS " Sek"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hr"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sec"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hr"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sec"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hr"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sec"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -29,6 +29,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " h"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " s"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -28,6 +28,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " שעות"
IDS_TIME_INTERVAL_MINUTES " דקות"
IDS_TIME_INTERVAL_SECONDS " שניות"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -29,6 +29,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " óra"
IDS_TIME_INTERVAL_MINUTES " perc"
IDS_TIME_INTERVAL_SECONDS " mp"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hr"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sec"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -29,6 +29,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " 時間"
IDS_TIME_INTERVAL_MINUTES " 分"
IDS_TIME_INTERVAL_SECONDS " 秒"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS "시"
IDS_TIME_INTERVAL_MINUTES " 분"
IDS_TIME_INTERVAL_SECONDS " 초"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -29,6 +29,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " val"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sek"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hr"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sec"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hr"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sec"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -27,6 +27,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " godz."
IDS_TIME_INTERVAL_MINUTES " min."
IDS_TIME_INTERVAL_SECONDS " s"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -30,6 +30,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hr"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " seg"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -30,6 +30,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " ore"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sec"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -29,6 +29,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " час"
IDS_TIME_INTERVAL_MINUTES " мин"
IDS_TIME_INTERVAL_SECONDS " сек"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s КБ"
IDS_MB_FORMAT "%s МБ"
IDS_GB_FORMAT "%s ГБ"
IDS_TB_FORMAT "%s ТБ"
IDS_PB_FORMAT "%s ПБ"
IDS_EB_FORMAT "%s ЭБ"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -27,6 +27,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " hod."
IDS_TIME_INTERVAL_MINUTES " min."
IDS_TIME_INTERVAL_SECONDS " s"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -28,6 +28,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " ur"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sek"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " rë"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " sek"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " h"
IDS_TIME_INTERVAL_MINUTES " min"
IDS_TIME_INTERVAL_SECONDS " s"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -26,6 +26,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " saat"
IDS_TIME_INTERVAL_MINUTES " dakîka"
IDS_TIME_INTERVAL_SECONDS " sâniye"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -29,6 +29,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " год"
IDS_TIME_INTERVAL_MINUTES " хв"
IDS_TIME_INTERVAL_SECONDS " сек."
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -29,6 +29,14 @@ STRINGTABLE
IDS_TIME_INTERVAL_HOURS " 小时"
IDS_TIME_INTERVAL_MINUTES " 分"
IDS_TIME_INTERVAL_SECONDS " 秒"
#ifdef __REACTOS__
IDS_KB_FORMAT "%s KB"
IDS_MB_FORMAT "%s MB"
IDS_GB_FORMAT "%s GB"
IDS_TB_FORMAT "%s TB"
IDS_PB_FORMAT "%s PB"
IDS_EB_FORMAT "%s EB"
#endif
}
IDD_ERR_DIALOG DIALOGEX 0, 0, 220, 60

View file

@ -27,6 +27,14 @@
#define IDS_TIME_INTERVAL_HOURS 65
#define IDS_TIME_INTERVAL_MINUTES 66
#define IDS_TIME_INTERVAL_SECONDS 67
#ifdef __REACTOS__
#define IDS_KB_FORMAT 68
#define IDS_MB_FORMAT 69
#define IDS_GB_FORMAT 70
#define IDS_TB_FORMAT 71
#define IDS_PB_FORMAT 72
#define IDS_EB_FORMAT 73
#endif
/* These numbers match native IDs and shouldn't be arbitrarily changed */
#define IDD_ERR_DIALOG 0x1200

View file

@ -2354,7 +2354,11 @@ typedef struct tagSHLWAPI_BYTEFORMATS
double dDivisor;
double dNormaliser;
int nDecimals;
#ifdef __REACTOS__
UINT nFormatID;
#else
WCHAR wPrefix;
#endif
} SHLWAPI_BYTEFORMATS;
/*************************************************************************
@ -2383,6 +2387,24 @@ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
static const SHLWAPI_BYTEFORMATS bfFormats[] =
{
#ifdef __REACTOS__
{ 10*KB, 10.24, 100.0, 2, IDS_KB_FORMAT }, /* 10 KB */
{ 100*KB, 102.4, 10.0, 1, IDS_KB_FORMAT }, /* 100 KB */
{ 1000*KB, 1024.0, 1.0, 0, IDS_KB_FORMAT }, /* 1000 KB */
{ 10*MB, 10485.76, 100.0, 2, IDS_MB_FORMAT }, /* 10 MB */
{ 100*MB, 104857.6, 10.0, 1, IDS_MB_FORMAT }, /* 100 MB */
{ 1000*MB, 1048576.0, 1.0, 0, IDS_MB_FORMAT }, /* 1000 MB */
{ 10*GB, 10737418.24, 100.0, 2, IDS_GB_FORMAT }, /* 10 GB */
{ 100*GB, 107374182.4, 10.0, 1, IDS_GB_FORMAT }, /* 100 GB */
{ 1000*GB, 1073741824.0, 1.0, 0, IDS_GB_FORMAT }, /* 1000 GB */
{ 10*TB, 10485.76, 100.0, 2, IDS_TB_FORMAT }, /* 10 TB */
{ 100*TB, 104857.6, 10.0, 1, IDS_TB_FORMAT }, /* 100 TB */
{ 1000*TB, 1048576.0, 1.0, 0, IDS_TB_FORMAT }, /* 1000 TB */
{ 10*PB, 10737418.24, 100.00, 2, IDS_PB_FORMAT }, /* 10 PB */
{ 100*PB, 107374182.4, 10.00, 1, IDS_PB_FORMAT }, /* 100 PB */
{ 1000*PB, 1073741824.0, 1.00, 0, IDS_PB_FORMAT }, /* 1000 PB */
{ 0, 10995116277.76, 100.00, 2, IDS_EB_FORMAT } /* EB's, catch all */
#else
{ 10*KB, 10.24, 100.0, 2, 'K' }, /* 10 KB */
{ 100*KB, 102.4, 10.0, 1, 'K' }, /* 100 KB */
{ 1000*KB, 1024.0, 1.0, 0, 'K' }, /* 1000 KB */
@ -2399,8 +2421,13 @@ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
{ 100*PB, 107374182.4, 10.00, 1, 'P' }, /* 100 PB */
{ 1000*PB, 1073741824.0, 1.00, 0, 'P' }, /* 1000 PB */
{ 0, 10995116277.76, 100.00, 2, 'E' } /* EB's, catch all */
#endif
};
#ifdef __REACTOS__
WCHAR szBuff[40], wszFormat[40];
#else
WCHAR wszAdd[] = {' ','?','B',0};
#endif
double dBytes;
UINT i = 0;
@ -2439,10 +2466,17 @@ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
dBytes = floor(dBytes / bfFormats[i].dDivisor) / bfFormats[i].dNormaliser;
#ifdef __REACTOS__
if (!FormatDouble(dBytes, bfFormats[i].nDecimals, szBuff, ARRAYSIZE(szBuff)))
return NULL;
LoadStringW(shlwapi_hInstance, bfFormats[i].nFormatID, wszFormat, ARRAYSIZE(wszFormat));
snprintfW(lpszDest, cchMax, wszFormat, szBuff);
#else
if (!FormatDouble(dBytes, bfFormats[i].nDecimals, lpszDest, cchMax))
return NULL;
wszAdd[1] = bfFormats[i].wPrefix;
StrCatBuffW(lpszDest, wszAdd, cchMax);
#endif
return lpszDest;
}