Skip to content

Commit b41d49c

Browse files
committed
Added Example and Readme
1 parent 5cb2508 commit b41d49c

13 files changed

+338
-46
lines changed

Example/LanguageManager.xcodeproj/project.pbxproj

+20-17
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
/* Begin PBXBuildFile section */
1010
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
1111
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
12-
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
1312
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
1413
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
1514
6CD6C9602E1054BBECA8FD84 /* Pods_LanguageManager_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD46D38A2A5295DF09847E0B /* Pods_LanguageManager_Example.framework */; };
15+
D0617993239CEC89004C078C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D0617995239CEC89004C078C /* Main.storyboard */; };
1616
/* End PBXBuildFile section */
1717

1818
/* Begin PBXFileReference section */
@@ -22,7 +22,6 @@
2222
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2323
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2424
607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
25-
607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2625
607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
2726
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
2827
7496790CF4DD475A4F4B15EF /* Pods-LanguageManager_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LanguageManager_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LanguageManager_Example/Pods-LanguageManager_Example.debug.xcconfig"; sourceTree = "<group>"; };
@@ -31,6 +30,9 @@
3130
A10A64F5BFA783962B776733 /* Pods-LanguageManager_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LanguageManager_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-LanguageManager_Tests/Pods-LanguageManager_Tests.release.xcconfig"; sourceTree = "<group>"; };
3231
AD46D38A2A5295DF09847E0B /* Pods_LanguageManager_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LanguageManager_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3332
C169E18BB2A07DFCAA99FA26 /* Pods_LanguageManager_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LanguageManager_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
33+
D0617994239CEC89004C078C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
34+
D0617996239CECB2004C078C /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Main.strings; sourceTree = "<group>"; };
35+
D0617997239CECB2004C078C /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
3436
E75469D9F09D9873B885F87F /* LanguageManager.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LanguageManager.podspec; path = ../LanguageManager.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
3537
/* End PBXFileReference section */
3638

@@ -70,7 +72,7 @@
7072
children = (
7173
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
7274
607FACD71AFB9204008FA782 /* ViewController.swift */,
73-
607FACD91AFB9204008FA782 /* Main.storyboard */,
75+
D0617995239CEC89004C078C /* Main.storyboard */,
7476
607FACDC1AFB9204008FA782 /* Images.xcassets */,
7577
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */,
7678
607FACD31AFB9204008FA782 /* Supporting Files */,
@@ -160,8 +162,9 @@
160162
developmentRegion = English;
161163
hasScannedForEncodings = 0;
162164
knownRegions = (
163-
en,
165+
English,
164166
Base,
167+
ar,
165168
);
166169
mainGroup = 607FACC71AFB9204008FA782;
167170
productRefGroup = 607FACD11AFB9204008FA782 /* Products */;
@@ -178,7 +181,7 @@
178181
isa = PBXResourcesBuildPhase;
179182
buildActionMask = 2147483647;
180183
files = (
181-
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
184+
D0617993239CEC89004C078C /* Main.storyboard in Resources */,
182185
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
183186
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
184187
);
@@ -214,21 +217,17 @@
214217
buildActionMask = 2147483647;
215218
files = (
216219
);
217-
inputFileListPaths = (
218-
);
219220
inputPaths = (
220-
"${SRCROOT}/Pods/Target Support Files/Pods-LanguageManager_Example/Pods-LanguageManager_Example-frameworks.sh",
221+
"${PODS_ROOT}/Target Support Files/Pods-LanguageManager_Example/Pods-LanguageManager_Example-frameworks.sh",
221222
"${BUILT_PRODUCTS_DIR}/LanguageManager/LanguageManager.framework",
222223
);
223224
name = "[CP] Embed Pods Frameworks";
224-
outputFileListPaths = (
225-
);
226225
outputPaths = (
227226
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LanguageManager.framework",
228227
);
229228
runOnlyForDeploymentPostprocessing = 0;
230229
shellPath = /bin/sh;
231-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LanguageManager_Example/Pods-LanguageManager_Example-frameworks.sh\"\n";
230+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LanguageManager_Example/Pods-LanguageManager_Example-frameworks.sh\"\n";
232231
showEnvVarsInLog = 0;
233232
};
234233
/* End PBXShellScriptBuildPhase section */
@@ -246,20 +245,22 @@
246245
/* End PBXSourcesBuildPhase section */
247246

248247
/* Begin PBXVariantGroup section */
249-
607FACD91AFB9204008FA782 /* Main.storyboard */ = {
248+
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = {
250249
isa = PBXVariantGroup;
251250
children = (
252-
607FACDA1AFB9204008FA782 /* Base */,
251+
607FACDF1AFB9204008FA782 /* Base */,
252+
D0617997239CECB2004C078C /* ar */,
253253
);
254-
name = Main.storyboard;
254+
name = LaunchScreen.xib;
255255
sourceTree = "<group>";
256256
};
257-
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = {
257+
D0617995239CEC89004C078C /* Main.storyboard */ = {
258258
isa = PBXVariantGroup;
259259
children = (
260-
607FACDF1AFB9204008FA782 /* Base */,
260+
D0617994239CEC89004C078C /* Base */,
261+
D0617996239CECB2004C078C /* ar */,
261262
);
262-
name = LaunchScreen.xib;
263+
name = Main.storyboard;
263264
sourceTree = "<group>";
264265
};
265266
/* End PBXVariantGroup section */
@@ -269,6 +270,7 @@
269270
isa = XCBuildConfiguration;
270271
buildSettings = {
271272
ALWAYS_SEARCH_USER_PATHS = NO;
273+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
272274
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
273275
CLANG_CXX_LIBRARY = "libc++";
274276
CLANG_ENABLE_MODULES = YES;
@@ -322,6 +324,7 @@
322324
isa = XCBuildConfiguration;
323325
buildSettings = {
324326
ALWAYS_SEARCH_USER_PATHS = NO;
327+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
325328
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
326329
CLANG_CXX_LIBRARY = "libc++";
327330
CLANG_ENABLE_MODULES = YES;

Example/LanguageManager/.DS_Store

6 KB
Binary file not shown.

Example/LanguageManager/AppDelegate.swift

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@
33
// LanguageManager
44
//
55
// Created by sameh-hst on 01/31/2019.
6-
// Copyright (c) 2019 sameh-hst. All rights reserved.
6+
// Copyright (c) 2019 Sameh All rights reserved.
77
//
88

99
import UIKit
10+
import LanguageManager
1011

1112
@UIApplicationMain
1213
class AppDelegate: UIResponder, UIApplicationDelegate {
1314

1415
var window: UIWindow?
1516

1617

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18-
// Override point for customization after application launch.
18+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
19+
20+
LanguageManager.defaultLanguage = .en
21+
UIButton().supportLanguageDirection
22+
LanguageManager.firstTimeLanguageSetting()
23+
1924
return true
2025
}
2126

0 commit comments

Comments
 (0)