[haiku-commits] haiku: hrev44766 - src/bin/locale

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 5 Nov 2012 19:53:04 +0100 (CET)

hrev44766 adds 1 changeset to branch 'master'
old head: 82a674605b14403f45c28163480890ef16164476
new head: 8ef01bd74e313b9b1e9732a76f91c59deeca8a02

----------------------------------------------------------------------------

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

                                    [ Oliver Tappe <zooey@xxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44766
Commit:      8ef01bd74e313b9b1e9732a76f91c59deeca8a02
URL:         http://cgit.haiku-os.org/haiku/commit/?id=8ef01bd
Author:      Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
Date:        Mon Nov  5 18:52:35 2012 UTC

Ticket:      https://dev.haiku-os.org/ticket/8193

----------------------------------------------------------------------------

1 file changed, 14 insertions(+), 7 deletions(-)
src/bin/locale/locale.cpp | 21 ++++++++++++++-------

----------------------------------------------------------------------------

diff --git a/src/bin/locale/locale.cpp b/src/bin/locale/locale.cpp
index 53d787a..2635fc9 100644
--- a/src/bin/locale/locale.cpp
+++ b/src/bin/locale/locale.cpp
@@ -43,8 +43,12 @@ print_formatting_conventions()
 {
        BFormattingConventions conventions;
        BLocale::Default()->GetFormattingConventions(&conventions);
-       printf("%s_%s.UTF-8\n", conventions.LanguageCode(),
-               conventions.CountryCode());
+       if (conventions.CountryCode() != NULL) {
+               printf("%s_%s.UTF-8\n", conventions.LanguageCode(),
+                       conventions.CountryCode());
+       } else {
+               printf("%s.UTF-8\n", conventions.LanguageCode());
+       }
 }
 
 
@@ -53,12 +57,15 @@ print_time_conventions()
 {
        BFormattingConventions conventions;
        BLocale::Default()->GetFormattingConventions(&conventions);
-       if (conventions.UseStringsFromPreferredLanguage()) {
-               printf("%s_%s.UTF-8@strings=messages\n", 
conventions.LanguageCode(),
-                       conventions.CountryCode());
+       if (conventions.CountryCode() != NULL) {
+               printf("%s_%s.UTF-8%s\n", conventions.LanguageCode(),
+                       conventions.CountryCode(),
+                       conventions.UseStringsFromPreferredLanguage()
+                               ? "@strings=messages" : "");
        } else {
-               printf("%s_%s.UTF-8\n", conventions.LanguageCode(),
-                       conventions.CountryCode());
+               printf("%s.UTF-8%s\n", conventions.LanguageCode(),
+                       conventions.UseStringsFromPreferredLanguage()
+                               ? "@strings=messages" : "");
        }
 }
 


Other related posts:

  • » [haiku-commits] haiku: hrev44766 - src/bin/locale - zooey