mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-24 06:02:27 +00:00
Extended NSBundle localizations method for Android.
This commit is contained in:
parent
ca76053c8e
commit
409030a367
2 changed files with 23 additions and 8 deletions
|
@ -2540,10 +2540,23 @@ IF_NO_GC(
|
|||
locale = [[locale lastPathComponent] stringByDeletingPathExtension];
|
||||
[array addObject: locale];
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
// TODO: check known languages for existance directly, as AAssetDir and thereby
|
||||
// NSDirectoryEnumerator doesn't list directories
|
||||
#endif
|
||||
// Android: Check known languages for localizations directly, as AAssetDir
|
||||
// and thereby NSDirectoryEnumerator doesn't list directories and the above
|
||||
// call to list lproj resources will therefore come up empty.
|
||||
NSArray *languages = [[NSUserDefaults standardUserDefaults]
|
||||
stringArrayForKey: @"NSLanguages"];
|
||||
|
||||
for (locale in languages) {
|
||||
NSString *path = [self pathForResource:@"Localizable" ofType:@"strings"
|
||||
inDirectory:nil forLocalization:locale];
|
||||
if (path) {
|
||||
[array addObject: locale];
|
||||
}
|
||||
}
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
return GS_IMMUTABLE(array);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue