Skip to content

Commit

Permalink
OFLocalization: Ignore missing language files
Browse files Browse the repository at this point in the history
  • Loading branch information
Midar committed Nov 19, 2017
1 parent 02d29fd commit a763b28
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/OFLocalization.m
Expand Up @@ -25,6 +25,7 @@

#import "OFInvalidArgumentException.h"
#import "OFInvalidEncodingException.h"
#import "OFOpenItemFailedException.h"

#ifdef OF_MORPHOS
# define BOOL EXEC_BOOL
Expand Down Expand Up @@ -249,7 +250,12 @@ - (void)addLanguageDirectory: (OFString *)path
pool = objc_autoreleasePoolPush();

mapPath = [path stringByAppendingPathComponent: @"languages.json"];
map = [[OFString stringWithContentsOfFile: mapPath] JSONValue];
@try {
map = [[OFString stringWithContentsOfFile: mapPath] JSONValue];
} @catch (OFOpenItemFailedException *e) {
objc_autoreleasePoolPop(pool);
return;
}

language = [_language lowercaseString];
territory = [_territory lowercaseString];
Expand Down

0 comments on commit a763b28

Please sign in to comment.