Fix #8193 - wrong LC_* vars if there's no country code.

This commit is contained in:
Oliver Tappe
2012-11-05 19:52:35 +01:00
parent 82a674605b
commit 8ef01bd74e
+12 -5
View File
@@ -43,8 +43,12 @@ print_formatting_conventions()
{ {
BFormattingConventions conventions; BFormattingConventions conventions;
BLocale::Default()->GetFormattingConventions(&conventions); BLocale::Default()->GetFormattingConventions(&conventions);
if (conventions.CountryCode() != NULL) {
printf("%s_%s.UTF-8\n", conventions.LanguageCode(), printf("%s_%s.UTF-8\n", conventions.LanguageCode(),
conventions.CountryCode()); conventions.CountryCode());
} else {
printf("%s.UTF-8\n", conventions.LanguageCode());
}
} }
@@ -53,12 +57,15 @@ print_time_conventions()
{ {
BFormattingConventions conventions; BFormattingConventions conventions;
BLocale::Default()->GetFormattingConventions(&conventions); BLocale::Default()->GetFormattingConventions(&conventions);
if (conventions.UseStringsFromPreferredLanguage()) { if (conventions.CountryCode() != NULL) {
printf("%s_%s.UTF-8@strings=messages\n", conventions.LanguageCode(), printf("%s_%s.UTF-8%s\n", conventions.LanguageCode(),
conventions.CountryCode()); conventions.CountryCode(),
conventions.UseStringsFromPreferredLanguage()
? "@strings=messages" : "");
} else { } else {
printf("%s_%s.UTF-8\n", conventions.LanguageCode(), printf("%s.UTF-8%s\n", conventions.LanguageCode(),
conventions.CountryCode()); conventions.UseStringsFromPreferredLanguage()
? "@strings=messages" : "");
} }
} }