* FixStringForSize : without context, the locale kit was in trouble finding the right string.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37753 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,30 +30,34 @@ string_for_size(double size, char* string, size_t stringSize)
|
|||||||
double kib = size / 1024.0;
|
double kib = size / 1024.0;
|
||||||
if (kib < 1.0) {
|
if (kib < 1.0) {
|
||||||
const char* trKey = B_TRANSLATE_MARK("%d bytes");
|
const char* trKey = B_TRANSLATE_MARK("%d bytes");
|
||||||
snprintf(string, stringSize, gLocaleBackend->GetString(trKey),
|
snprintf(string, stringSize, gLocaleBackend->GetString(trKey,
|
||||||
(int)size);
|
B_TRANSLATE_CONTEXT), (int)size);
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
double mib = kib / 1024.0;
|
double mib = kib / 1024.0;
|
||||||
if (mib < 1.0) {
|
if (mib < 1.0) {
|
||||||
const char* trKey = B_TRANSLATE_MARK("%3.2f KiB");
|
const char* trKey = B_TRANSLATE_MARK("%3.2f KiB");
|
||||||
snprintf(string, stringSize, gLocaleBackend->GetString(trKey), kib);
|
snprintf(string, stringSize, gLocaleBackend->GetString(trKey,
|
||||||
|
B_TRANSLATE_CONTEXT), kib);
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
double gib = mib / 1024.0;
|
double gib = mib / 1024.0;
|
||||||
if (gib < 1.0) {
|
if (gib < 1.0) {
|
||||||
const char* trKey = B_TRANSLATE_MARK("%3.2f MiB");
|
const char* trKey = B_TRANSLATE_MARK("%3.2f MiB");
|
||||||
snprintf(string, stringSize, gLocaleBackend->GetString(trKey), mib);
|
snprintf(string, stringSize, gLocaleBackend->GetString(trKey,
|
||||||
|
B_TRANSLATE_CONTEXT), mib);
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
double tib = gib / 1024.0;
|
double tib = gib / 1024.0;
|
||||||
if (tib < 1.0) {
|
if (tib < 1.0) {
|
||||||
const char* trKey = B_TRANSLATE_MARK("%3.2f GiB");
|
const char* trKey = B_TRANSLATE_MARK("%3.2f GiB");
|
||||||
snprintf(string, stringSize, gLocaleBackend->GetString(trKey), gib);
|
snprintf(string, stringSize, gLocaleBackend->GetString(trKey,
|
||||||
|
B_TRANSLATE_CONTEXT), gib);
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
const char* trKey = B_TRANSLATE_MARK("%.2f TiB");
|
const char* trKey = B_TRANSLATE_MARK("%.2f TiB");
|
||||||
snprintf(string, stringSize, gLocaleBackend->GetString(trKey), tib);
|
snprintf(string, stringSize, gLocaleBackend->GetString(trKey,
|
||||||
|
B_TRANSLATE_CONTEXT), tib);
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user