Skip to content

Commit 59b5013

Browse files
authored
Добавил локализацию для слова "Вчера" (#294)
1 parent bea506a commit 59b5013

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

SwiftUI-WorkoutApp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@
879879
CLANG_TIDY_MISC_REDUNDANT_EXPRESSION = YES;
880880
CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
881881
CODE_SIGN_STYLE = Automatic;
882-
CURRENT_PROJECT_VERSION = 4;
882+
CURRENT_PROJECT_VERSION = 5;
883883
DEVELOPMENT_ASSET_PATHS = "SwiftUI-WorkoutApp/Preview\\ Content/PreviewContent.swift SwiftUI-WorkoutApp/Preview\\ Content";
884884
DEVELOPMENT_TEAM = CR68PP2Z3F;
885885
ENABLE_PREVIEWS = YES;
@@ -932,7 +932,7 @@
932932
CLANG_TIDY_MISC_REDUNDANT_EXPRESSION = YES;
933933
CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
934934
CODE_SIGN_STYLE = Automatic;
935-
CURRENT_PROJECT_VERSION = 4;
935+
CURRENT_PROJECT_VERSION = 5;
936936
DEVELOPMENT_ASSET_PATHS = "SwiftUI-WorkoutApp/Preview\\ Content/PreviewContent.swift SwiftUI-WorkoutApp/Preview\\ Content";
937937
DEVELOPMENT_TEAM = CR68PP2Z3F;
938938
ENABLE_PREVIEWS = YES;

SwiftUI-WorkoutApp/Libraries/SWUtils/Sources/SWUtils/DateFormatter/DateFormatterService.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public enum DateFormatterService {
1616
showTimeInThisYear: showTimeInThisYear
1717
)
1818
formatter.dateFormat = dateFormat
19-
return prefix + formatter.string(from: fullDate)
19+
let localizedPrefix = prefix.isEmpty ? "" : NSLocalizedString(prefix, comment: "") + ", "
20+
return localizedPrefix + formatter.string(from: fullDate)
2021
} else {
2122
return ""
2223
}
@@ -99,7 +100,7 @@ public extension DateFormatterService {
99100
if date.isToday {
100101
("", mediumTime.rawValue)
101102
} else if date.isYesterday {
102-
("Вчера, ", mediumTime.rawValue)
103+
("Вчера", mediumTime.rawValue)
103104
} else if date.isThisYear {
104105
(
105106
"",

SwiftUI-WorkoutApp/Resources/Localizable.xcstrings

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,17 @@
10331033
}
10341034
}
10351035
},
1036+
"Вчера" : {
1037+
"extractionState" : "manual",
1038+
"localizations" : {
1039+
"en" : {
1040+
"stringUnit" : {
1041+
"state" : "translated",
1042+
"value" : "Yesterday"
1043+
}
1044+
}
1045+
}
1046+
},
10361047
"Выбери город" : {
10371048
"extractionState" : "manual",
10381049
"localizations" : {

0 commit comments

Comments
 (0)