diff --git a/CHANGELOG.md b/CHANGELOG.md index d3ff546..3569bb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v1.4.2 + +- Added experimental feature `overrideAppPreferredLanguage` which allows setting the language from inside the app. As this is not aligned with [Apple guidelines](https://developer.apple.com/news/?id=u2cfuj88), customers are advised to use it ONLY if needed for transitional period. Any issues that might arise from using this setting are left on customer's discretion for solving. + ## v1.4.1 - No changes diff --git a/CaptureCore.xcframework/Info.plist b/CaptureCore.xcframework/Info.plist index fe47421..49fc0fa 100644 --- a/CaptureCore.xcframework/Info.plist +++ b/CaptureCore.xcframework/Info.plist @@ -8,32 +8,32 @@ BinaryPath CaptureCore.framework/CaptureCore LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-simulator LibraryPath CaptureCore.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator BinaryPath CaptureCore.framework/CaptureCore LibraryIdentifier - ios-arm64_x86_64-simulator + ios-arm64 LibraryPath CaptureCore.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform ios - SupportedPlatformVariant - simulator CFBundlePackageType diff --git a/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/CaptureCore b/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/CaptureCore index 294d76d..f62d2ec 100755 Binary files a/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/CaptureCore and b/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/CaptureCore differ diff --git a/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/Info.plist b/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/Info.plist index 1358981..78a224e 100644 Binary files a/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/Info.plist and b/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/Info.plist differ diff --git a/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/_CodeSignature/CodeResources b/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/_CodeSignature/CodeResources index 8696c07..9b0d074 100644 --- a/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/_CodeSignature/CodeResources +++ b/CaptureCore.xcframework/ios-arm64/CaptureCore.framework/_CodeSignature/CodeResources @@ -62,7 +62,7 @@ Info.plist - 90PCUQB8AaF3zA+qFOesUqeNivg= + K5dbmMcTcBoC0UIHmZv5m70XDoE= Model_021c530a7efe77c0e90c4bfe19c3bebaaceee433103e4e6d4f1424d921885982.strop diff --git a/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/CaptureCore b/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/CaptureCore index afc0271..95e789c 100755 Binary files a/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/CaptureCore and b/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/CaptureCore differ diff --git a/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/Info.plist b/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/Info.plist index 08a83d3..27649ee 100644 Binary files a/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/Info.plist and b/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/Info.plist differ diff --git a/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/_CodeSignature/CodeResources b/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/_CodeSignature/CodeResources index dc9c4a4..96e42f2 100644 --- a/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/_CodeSignature/CodeResources +++ b/CaptureCore.xcframework/ios-arm64_x86_64-simulator/CaptureCore.framework/_CodeSignature/CodeResources @@ -62,7 +62,7 @@ Info.plist - DBcquIDRpm1sTflfX4UDZrTCf3s= + bh7XdhIFYmxOCFsPv0sbIxUK1jc= Model_021c530a7efe77c0e90c4bfe19c3bebaaceee433103e4e6d4f1424d921885982.strop diff --git a/CaptureUX.xcframework/Info.plist b/CaptureUX.xcframework/Info.plist index c624366..1404033 100644 --- a/CaptureUX.xcframework/Info.plist +++ b/CaptureUX.xcframework/Info.plist @@ -8,32 +8,32 @@ BinaryPath CaptureUX.framework/CaptureUX LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-simulator LibraryPath CaptureUX.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator BinaryPath CaptureUX.framework/CaptureUX LibraryIdentifier - ios-arm64_x86_64-simulator + ios-arm64 LibraryPath CaptureUX.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform ios - SupportedPlatformVariant - simulator CFBundlePackageType diff --git a/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/CaptureUX b/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/CaptureUX index 832c5ab..0c2d9b7 100755 Binary files a/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/CaptureUX and b/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/CaptureUX differ diff --git a/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Headers/MBICCaptureUISDK.h b/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Headers/MBICCaptureUISDK.h index 4cbf6bf..a46d42d 100644 --- a/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Headers/MBICCaptureUISDK.h +++ b/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Headers/MBICCaptureUISDK.h @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN MBIC_UX_FINAL @interface MBICCaptureUISDK : NSObject -@property (nonatomic) NSString *language; +/// Sets the language used in CaptureSDK +@property (nonatomic) NSString *language DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases."); /// Bundle with resources used in framework @property (nonatomic) NSBundle *resourcesBundle; @@ -25,48 +26,80 @@ MBIC_UX_FINAL @property (nonatomic) NSBundle *customResourcesBundle; /// Localization file in main bundle used for overrideing framework's localizations -@property (nonatomic) NSString *customLocalizationFileName; +@property (nonatomic) NSString *customLocalizationFileName DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases."); + +/// Language Localizable.strings +@property (nonatomic, readonly) NSBundle *localizableLanguageBundle DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases."); + +/// Overrides device langauge. You need to set your own language. +/// Set this to YES, if you want to have in-app language selection. +/// +/// WARNING: Use Apple intended way of localization from Settings screen. +/// Default: NO +@property (nonatomic) BOOL overrideAppPreferredLanguage DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases."); /// Obtain the shared instance + (instancetype)sharedInstance NS_SWIFT_NAME(shared()); -/// Sets the language used in CaptureSDK -- (void)setLanguage:(NSString *)language; - -/// Sets the language to default (i.e. language specified in the user's device settings. +/// Sets the language to default (i.e. language specified in the user's device settings).. - (void)setDefaultLanguage; @end static inline NSString * MBIC_UI_LOCALIZED_DEFAULT_STRING(NSString *key) { - return ([NSString stringWithFormat:@"%@", key]); + return ([NSString stringWithFormat:@"[[%@]]", key]); } -static inline NSString * MBIC_UI_LOCALIZED_FOR_LANGUAGE(NSString *key) { - - NSString *overridenStringFromCustomBundle = NSLocalizedStringWithDefaultValue(key, - nil, - [MBICCaptureUISDK sharedInstance].customResourcesBundle, - @"", - @""); +static inline NSString * MBIC_UI_LOCALIZED_FOR_LANGUAGE(NSString *key, NSString *language) { + NSBundle *bundle = [MBICCaptureUISDK sharedInstance].localizableLanguageBundle; + + // If a custom resource bundle is defined, use it for the localization + NSString *overridenStringFromCustomBundle = NSLocalizedStringWithDefaultValue( + key, + nil, + [MBICCaptureUISDK sharedInstance].customResourcesBundle ?: bundle, + @"", + @"" + ); + + // If we found an override in the custom bundle, return it if (overridenStringFromCustomBundle != nil && ![overridenStringFromCustomBundle isEqualToString:key]) { return overridenStringFromCustomBundle; } - - return NSLocalizedStringFromTableInBundle(key, nil, [MBICCaptureUISDK sharedInstance].resourcesBundle, @""); + + // If not, fallback to the localizable bundle + return NSLocalizedStringFromTableInBundle( + key, + @"Localizable", + bundle, + @"" + ); } static inline NSString * MBIC_UI_LOCALIZED(NSString *key) { NSString *localizationFileName = [MBICCaptureUISDK sharedInstance].customLocalizationFileName; + + // First, check if we have a custom localization file if (localizationFileName) { - NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue(key, localizationFileName, [NSBundle mainBundle], @"", @""); - + NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue( + key, + localizationFileName, + [NSBundle mainBundle], + @"", + @"" + ); + + // If we found a match in the custom localization file, return it if (![overridenStringFromCustomLocalizationFile isEqualToString:key]) { return overridenStringFromCustomLocalizationFile; } } + + // Get the language currently set in the SDK + NSString *language = [MBICCaptureUISDK sharedInstance].language; - NSString *localizedString = MBIC_UI_LOCALIZED_FOR_LANGUAGE(key); + // Now, attempt to localize the string for the selected language + NSString *localizedString = MBIC_UI_LOCALIZED_FOR_LANGUAGE(key, language); return localizedString; } diff --git a/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Info.plist b/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Info.plist index fc4842e..0a4b449 100644 Binary files a/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Info.plist and b/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Info.plist differ diff --git a/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/_CodeSignature/CodeResources b/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/_CodeSignature/CodeResources index 40b2826..3142fef 100644 --- a/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/_CodeSignature/CodeResources +++ b/CaptureUX.xcframework/ios-arm64/CaptureUX.framework/_CodeSignature/CodeResources @@ -34,7 +34,7 @@ Headers/MBICCaptureUISDK.h - E7mr/Sr6N5MTUo2uvBJ2IOsvEEs= + Bp2RehSZ4UXY650V38YzfyX0snI= Headers/MBICCaptureUXSettings.h @@ -58,7 +58,7 @@ Info.plist - 9qWsGhfHprgyetYGnq2UOrjnhac= + X8cb0/0SpqDji/nim+ZF3NiAjjg= Modules/module.modulemap @@ -331,7 +331,7 @@ hash2 - hQOqxm4/zPtVt1KHz1NHZ6BFlopHUM21e8iF2R8heBQ= + SHUyxFnUfxeqPR/i91UG7ZQXKOePxfqhfvR3Hl8JvuM= Headers/MBICCaptureUXSettings.h diff --git a/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/CaptureUX b/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/CaptureUX index c53e043..a78d930 100755 Binary files a/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/CaptureUX and b/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/CaptureUX differ diff --git a/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/Headers/MBICCaptureUISDK.h b/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/Headers/MBICCaptureUISDK.h index 4cbf6bf..a46d42d 100644 --- a/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/Headers/MBICCaptureUISDK.h +++ b/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/Headers/MBICCaptureUISDK.h @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN MBIC_UX_FINAL @interface MBICCaptureUISDK : NSObject -@property (nonatomic) NSString *language; +/// Sets the language used in CaptureSDK +@property (nonatomic) NSString *language DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases."); /// Bundle with resources used in framework @property (nonatomic) NSBundle *resourcesBundle; @@ -25,48 +26,80 @@ MBIC_UX_FINAL @property (nonatomic) NSBundle *customResourcesBundle; /// Localization file in main bundle used for overrideing framework's localizations -@property (nonatomic) NSString *customLocalizationFileName; +@property (nonatomic) NSString *customLocalizationFileName DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases."); + +/// Language Localizable.strings +@property (nonatomic, readonly) NSBundle *localizableLanguageBundle DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases."); + +/// Overrides device langauge. You need to set your own language. +/// Set this to YES, if you want to have in-app language selection. +/// +/// WARNING: Use Apple intended way of localization from Settings screen. +/// Default: NO +@property (nonatomic) BOOL overrideAppPreferredLanguage DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases."); /// Obtain the shared instance + (instancetype)sharedInstance NS_SWIFT_NAME(shared()); -/// Sets the language used in CaptureSDK -- (void)setLanguage:(NSString *)language; - -/// Sets the language to default (i.e. language specified in the user's device settings. +/// Sets the language to default (i.e. language specified in the user's device settings).. - (void)setDefaultLanguage; @end static inline NSString * MBIC_UI_LOCALIZED_DEFAULT_STRING(NSString *key) { - return ([NSString stringWithFormat:@"%@", key]); + return ([NSString stringWithFormat:@"[[%@]]", key]); } -static inline NSString * MBIC_UI_LOCALIZED_FOR_LANGUAGE(NSString *key) { - - NSString *overridenStringFromCustomBundle = NSLocalizedStringWithDefaultValue(key, - nil, - [MBICCaptureUISDK sharedInstance].customResourcesBundle, - @"", - @""); +static inline NSString * MBIC_UI_LOCALIZED_FOR_LANGUAGE(NSString *key, NSString *language) { + NSBundle *bundle = [MBICCaptureUISDK sharedInstance].localizableLanguageBundle; + + // If a custom resource bundle is defined, use it for the localization + NSString *overridenStringFromCustomBundle = NSLocalizedStringWithDefaultValue( + key, + nil, + [MBICCaptureUISDK sharedInstance].customResourcesBundle ?: bundle, + @"", + @"" + ); + + // If we found an override in the custom bundle, return it if (overridenStringFromCustomBundle != nil && ![overridenStringFromCustomBundle isEqualToString:key]) { return overridenStringFromCustomBundle; } - - return NSLocalizedStringFromTableInBundle(key, nil, [MBICCaptureUISDK sharedInstance].resourcesBundle, @""); + + // If not, fallback to the localizable bundle + return NSLocalizedStringFromTableInBundle( + key, + @"Localizable", + bundle, + @"" + ); } static inline NSString * MBIC_UI_LOCALIZED(NSString *key) { NSString *localizationFileName = [MBICCaptureUISDK sharedInstance].customLocalizationFileName; + + // First, check if we have a custom localization file if (localizationFileName) { - NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue(key, localizationFileName, [NSBundle mainBundle], @"", @""); - + NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue( + key, + localizationFileName, + [NSBundle mainBundle], + @"", + @"" + ); + + // If we found a match in the custom localization file, return it if (![overridenStringFromCustomLocalizationFile isEqualToString:key]) { return overridenStringFromCustomLocalizationFile; } } + + // Get the language currently set in the SDK + NSString *language = [MBICCaptureUISDK sharedInstance].language; - NSString *localizedString = MBIC_UI_LOCALIZED_FOR_LANGUAGE(key); + // Now, attempt to localize the string for the selected language + NSString *localizedString = MBIC_UI_LOCALIZED_FOR_LANGUAGE(key, language); return localizedString; } diff --git a/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/Info.plist b/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/Info.plist index 8ac47e5..ec10fc3 100644 Binary files a/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/Info.plist and b/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/Info.plist differ diff --git a/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/_CodeSignature/CodeResources b/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/_CodeSignature/CodeResources index 4a2a3ed..2f21862 100644 --- a/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/_CodeSignature/CodeResources +++ b/CaptureUX.xcframework/ios-arm64_x86_64-simulator/CaptureUX.framework/_CodeSignature/CodeResources @@ -34,7 +34,7 @@ Headers/MBICCaptureUISDK.h - E7mr/Sr6N5MTUo2uvBJ2IOsvEEs= + Bp2RehSZ4UXY650V38YzfyX0snI= Headers/MBICCaptureUXSettings.h @@ -58,7 +58,7 @@ Info.plist - gACvR6ygDYi4US1p7T1piHtw8Iw= + jyuGqu3MaqHDYrOHtrOn3KONi4E= Modules/module.modulemap @@ -331,7 +331,7 @@ hash2 - hQOqxm4/zPtVt1KHz1NHZ6BFlopHUM21e8iF2R8heBQ= + SHUyxFnUfxeqPR/i91UG7ZQXKOePxfqhfvR3Hl8JvuM= Headers/MBICCaptureUXSettings.h diff --git a/MBCaptureCore.podspec b/MBCaptureCore.podspec index f242ca6..760cfdf 100644 --- a/MBCaptureCore.podspec +++ b/MBCaptureCore.podspec @@ -1,10 +1,10 @@ Pod::Spec.new do |s| s.name = "MBCaptureCore" - s.version = "1.4.1" + s.version = "1.4.2" s.summary = "A delightful Direct API component for document capture" s.homepage = "http://microblink.com" - s.readme = "https://raw.githubusercontent.com/BlinkID/capture-ios/v1.4.1/README.md" + s.readme = "https://raw.githubusercontent.com/BlinkID/capture-ios/v1.4.2/README.md" s.description = <<-DESC The BlinkID Capture iOS SDK gives you the ability to auto-capture high quality images of identity documents in a user-friendly way. The SDK provides you with a rectified image of the document that ensures high success rate in extracting document text or verifying the document validity. @@ -23,7 +23,7 @@ Pod::Spec.new do |s| } s.source = { - :http => 'https://github.com/BlinkID/capture-ios/releases/download/v1.4.1/CaptureCore.xcframework.zip' + :http => 'https://github.com/BlinkID/capture-ios/releases/download/v1.4.2/CaptureCore.xcframework.zip' } s.platform = :ios diff --git a/MBCaptureUX.podspec b/MBCaptureUX.podspec index 539fa41..b953cdf 100644 --- a/MBCaptureUX.podspec +++ b/MBCaptureUX.podspec @@ -1,10 +1,10 @@ Pod::Spec.new do |s| s.name = "MBCaptureUX" - s.version = "1.4.1" + s.version = "1.4.2" s.summary = "A delightful UX component for document capture" s.homepage = "http://microblink.com" - s.readme = "https://raw.githubusercontent.com/BlinkID/capture-ios/v1.4.1/README.md" + s.readme = "https://raw.githubusercontent.com/BlinkID/capture-ios/v1.4.2/README.md" s.description = <<-DESC The BlinkID Capture iOS SDK gives you the ability to auto-capture high quality images of identity documents in a user-friendly way. The SDK provides you with a rectified image of the document that ensures high success rate in extracting document text or verifying the document validity. @@ -23,7 +23,7 @@ Pod::Spec.new do |s| } s.source = { - :http => 'https://github.com/BlinkID/capture-ios/releases/download/v1.4.1/CaptureUX.xcframework.zip' + :http => 'https://github.com/BlinkID/capture-ios/releases/download/v1.4.2/CaptureUX.xcframework.zip' } s.platform = :ios diff --git a/Release_notes.md b/Release_notes.md index 19ab446..a4e0f81 100644 --- a/Release_notes.md +++ b/Release_notes.md @@ -1,5 +1,9 @@ # Release notes +## v1.4.2 + +- Added experimental feature `overrideAppPreferredLanguage` which allows setting the language from inside the app. As this is not aligned with [Apple guidelines](https://developer.apple.com/news/?id=u2cfuj88), customers are advised to use it ONLY if needed for transitional period. Any issues that might arise from using this setting are left on customer's discretion for solving. + ## v1.4.1 - Remote license fix