Skip to content

Commit 294bd46

Browse files
authored
Обновление локализации (#122)
* Работа в процессе Сделал перевод для всех сгенерированных строк * Update Localizable.xcstrings * Сменил дефолтный язык на ru * Работа в процессе Добавляю локализацию * Работа в процессе * Работа в процессе * Работа в процессе * Работа в процессе - Добавил ворнинг про необходимость парсинга HTML * Работа в процессе * Работа в процессе Перевожу приложение * Работа в процессе * Работа в процессе * Работа в процессе * Удалил неиспользуемый код * Работа в процессе Добавил в настройки возможность менять язык (ru/en) * Перевод в процессе * Поправил обводку у SWTextField * Перевел вкладку "Дневники" * Перевод в процессе Закончил перевод для вкладки "Сообщения" * Перевод в процессе - Перевел экран профиля и списка друзей/заявок - Перевел экран авторизации * Доделал основной перевод * Поднял версию сборки до 2
1 parent 036100e commit 294bd46

File tree

52 files changed

+3470
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3470
-414
lines changed

SwiftUI-WorkoutApp.xcodeproj/project.pbxproj

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
67138D942974854F00BBF450 /* XCTestCase+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67138D932974854F00BBF450 /* XCTestCase+.swift */; };
2121
671CD13929A2904200645678 /* SWModels in Frameworks */ = {isa = PBXBuildFile; productRef = 671CD13829A2904200645678 /* SWModels */; };
2222
671D7DEC28210D2F0068E728 /* EmptyContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 671D7DEB28210D2F0068E728 /* EmptyContentView.swift */; };
23-
672609542977CCD300042226 /* AdaptiveColorModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672609532977CCD300042226 /* AdaptiveColorModifier.swift */; };
2423
672F2BE32832BC7C0000A193 /* oldEvents.json in Resources */ = {isa = PBXBuildFile; fileRef = 672F2BE22832BC7C0000A193 /* oldEvents.json */; };
2524
6734D39429BC69580000B5B1 /* DesignSystem in Frameworks */ = {isa = PBXBuildFile; productRef = 6734D39329BC69580000B5B1 /* DesignSystem */; };
2625
67419ACF282E70B9004F5339 /* SportsGroundsListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67419ACE282E70B9004F5339 /* SportsGroundsListView.swift */; };
@@ -69,8 +68,6 @@
6968
6798AA79280BE8E200DB76F1 /* countries.json in Resources */ = {isa = PBXBuildFile; fileRef = 6798AA75280BE8E200DB76F1 /* countries.json */; };
7069
6798AA7B280BE8E200DB76F1 /* oldSportsGrounds.json in Resources */ = {isa = PBXBuildFile; fileRef = 6798AA77280BE8E200DB76F1 /* oldSportsGrounds.json */; };
7170
6798AA84280C0F7D00DB76F1 /* EditAccountScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6798AA83280C0F7D00DB76F1 /* EditAccountScreen.swift */; };
72-
679F3AFF29683EB300BB3590 /* RoundedButtonLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 679F3AFE29683EB300BB3590 /* RoundedButtonLabel.swift */; };
73-
679F3B012968401700BB3590 /* AdaptiveRoundedRectangleModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 679F3B002968401700BB3590 /* AdaptiveRoundedRectangleModifier.swift */; };
7471
679F3B03296841DD00BB3590 /* URLOpener.swift in Sources */ = {isa = PBXBuildFile; fileRef = 679F3B02296841DD00BB3590 /* URLOpener.swift */; };
7572
679F3B072969D4E200BB3590 /* IncognitoUserButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 679F3B062969D4E200BB3590 /* IncognitoUserButton.swift */; };
7673
67A079F22A758E7D005EAF70 /* PickedPhotoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67A079F12A758E7D005EAF70 /* PickedPhotoView.swift */; };
@@ -133,7 +130,6 @@
133130
67138D932974854F00BBF450 /* XCTestCase+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCTestCase+.swift"; sourceTree = "<group>"; };
134131
671CD13729A28CB800645678 /* SWModels */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = SWModels; path = "SwiftUI-WorkoutApp/SWModels"; sourceTree = "<group>"; };
135132
671D7DEB28210D2F0068E728 /* EmptyContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyContentView.swift; sourceTree = "<group>"; };
136-
672609532977CCD300042226 /* AdaptiveColorModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdaptiveColorModifier.swift; sourceTree = "<group>"; };
137133
672F2BE22832BC7C0000A193 /* oldEvents.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = oldEvents.json; sourceTree = "<group>"; };
138134
6734D39229BC693D0000B5B1 /* DesignSystem */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = DesignSystem; path = "SwiftUI-WorkoutApp/DesignSystem"; sourceTree = "<group>"; };
139135
67419ACE282E70B9004F5339 /* SportsGroundsListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SportsGroundsListView.swift; sourceTree = "<group>"; };
@@ -185,8 +181,6 @@
185181
6798AA75280BE8E200DB76F1 /* countries.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = countries.json; sourceTree = "<group>"; };
186182
6798AA77280BE8E200DB76F1 /* oldSportsGrounds.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = oldSportsGrounds.json; sourceTree = "<group>"; };
187183
6798AA83280C0F7D00DB76F1 /* EditAccountScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditAccountScreen.swift; sourceTree = "<group>"; };
188-
679F3AFE29683EB300BB3590 /* RoundedButtonLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedButtonLabel.swift; sourceTree = "<group>"; };
189-
679F3B002968401700BB3590 /* AdaptiveRoundedRectangleModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdaptiveRoundedRectangleModifier.swift; sourceTree = "<group>"; };
190184
679F3B02296841DD00BB3590 /* URLOpener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLOpener.swift; sourceTree = "<group>"; };
191185
679F3B062969D4E200BB3590 /* IncognitoUserButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IncognitoUserButton.swift; sourceTree = "<group>"; };
192186
67A079F12A758E7D005EAF70 /* PickedPhotoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickedPhotoView.swift; sourceTree = "<group>"; };
@@ -579,9 +573,6 @@
579573
6762775C283ABF0C009C203F /* UsersList */,
580574
67BAF3F92836275C00DB40D9 /* Comments */,
581575
671D7DEB28210D2F0068E728 /* EmptyContentView.swift */,
582-
679F3AFE29683EB300BB3590 /* RoundedButtonLabel.swift */,
583-
679F3B002968401700BB3590 /* AdaptiveRoundedRectangleModifier.swift */,
584-
672609532977CCD300042226 /* AdaptiveColorModifier.swift */,
585576
);
586577
path = Common;
587578
sourceTree = "<group>";
@@ -784,7 +775,7 @@
784775
};
785776
buildConfigurationList = 6798AA35280AEDC900DB76F1 /* Build configuration list for PBXProject "SwiftUI-WorkoutApp" */;
786777
compatibilityVersion = "Xcode 13.0";
787-
developmentRegion = en;
778+
developmentRegion = ru;
788779
hasScannedForEncodings = 0;
789780
knownRegions = (
790781
en,
@@ -869,7 +860,6 @@
869860
6798AA55280AF46300DB76F1 /* DialogsScreen.swift in Sources */,
870861
6758463F2965B7F2000BA5E0 /* ImageDetailView.swift in Sources */,
871862
67B371732A640079000FF143 /* AppThemeService.swift in Sources */,
872-
672609542977CCD300042226 /* AdaptiveColorModifier.swift in Sources */,
873863
67FBF64B283379D9008A7968 /* EventsListViewModel.swift in Sources */,
874864
67BAF3F428361BC400DB40D9 /* PhotoSectionView.swift in Sources */,
875865
67BAF3F82836245100DB40D9 /* CommentsView.swift in Sources */,
@@ -881,7 +871,6 @@
881871
67627755283A4C77009C203F /* JournalEntriesList.swift in Sources */,
882872
67B78716281D8006008B104F /* SportsGroundsMapViewModel.swift in Sources */,
883873
671D7DEC28210D2F0068E728 /* EmptyContentView.swift in Sources */,
884-
679F3AFF29683EB300BB3590 /* RoundedButtonLabel.swift in Sources */,
885874
6773111A2965FFAA003CD13A /* PreviewContent.swift in Sources */,
886875
679F3B072969D4E200BB3590 /* IncognitoUserButton.swift in Sources */,
887876
67419AD1282E70F9004F5339 /* SportsGroundListViewModel.swift in Sources */,
@@ -923,7 +912,6 @@
923912
6758B92A281D8FD7001D83D8 /* SportsGroundDetailViewModel.swift in Sources */,
924913
67D916812838E2460098D3CB /* DialogListView.swift in Sources */,
925914
6798AA53280AF43900DB76F1 /* EventsListView.swift in Sources */,
926-
679F3B012968401700BB3590 /* AdaptiveRoundedRectangleModifier.swift in Sources */,
927915
670CA19E280E8F09003914A3 /* ProfileSettingsView.swift in Sources */,
928916
67B78714281D74F3008B104F /* EditAccountViewModel.swift in Sources */,
929917
6762775B283A87AD009C203F /* JournalCell.swift in Sources */,
@@ -1177,7 +1165,7 @@
11771165
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11781166
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
11791167
CODE_SIGN_STYLE = Automatic;
1180-
CURRENT_PROJECT_VERSION = 1;
1168+
CURRENT_PROJECT_VERSION = 2;
11811169
DEVELOPMENT_ASSET_PATHS = "SwiftUI-WorkoutApp/Preview\\ Content/PreviewContent.swift SwiftUI-WorkoutApp/Preview\\ Content";
11821170
DEVELOPMENT_TEAM = CR68PP2Z3F;
11831171
ENABLE_PREVIEWS = YES;
@@ -1213,7 +1201,7 @@
12131201
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
12141202
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
12151203
CODE_SIGN_STYLE = Automatic;
1216-
CURRENT_PROJECT_VERSION = 1;
1204+
CURRENT_PROJECT_VERSION = 2;
12171205
DEVELOPMENT_ASSET_PATHS = "SwiftUI-WorkoutApp/Preview\\ Content/PreviewContent.swift SwiftUI-WorkoutApp/Preview\\ Content";
12181206
DEVELOPMENT_TEAM = CR68PP2Z3F;
12191207
ENABLE_PREVIEWS = YES;

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/ContentInSheet.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import SwiftUI
33
/// Обертка для представления контента в модальном окне с готовым хедером
44
public struct ContentInSheet<Content: View>: View {
55
@Environment(\.dismiss) private var dismiss
6-
private let title: String
6+
private let title: LocalizedStringKey
77
private var spacing: CGFloat?
88
private let content: Content
99

1010
public init(
11-
title: String,
11+
title: LocalizedStringKey,
1212
spacing: CGFloat? = nil,
1313
@ViewBuilder content: () -> Content
1414
) {

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/ItemListScreen.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import SwiftUI
66
public struct ItemListScreen: View {
77
@Environment(\.dismiss) private var dismiss
88
@State private var searchQuery = ""
9+
private let mode: Mode
910
private let allItems: [String]
1011
private let selectedItem: String
1112
private let didSelectItem: (String) -> Void
@@ -16,10 +17,12 @@ public struct ItemListScreen: View {
1617
/// - selectedItem: Выбранный элемент
1718
/// - didSelectItem: Возвращает выбранный элемент
1819
public init(
20+
mode: Mode,
1921
allItems: [String],
2022
selectedItem: String,
2123
didSelectItem: @escaping (String) -> Void
2224
) {
25+
self.mode = mode
2326
self.allItems = allItems
2427
self.selectedItem = selectedItem
2528
self.didSelectItem = didSelectItem
@@ -36,7 +39,7 @@ public struct ItemListScreen: View {
3639
dismiss()
3740
} label: {
3841
TextWithCheckmarkRowView(
39-
text: item,
42+
text: .init(item),
4043
isChecked: item == selectedItem
4144
)
4245
}
@@ -52,11 +55,23 @@ public struct ItemListScreen: View {
5255
placement: .navigationBarDrawer(displayMode: .always),
5356
prompt: Text("Поиск")
5457
)
55-
.navigationTitle("Выбери страну")
58+
.navigationTitle(mode.title)
5659
.navigationBarTitleDisplayMode(.inline)
5760
}
5861
}
5962

63+
public extension ItemListScreen {
64+
enum Mode {
65+
case country, city
66+
var title: LocalizedStringKey {
67+
switch self {
68+
case .country: "Выбери страну"
69+
case .city: "Выбери город"
70+
}
71+
}
72+
}
73+
}
74+
6075
private extension ItemListScreen {
6176
var filteredItems: [String] {
6277
searchQuery.isEmpty
@@ -68,6 +83,7 @@ private extension ItemListScreen {
6883
#if DEBUG
6984
#Preview {
7085
ItemListScreen(
86+
mode: .country,
7187
allItems: ["Россия, Канада, Австралия"],
7288
selectedItem: "Россия",
7389
didSelectItem: { _ in }

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/Rows/ChatBubbleRowView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public struct ChatBubbleRowView: View {
3333
.font(.caption2)
3434
.foregroundColor(.swSmallElements)
3535
}
36+
.textSelection(.enabled)
3637
.padding(messageType == .sent ? .leading : .trailing, 50)
3738
.frame(
3839
maxWidth: .infinity,
@@ -79,7 +80,6 @@ public extension ChatBubbleRowView {
7980
)
8081
}
8182
.padding(.horizontal)
82-
.textSelection(.enabled)
8383
.previewLayout(.sizeThatFits)
8484
}
8585
#endif

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/Rows/CheckmarkRowView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public struct TextWithCheckmarkRowView: View {
1111

1212
public var body: some View {
1313
HStack(spacing: 10) {
14-
Text(text)
14+
Text(.init(text))
1515
.lineLimit(1)
1616
.foregroundColor(.swMainText)
1717
.frame(maxWidth: .infinity, alignment: .leading)

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/Rows/FormRowView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct FormRowView: View {
2020

2121
public var body: some View {
2222
HStack(spacing: 12) {
23-
Text(title)
23+
Text(.init(title))
2424
.font(.headline)
2525
.foregroundColor(.swMainText)
2626
.fixedSize()

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/Rows/JournalRowView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ public extension JournalRowView {
7171
}
7272

7373
public enum Option: Identifiable {
74-
public var id: String { title + systemImageName }
74+
public var id: String { systemImageName }
7575
case edit, setup, report, delete
76-
var title: String {
76+
var title: LocalizedStringKey {
7777
switch self {
7878
case .edit: "Изменить"
7979
case .setup: "Настроить"

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/Rows/ListRowView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public extension ListRowView {
4141
var view: some View {
4242
switch self {
4343
case let .text(text):
44-
makeTextView(with: text)
44+
makeTextView(with: .init(text))
4545
case let .iconWithText(iconName, text):
4646
HStack(spacing: 12) {
4747
ListRowView.LeadingContent.makeIconView(with: iconName)
48-
makeTextView(with: text)
48+
makeTextView(with: .init(text))
4949
}
5050
}
5151
}
@@ -60,7 +60,7 @@ public extension ListRowView {
6060
}
6161
}
6262

63-
private func makeTextView(with text: String) -> some View {
63+
private func makeTextView(with text: LocalizedStringKey) -> some View {
6464
Text(text).foregroundColor(.swMainText)
6565
}
6666
}
@@ -84,16 +84,16 @@ public extension ListRowView {
8484
case .chevron:
8585
if isEnabled { Icons.Misc.chevronView }
8686
case let .text(text):
87-
makeTextView(with: text)
87+
makeTextView(with: .init(text))
8888
case let .textWithChevron(text):
8989
HStack(spacing: 12) {
90-
makeTextView(with: text)
90+
makeTextView(with: .init(text))
9191
if isEnabled { Icons.Misc.chevronView }
9292
}
9393
}
9494
}
9595

96-
private func makeTextView(with text: String) -> some View {
96+
private func makeTextView(with text: LocalizedStringKey) -> some View {
9797
Text(text).foregroundColor(.swSmallElements)
9898
}
9999
}

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/SWTextEditor.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ public struct SWTextEditor: View {
3737
)
3838
.animation(.default, value: isFocused)
3939
.overlay(alignment: .topLeading) {
40-
Text(placeholder ?? "")
41-
.foregroundColor(.swSeparators)
42-
.multilineTextAlignment(.leading)
43-
.opacity(text.isEmpty ? 1 : 0)
44-
.padding(.top, 10)
45-
.padding(.horizontal, 12)
46-
.allowsHitTesting(false)
40+
if let placeholder {
41+
Text(.init(placeholder))
42+
.foregroundColor(.swSeparators)
43+
.multilineTextAlignment(.leading)
44+
.opacity(text.isEmpty ? 1 : 0)
45+
.padding(.top, 10)
46+
.padding(.horizontal, 12)
47+
.allowsHitTesting(false)
48+
}
4749
}
4850
}
4951
}

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/SWTextField.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct SWTextField: View {
3535
.padding(12)
3636
.background {
3737
RoundedRectangle(cornerRadius: 8)
38-
.strokeBorder(borderColor, lineWidth: 0.5)
38+
.strokeBorder(borderColor, lineWidth: 1)
3939
.animation(.default, value: isFocused)
4040
}
4141
errorMessageViewIfNeeded
@@ -72,16 +72,16 @@ private extension SWTextField {
7272
@ViewBuilder
7373
var textField: some View {
7474
if isSecure {
75-
SecureField(placeholder, text: $text)
75+
SecureField(.init(placeholder), text: $text)
7676
} else {
77-
TextField(placeholder, text: $text)
77+
TextField(.init(placeholder), text: $text)
7878
}
7979
}
8080

8181
@ViewBuilder
8282
var errorMessageViewIfNeeded: some View {
8383
if let message = errorState?.message {
84-
Text(message)
84+
Text(.init(message))
8585
.font(.subheadline)
8686
.multilineTextAlignment(.leading)
8787
.foregroundColor(.swError)

0 commit comments

Comments
 (0)