Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed locale detection on Mac OS X.
When specifying a country code, Mac OS X uses a dash instead of an underscore,
 so pt_PT would come out as pt-PT. Just convert to underscores and continue on.
  • Loading branch information
icculus committed May 12, 2009
1 parent 60c1c22 commit daf71d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions platform_unix.c
Expand Up @@ -417,6 +417,12 @@ char *MojoPlatform_locale(void)
CFStringGetCString(locale, ptr, len, kCFStringEncodingUTF8);
CFRelease(locale);
retval = xrealloc(ptr, strlen(ptr) + 1);
// !!! FIXME: this may not be 100% right, but change
// !!! FIXME: xx-YY to xx_YY (lang_country).
if (retval[2] == '-')
retval[2] = '_';
if (retval[3] == '-')
retval[3] = '_';
} // if
} // if
CFRelease(languages);
Expand Down

0 comments on commit daf71d7

Please sign in to comment.