From fa6e84a6a0566b4e0635afe6191909c27acea8a2 Mon Sep 17 00:00:00 2001 From: schriftgestalt Date: Mon, 9 Oct 2017 17:04:11 +0200 Subject: [PATCH] small fixes --- .../Source/Framework/Files/Creator/BLNibFileCreator.m | 2 +- .../Framework/Utilities/General/BLLanguageTranslator.m | 8 +++++--- Localizer/Source/Main Classes/Document.m | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BlueLocalization/Source/Framework/Files/Creator/BLNibFileCreator.m b/BlueLocalization/Source/Framework/Files/Creator/BLNibFileCreator.m index a79ce39..bbaf3f8 100755 --- a/BlueLocalization/Source/Framework/Files/Creator/BLNibFileCreator.m +++ b/BlueLocalization/Source/Framework/Files/Creator/BLNibFileCreator.m @@ -70,7 +70,7 @@ - (BOOL)_writeFileToPath:(NSString *)targetPath fromObject:(BLFileObject *)objec if (![fileManager fileExistsAtPath: referencePath]) { // Copy original if no reference version available - NSString *originalPath = [BLPathCreator replaceLanguage:language inPath:targetPath withLanguage:referencePath bundle:[object bundleObject]]; + NSString *originalPath = [BLPathCreator replaceLanguage:language inPath:targetPath withLanguage:@"en" bundle:[object bundleObject]]; [fileManager copyItemAtPath:originalPath toPath:referencePath error:NULL]; } diff --git a/BlueLocalization/Source/Framework/Utilities/General/BLLanguageTranslator.m b/BlueLocalization/Source/Framework/Utilities/General/BLLanguageTranslator.m index 0cad9cc..ea98281 100755 --- a/BlueLocalization/Source/Framework/Utilities/General/BLLanguageTranslator.m +++ b/BlueLocalization/Source/Framework/Utilities/General/BLLanguageTranslator.m @@ -91,7 +91,9 @@ + (NSLocale *)localeForLanguage:(NSString *)language // Try to find a match identifier = [NSLocale canonicalLocaleIdentifierFromString: language]; - + if ([identifier length] > 10) { + return nil; + } if (!identifier || [identifier rangeOfString: @" "].location != NSNotFound || [identifier rangeOfString: @"("].location != NSNotFound) { @@ -129,9 +131,9 @@ + (NSLocale *)localeForLanguage:(NSString *)language [__languageTranslatorCache setObject:locale forKey:language]; if (identifier) [__languageTranslatorCache setObject:locale forKey:identifier]; - if ([enLocale displayNameForKey:NSLocaleIdentifier value:identifier]) + if ([enLocale displayNameForKey:NSLocaleIdentifier value:identifier]) { [__languageTranslatorCache setObject:locale forKey:[enLocale displayNameForKey:NSLocaleIdentifier value:identifier]]; - + } return locale; } diff --git a/Localizer/Source/Main Classes/Document.m b/Localizer/Source/Main Classes/Document.m index c0e1756..02550ee 100755 --- a/Localizer/Source/Main Classes/Document.m +++ b/Localizer/Source/Main Classes/Document.m @@ -111,7 +111,7 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)aController NSRect frame = content.view.frame; frame.size.height += 1; content.view.frame = frame; - [content.view setBorderType: NSNoBorder]; + //[content.view setBorderType: NSNoBorder]; // set double action [content.contentView setDoubleAction: @selector(openSeparateEditor:)];