Skip to content

Commit

Permalink
GSLocale: Use language aliases dict from NSBundle instead
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder committed Jan 7, 2025
1 parent 5c6c4a8 commit fc8e353
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Source/GSLocale.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,23 +255,16 @@
GSLanguageFromLocale(NSString *locale)
{
NSString *language = nil;
NSString *aliases = nil;
NSBundle *gbundle;
NSDictionary *dict;

if (locale == nil || [locale isEqual: @"C"] || [locale isEqual: @"POSIX"]
|| [locale length] < 2)
return @"English";

ENTER_POOL
gbundle = [NSBundle bundleForLibrary: @"gnustep-base"];
aliases = [gbundle pathForResource: @"Locale"
ofType: @"aliases"
inDirectory: @"Languages"];
if (aliases != nil)
dict = GSPrivateLanguageAliases();
if (dict != nil)
{
NSDictionary *dict;

dict = [NSDictionary dictionaryWithContentsOfFile: aliases];
language = [[dict objectForKey: locale] copy];
if (language == nil && [locale pathExtension] != nil)
{
Expand Down

0 comments on commit fc8e353

Please sign in to comment.