Skip to content

Commit

Permalink
Merge pull request #22 from lokalise/migrating_to_xcframework
Browse files Browse the repository at this point in the history
Migrating to xcframework
  • Loading branch information
fl-lokalise authored Jul 24, 2023
2 parents e6ccbde + 5c6cffe commit 12f879f
Show file tree
Hide file tree
Showing 22 changed files with 406 additions and 110 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 1.0.0 (24-07-2023)

This major release does not have functional changes and is marked as such due to the change from `.framework` to `.xframework`, new testing pipelines, and dropped support for iOS 10 and 11.
Still, please view it as a major update and validate that it works in your existing projects.

### Other

- Updated internal API URL.
- Deprecated functionality removed (no effect on public methods).

### Breaking changes

- Moved to `.xcframework` format.
- Deployment target is set to iOS 11.0.

## 0.10.2 (18-12-2020)

### Other
Expand Down
Binary file removed Lokalise.framework/Info.plist
Binary file not shown.
Binary file removed Lokalise.framework/Lokalise
Binary file not shown.
72 changes: 0 additions & 72 deletions Lokalise.framework/strip-frameworks.sh

This file was deleted.

16 changes: 5 additions & 11 deletions Lokalise.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "Lokalise"
s.version = "0.10.2"
s.version = "1.0.0"
s.summary = "Lokalise framework for OTA localization for iOS."
s.description = <<-DESC.gsub(/^ +\|/,'')
|No need to resubmit your app for review to update strings or translations anymore
Expand All @@ -11,28 +11,22 @@ Pod::Spec.new do |s|
| * Test localizations - create pre-release OTA localization bundles for your application. No need to recompile sources. Once the bundles are generated (at Lokalise Download page), see project settings to control versions and pre-release status.
DESC

s.homepage = "https://lokalise.co"
s.homepage = "https://lokalise.com"
s.license = { :type => "Custom", :file => 'LICENSE.md' }

s.author = { "Fedya Levkin" => "fedya@lokalise.co" }
s.author = { "Fedya Levkin" => "fedya@lokalise.com" }

s.platform = :ios

s.ios.deployment_target = "9.0"
s.ios.deployment_target = "11.0"

s.source = {:git => "https://github.com/lokalise/lokalise-ios-framework.git", :tag => s.version}

s.ios.vendored_frameworks = "Lokalise.framework"
s.ios.vendored_frameworks = "Lokalise.xcframework"

s.frameworks = 'Foundation'
s.libraries = 'c++', 'z'

s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(inherited)" }

s.pod_target_xcconfig = {
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
}

s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

end
40 changes: 40 additions & 0 deletions Lokalise.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>Lokalise.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>Lokalise.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

#import <Foundation/Foundation.h>
#import "LokaliseErrors.h"
#import "LokaliseLocalizationType.h"
#import <Lokalise/LokaliseErrors.h>
#import <Lokalise/LokaliseLocalizationType.h>

@protocol LokaliseDelegate;

Expand Down
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
//
// Lokalise.h
// Lokalise
//
// Created by Fjodors Levkins on 20/05/15.
// Copyright (c) 2015 Lokalise SIA. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Lokalise/LokaliseErrors.h>
#import <Lokalise/LokaliseLocalizationType.h>

@protocol LokaliseDelegate;

extern NSString *__nonnull LokaliseFrameworkVersion;
extern NSString *__nonnull LokaliseDidUpdateLocalizationNotification;

@interface Lokalise : NSObject

@property (class, readonly, strong) Lokalise *__nonnull sharedObject NS_SWIFT_NAME(shared);

/**
Lokalise SDK token.
*/
@property (strong, nonatomic, readonly, nullable) NSString *token;

/**
Lokalise Project ID.
*/
@property (strong, nonatomic, readonly, nullable) NSString *projectID;

/**
Set api token and project ID.
@param projectID Project ID.
@param token Lokalise SDK token.
*/
- (void)setProjectID:(NSString *__nonnull)projectID token:(NSString *__nonnull)token;

/**
Set api token and project ID.
@param apiToken Lokalise API Token.
@param projectID Project ID.
@deprecated Use [Lokalise.sharedObject setProjectId:projectId token:token]
*/
- (void)setAPIToken:(NSString *__nonnull)apiToken projectID:(NSString *__nonnull)projectID __deprecated_msg("Use [Lokalise.sharedObject setProjectId:projectId token:token]");

/**
Currently selected localization locale.
*/
@property (strong, nonatomic, readonly, nonnull) NSLocale *localizationLocale;

/**
@return NSArray of NSLocale objects. Always has at least one locale.
*/
- (NSArray <NSLocale *> *__nonnull)availableLocales;

/**
Sets localization locale which will be available right away.
Can be set only to one of available locales.
@param localizationLocale Locale from availableLocales array.
@param makeDefault Application will remember selected locale if set to true.
@param completionBlock Completion block where error is nil if locale is set.
*/
- (void)setLocalizationLocale:(NSLocale *__nonnull)localizationLocale makeDefault:(BOOL)makeDefault completion:(void (^__nullable)(NSError *__nullable error))completionBlock;

/**
Current bundle version. 0 if bundle is not loaded or downloaded.
*/
@property (nonatomic, readonly) NSInteger lokaliseBundleVersion;

/**
Determines what source is used for localization.
Set to `LokaliseLocalizationRelease` by default.
*/
@property (nonatomic) LokaliseLocalizationType localizationType;

/**
This method returns the following when key is nil or not found in table:
- If key is nil and value is nil, returns an empty string.
- If key is nil and value is non-nil, returns value.
- If key is not found and value is nil or an empty string, returns key.
- If key is not found and value is non-nil and not empty, return value.
@param key The key for a string in the table identified by tableName.
@param value The value to return if key is nil or if a localized string for key can’t be found in the table.
@param tableName The receiver’s string table to search. If tableName is nil or is an empty string, the method attempts to use the table in Localizable.strings.
@return A localized version of the string designated by key in table tableName.
*/
- (NSString *__nonnull)localizedStringForKey:(NSString *__nonnull)key value:(NSString *__nullable)value table:(NSString *__nullable)tableName NS_FORMAT_ARGUMENT(1);

/**
Check if new localization version is available and downloads it.
@param completionBlock Completion block where parameter `updated` is set to true if new bundle was downloaded and `error` which provides details if something went wrong.
*/
- (void)checkForUpdatesWithCompletion:(void (^__nullable)(BOOL updated, NSError *__nullable error))completionBlock;

/**
Deletes all files downloaded by lokalise framework.
*/
- (void)deleteLokaliseData;

/**
Forces [[NSBundle mainBundle] localizedStringForKey:key value:value table:tableName] to use [[Lokalise shareObject] localizedStringForKey:key value:value table:tableName].
*/
- (void)swizzleMainBundle;

/**
Deswizzles [[NSBundle mainBundle] localizedStringForKey:key value:value table:tableName].
*/
- (void)deswizzleMainBundle;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// LokaliseErrors.h
// Lokalise
//
// Created by Fjodors Levkins on 21/05/15.
// Copyright (c) 2015 Lokalise SIA. All rights reserved.
//

#ifndef Lokalise_LokaliseErrors_h
#define Lokalise_LokaliseErrors_h

/**
Lokalise API error domain
*/
static NSString *LKLAPIErrorDomain = @"lokalise.api.error";

/**
Lokalise framework error domain
*/
static NSString *LKLErrorDomain = @"lokalise.error";

typedef NS_ENUM(NSInteger, LokaliseErrorCode) {
LokaliseErrorNoProjectData = 1,
LokaliseErrorLocaleNotSupported,
LokaliseErrorNoLokaliseFolder,
LokaliseErrorNoLokaliseBundle,
LokaliseErrorAlreadyUpdating,
LokaliseErrorFailedToExtact,
LokaliseErrorBadServerResponse,
LokaliseErrorBadBundleLocation,
LokaliseErrorBadServerBundleResponse,
LokaliseErrorNoLocalBundleForLocale,
LokaliseErrorNoLocalBundleForLocaleSwizzleDisabled,
LokaliseErrorNoLokaliseBundleForLocale,
LokaliseErrorNoUniqueIdentifier
};


#endif

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// LokaliseLocalizationType.h
// Lokalise
//
// Created by Fedya Levkin on 04/04/2017.
// Copyright © 2017 Lokalise SIA. All rights reserved.
//

#ifndef LokaliseLocalizationType_h
#define LokaliseLocalizationType_h

typedef NS_ENUM(NSInteger, LokaliseLocalizationType) {
LokaliseLocalizationRelease = 0,
LokaliseLocalizationPrerelease = 1,
LokaliseLocalizationLocal = 2,
LokaliseLocalizationDebug = 3
};

#endif /* LokaliseLocalizationType_h */
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module Lokalise {
umbrella header "Lokalise.h"

export *
module * { export * }
}
Loading

0 comments on commit 12f879f

Please sign in to comment.