Skip to content

Commit 612c59c

Browse files
authored
Merge pull request #27 from simla-tech/task-90656
Fix #25 arabic localization
2 parents efdf6e0 + 2380810 commit 612c59c

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed

Example/FastisExample.xcodeproj/project.pbxproj

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
1A3E7A5E2A40901600434229 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A3E7A602A40901600434229 /* Localizable.strings */; };
1011
F381AF9628B8C7190046383A /* Fastis in Frameworks */ = {isa = PBXBuildFile; productRef = F381AF9528B8C7190046383A /* Fastis */; };
1112
F3FCEE47244780FE000F966E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3FCEE46244780FE000F966E /* AppDelegate.swift */; };
1213
F3FCEE4B244780FE000F966E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3FCEE4A244780FE000F966E /* ViewController.swift */; };
@@ -15,6 +16,9 @@
1516
/* End PBXBuildFile section */
1617

1718
/* Begin PBXFileReference section */
19+
1A3E7A5F2A40901600434229 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
20+
1A3E7A612A40902000434229 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = "<group>"; };
21+
1A3E7A622A409B3A00434229 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
1822
CB137E4877EBDC6E87A77A4B /* Pods_FastisExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FastisExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1923
F31CFB6B28B8C32D00364F6A /* Fastis */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Fastis; path = ..; sourceTree = "<group>"; };
2024
F3FCEE43244780FE000F966E /* FastisExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FastisExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -79,6 +83,7 @@
7983
F3FCEE4F24478100000F966E /* Assets.xcassets */,
8084
F3FCEE5124478100000F966E /* LaunchScreen.storyboard */,
8185
F3FCEE5424478100000F966E /* Info.plist */,
86+
1A3E7A602A40901600434229 /* Localizable.strings */,
8287
);
8388
path = Source;
8489
sourceTree = "<group>";
@@ -128,6 +133,8 @@
128133
knownRegions = (
129134
en,
130135
Base,
136+
ar,
137+
ru,
131138
);
132139
mainGroup = F3FCEE3A244780FE000F966E;
133140
productRefGroup = F3FCEE44244780FE000F966E /* Products */;
@@ -145,6 +152,7 @@
145152
buildActionMask = 2147483647;
146153
files = (
147154
F3FCEE5324478100000F966E /* LaunchScreen.storyboard in Resources */,
155+
1A3E7A5E2A40901600434229 /* Localizable.strings in Resources */,
148156
F3FCEE5024478100000F966E /* Assets.xcassets in Resources */,
149157
);
150158
runOnlyForDeploymentPostprocessing = 0;
@@ -164,6 +172,16 @@
164172
/* End PBXSourcesBuildPhase section */
165173

166174
/* Begin PBXVariantGroup section */
175+
1A3E7A602A40901600434229 /* Localizable.strings */ = {
176+
isa = PBXVariantGroup;
177+
children = (
178+
1A3E7A5F2A40901600434229 /* en */,
179+
1A3E7A612A40902000434229 /* ar */,
180+
1A3E7A622A409B3A00434229 /* ru */,
181+
);
182+
name = Localizable.strings;
183+
sourceTree = "<group>";
184+
};
167185
F3FCEE5124478100000F966E /* LaunchScreen.storyboard */ = {
168186
isa = PBXVariantGroup;
169187
children = (
@@ -179,6 +197,7 @@
179197
isa = XCBuildConfiguration;
180198
buildSettings = {
181199
ALWAYS_SEARCH_USER_PATHS = NO;
200+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
182201
CLANG_ANALYZER_NONNULL = YES;
183202
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
184203
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -240,6 +259,7 @@
240259
isa = XCBuildConfiguration;
241260
buildSettings = {
242261
ALWAYS_SEARCH_USER_PATHS = NO;
262+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
243263
CLANG_ANALYZER_NONNULL = YES;
244264
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
245265
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -297,7 +317,7 @@
297317
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
298318
CODE_SIGN_STYLE = Automatic;
299319
CURRENT_PROJECT_VERSION = 1;
300-
DEVELOPMENT_TEAM = 48KFD5698Q;
320+
DEVELOPMENT_TEAM = 7HXSBL2C9S;
301321
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
302322
INFOPLIST_KEY_CFBundleDisplayName = Fastis;
303323
IPHONEOS_DEPLOYMENT_TARGET = 14.2;
@@ -319,7 +339,7 @@
319339
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
320340
CODE_SIGN_STYLE = Automatic;
321341
CURRENT_PROJECT_VERSION = 1;
322-
DEVELOPMENT_TEAM = 48KFD5698Q;
342+
DEVELOPMENT_TEAM = 7HXSBL2C9S;
323343
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
324344
INFOPLIST_KEY_CFBundleDisplayName = Fastis;
325345
IPHONEOS_DEPLOYMENT_TARGET = 14.2;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
Localizable.strings
3+
FastisExample
4+
5+
Created by Юрий Девятаев on 19.06.2023.
6+
Copyright © 2023 RetailDriver LLC. All rights reserved.
7+
*/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
Localizable.strings
3+
FastisExample
4+
5+
Created by Юрий Девятаев on 19.06.2023.
6+
Copyright © 2023 RetailDriver LLC. All rights reserved.
7+
*/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
Localizable.strings
3+
FastisExample
4+
5+
Created by Юрий Девятаев on 19.06.2023.
6+
Copyright © 2023 RetailDriver LLC. All rights reserved.
7+
*/

Sources/Views/Controller.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ open class FastisController<Value: FastisValue>: UIViewController, JTACMonthView
158158
private var privateMinimumDate: Date?
159159
private var privateMaximumDate: Date?
160160
private var privateSelectMonthOnHeaderTap = false
161+
private var dayFormatter = DateFormatter()
161162
private var value: Value? {
162163
didSet {
163164
self.updateSelectedShortcut()
@@ -246,6 +247,8 @@ open class FastisController<Value: FastisValue>: UIViewController, JTACMonthView
246247
public init(config: FastisConfig = .default) {
247248
self.config = config
248249
self.appearance = config.controller
250+
self.dayFormatter.locale = config.calendar.locale
251+
self.dayFormatter.dateFormat = "d"
249252
super.init(nibName: nil, bundle: nil)
250253
}
251254

@@ -364,13 +367,18 @@ open class FastisController<Value: FastisValue>: UIViewController, JTACMonthView
364367
if let cachedConfig = self.viewConfigs[indexPath] {
365368
cell.configure(for: cachedConfig)
366369
} else {
367-
let newConfig = DayCell.makeViewConfig(
370+
var newConfig = DayCell.makeViewConfig(
368371
for: cellState,
369372
minimumDate: self.privateMinimumDate,
370373
maximumDate: self.privateMaximumDate,
371374
rangeValue: self.value as? FastisRange,
372375
calendar: self.config.calendar
373376
)
377+
378+
if newConfig.dateLabelText != nil {
379+
newConfig.dateLabelText = self.dayFormatter.string(from: date)
380+
}
381+
374382
self.viewConfigs[indexPath] = newConfig
375383
cell.applyConfig(self.config)
376384
cell.configure(for: newConfig)

0 commit comments

Comments
 (0)