translate burger menu

This commit is contained in:
cheykrym 2025-10-05 06:28:29 +03:00
parent 020cd8893a
commit 47746690d6
6 changed files with 149 additions and 46 deletions

View File

@ -187,7 +187,7 @@
}; };
}; };
buildConfigurationList = 1A6D61C72E7CD03E00B9F736 /* Build configuration list for PBXProject "yobble" */; buildConfigurationList = 1A6D61C72E7CD03E00B9F736 /* Build configuration list for PBXProject "yobble" */;
developmentRegion = en; developmentRegion = ru;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
en, en,

View File

@ -1,5 +1,5 @@
{ {
"sourceLanguage" : "en", "sourceLanguage" : "ru",
"strings" : { "strings" : {
"@%@" : { "@%@" : {
@ -12,34 +12,15 @@
}, },
"CATEGORY" : { "CATEGORY" : {
},
"Fun Fest" : {
"comment" : "Fun Fest"
}, },
"Hello, world!" : { "Hello, world!" : {
}, },
"loading_placeholder" : { "loading_placeholder" : {
},
"LoginView_button_login" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "ебите меня четверо"
}
}
}
},
"ok" : {
"extractionState" : "stale",
"localizations" : {
"ru" : {
"stringUnit" : {
"state" : "translated",
"value" : "55454545"
}
}
}
}, },
"OK" : { "OK" : {
@ -76,6 +57,9 @@
}, },
"Выйти из аккаунта" : { "Выйти из аккаунта" : {
},
"Где найти сохранённые черновики?" : {
"comment" : "FAQ question: drafts"
}, },
"Данные" : { "Данные" : {
@ -107,8 +91,8 @@
"Заглушка: Хранилище данных" : { "Заглушка: Хранилище данных" : {
}, },
"Заглушка: Частые вопросы" : { "Заказы" : {
"comment" : "Orders"
}, },
"Закрыть" : { "Закрыть" : {
"comment" : "Закрыть" "comment" : "Закрыть"
@ -124,6 +108,27 @@
}, },
"Инвайт-код (необязательно)" : { "Инвайт-код (необязательно)" : {
"comment" : "Инвайт-код" "comment" : "Инвайт-код"
},
"История" : {
"comment" : "History"
},
"Как сбросить пароль?" : {
"comment" : "FAQ question: reset password"
},
"Как связаться с поддержкой?" : {
"comment" : "FAQ question: support"
},
"Корзина" : {
"comment" : "Cart"
},
"Кошелёк" : {
"comment" : "Wallet"
},
"Лента" : {
},
"Лицо" : {
}, },
"Логин" : { "Логин" : {
"comment" : "Логин" "comment" : "Логин"
@ -133,12 +138,27 @@
}, },
"Логин уже занят." : { "Логин уже занят." : {
},
"Люди, которых вы можете знать" : {
"comment" : "People You May Like"
},
"Мини-приложения" : {
"comment" : "Applets"
},
"Мои загрузки" : {
"comment" : "My Downloads"
},
"Мои комментарии" : {
"comment" : "My Comments"
}, },
"Мой профиль" : { "Мой профиль" : {
},
"Напишите нам через форму обратной связи в разделе \"Поддержка\"." : {
"comment" : "FAQ answer: support"
}, },
"Настройки" : { "Настройки" : {
"comment" : "Settings"
}, },
"Не удалось обработать ответ сервера." : { "Не удалось обработать ответ сервера." : {
@ -209,11 +229,17 @@
"Пароль должен быть от 8 до 128 символов" : { "Пароль должен быть от 8 до 128 символов" : {
"comment" : "Пароль должен быть от 6 до 32 символов" "comment" : "Пароль должен быть от 6 до 32 символов"
}, },
"Перейдите в раздел \"Настройки > Сменить пароль\" и следуйте инструкциям." : {
"comment" : "FAQ answer: reset password"
},
"Поддержка" : { "Поддержка" : {
}, },
"Подтверждение пароля" : { "Подтверждение пароля" : {
"comment" : "Подтверждение пароля" "comment" : "Подтверждение пароля"
},
"Поиск" : {
}, },
"Приглашение достигло лимита использования." : { "Приглашение достигло лимита использования." : {
@ -259,6 +285,9 @@
}, },
"Сервер не отвечает. Попробуйте позже." : { "Сервер не отвечает. Попробуйте позже." : {
},
"Сканировать" : {
"comment" : "Scan"
}, },
"Слишком много запросов." : { "Слишком много запросов." : {
@ -271,9 +300,24 @@
}, },
"Уведомления" : { "Уведомления" : {
},
"Центр авторов" : {
"comment" : "Creator Center"
},
"Центр помощи" : {
"comment" : "Help Center"
}, },
"Частые вопросы" : { "Частые вопросы" : {
"comment" : "FAQ navigation title"
},
"Чаты" : {
},
"Черновики" : {
"comment" : "Drafts"
},
"Черновики доступны в боковом меню в разделе Drafts." : {
"comment" : "FAQ answer: drafts"
}, },
"Язык" : { "Язык" : {

View File

@ -7,12 +7,12 @@ struct CustomTabBar: View {
var body: some View { var body: some View {
HStack { HStack {
// Tab 1: Feed // Tab 1: Feed
TabBarButton(systemName: "list.bullet.rectangle", text: "Лента", isSelected: selectedTab == 0) { TabBarButton(systemName: "list.bullet.rectangle", text: NSLocalizedString("Лента", comment: ""), isSelected: selectedTab == 0) {
selectedTab = 0 selectedTab = 0
} }
// Tab 2: Search // Tab 2: Search
TabBarButton(systemName: "magnifyingglass", text: "Поиск", isSelected: selectedTab == 1) { TabBarButton(systemName: "magnifyingglass", text: NSLocalizedString("Поиск", comment: ""), isSelected: selectedTab == 1) {
selectedTab = 1 selectedTab = 1
} }
@ -22,12 +22,12 @@ struct CustomTabBar: View {
} }
// Tab 3: Chats // Tab 3: Chats
TabBarButton(systemName: "bubble.left.and.bubble.right.fill", text: "Чаты", isSelected: selectedTab == 2) { TabBarButton(systemName: "bubble.left.and.bubble.right.fill", text: NSLocalizedString("Чаты", comment: ""), isSelected: selectedTab == 2) {
selectedTab = 2 selectedTab = 2
} }
// Tab 4: Profile // Tab 4: Profile
TabBarButton(systemName: "person.crop.square", text: "Лицо", isSelected: selectedTab == 3) { TabBarButton(systemName: "person.crop.square", text: NSLocalizedString("Лицо", comment: ""), isSelected: selectedTab == 3) {
selectedTab = 3 selectedTab = 3
} }
} }

View File

@ -0,0 +1,47 @@
import SwiftUI
struct FAQView: View {
private struct FAQItem: Identifiable {
let id = UUID()
let question: String
let answer: String
}
private let faqItems: [FAQItem] = [
FAQItem(
question: NSLocalizedString("Как сбросить пароль?", comment: "FAQ question: reset password"),
answer: NSLocalizedString("Перейдите в раздел \"Настройки > Сменить пароль\" и следуйте инструкциям.", comment: "FAQ answer: reset password")
),
FAQItem(
question: NSLocalizedString("Где найти сохранённые черновики?", comment: "FAQ question: drafts"),
answer: NSLocalizedString("Черновики доступны в боковом меню в разделе Drafts.", comment: "FAQ answer: drafts")
),
FAQItem(
question: NSLocalizedString("Как связаться с поддержкой?", comment: "FAQ question: support"),
answer: NSLocalizedString("Напишите нам через форму обратной связи в разделе \"Поддержка\".", comment: "FAQ answer: support")
)
]
var body: some View {
List(faqItems) { item in
VStack(alignment: .leading, spacing: 6) {
Text(item.question)
.font(.headline)
Text(item.answer)
.font(.subheadline)
.foregroundColor(.secondary)
}
.padding(.vertical, 6)
}
.listStyle(.insetGrouped)
.navigationTitle(NSLocalizedString("Частые вопросы", comment: "FAQ navigation title"))
}
}
struct FAQView_Previews: PreviewProvider {
static var previews: some View {
NavigationView {
FAQView()
}
}
}

View File

@ -54,7 +54,7 @@ struct SettingsView: View {
// MARK: - Поддержка // MARK: - Поддержка
Section(header: Text("Поддержка")) { Section(header: Text("Поддержка")) {
NavigationLink(destination: Text("Заглушка: Частые вопросы")) { NavigationLink(destination: FAQView()) {
Label("Частые вопросы", systemImage: "questionmark.circle") Label("Частые вопросы", systemImage: "questionmark.circle")
} }
NavigationLink(destination: Text("Заглушка: Обратная связь")) { NavigationLink(destination: Text("Заглушка: Обратная связь")) {

View File

@ -68,6 +68,7 @@ struct SideMenuView: View {
@Binding var isPresented: Bool @Binding var isPresented: Bool
@State private var isAccountListExpanded = false @State private var isAccountListExpanded = false
@State private var navigateToSettings = false @State private var navigateToSettings = false
@State private var navigateToFAQ = false
// Adjustable paddings // Adjustable paddings
private let topPadding: CGFloat = 66 private let topPadding: CGFloat = 66
@ -114,6 +115,12 @@ struct SideMenuView: View {
) { ) {
EmptyView() EmptyView()
} }
NavigationLink(
destination: FAQView(),
isActive: $navigateToFAQ
) {
EmptyView()
}
ScrollView(showsIndicators: false) { ScrollView(showsIndicators: false) {
VStack(alignment: .leading, spacing: 0) { // Parent VStack VStack(alignment: .leading, spacing: 0) { // Parent VStack
@ -203,9 +210,9 @@ struct SideMenuView: View {
VStack(alignment: .leading, spacing: 20) { VStack(alignment: .leading, spacing: 20) {
// Section 1 // Section 1
VStack(alignment: .leading, spacing: 7) { VStack(alignment: .leading, spacing: 7) {
SideMenuButton(icon: "person.2.fill", title: "People You May Like", action: {}) SideMenuButton(icon: "person.2.fill", title: NSLocalizedString("Люди, которых вы можете знать", comment: "People You May Like"), action: {})
SideMenuButton(icon: "star.fill", title: "Fun Fest", action: {}) SideMenuButton(icon: "star.fill", title: NSLocalizedString("Fun Fest", comment: "Fun Fest"), action: {})
SideMenuButton(icon: "lightbulb.fill", title: "Creator Center", action: {}) SideMenuButton(icon: "lightbulb.fill", title: NSLocalizedString("Центр авторов", comment: "Creator Center"), action: {})
} }
Divider() Divider()
@ -213,10 +220,10 @@ struct SideMenuView: View {
// Section 2 // Section 2
VStack(alignment: .leading, spacing: 7) { VStack(alignment: .leading, spacing: 7) {
Text("CATEGORY").font(.caption2).foregroundColor(.secondary) Text("CATEGORY").font(.caption2).foregroundColor(.secondary)
SideMenuButton(icon: "doc.text", title: "Drafts", action: {}) SideMenuButton(icon: "doc.text", title: NSLocalizedString("Черновики", comment: "Drafts"), action: {})
SideMenuButton(icon: "bubble.left", title: "My Comments", action: {}) SideMenuButton(icon: "bubble.left", title: NSLocalizedString("Мои комментарии", comment: "My Comments"), action: {})
SideMenuButton(icon: "clock", title: "History", action: {}) SideMenuButton(icon: "clock", title: NSLocalizedString("История", comment: "History"), action: {})
SideMenuButton(icon: "arrow.down.circle", title: "My Downloads", action: {}) SideMenuButton(icon: "arrow.down.circle", title: NSLocalizedString("Мои загрузки", comment: "My Downloads"), action: {})
} }
Divider() Divider()
@ -224,16 +231,16 @@ struct SideMenuView: View {
// Section 3 // Section 3
VStack(alignment: .leading, spacing: 7) { VStack(alignment: .leading, spacing: 7) {
Text("SERVICES").font(.caption2).foregroundColor(.secondary) Text("SERVICES").font(.caption2).foregroundColor(.secondary)
SideMenuButton(icon: "shippingbox", title: "Orders", action: {}) SideMenuButton(icon: "shippingbox", title: NSLocalizedString("Заказы", comment: "Orders"), action: {})
SideMenuButton(icon: "cart", title: "Cart", action: {}) SideMenuButton(icon: "cart", title: NSLocalizedString("Корзина", comment: "Cart"), action: {})
SideMenuButton(icon: "wallet.pass", title: "Wallet", action: {}) SideMenuButton(icon: "wallet.pass", title: NSLocalizedString("Кошелёк", comment: "Wallet"), action: {})
} }
Divider() Divider()
// Section 4 // Section 4
VStack(alignment: .leading, spacing: 15) { VStack(alignment: .leading, spacing: 15) {
SideMenuButton(icon: "square.grid.2x2", title: "Applets", action: {}) SideMenuButton(icon: "square.grid.2x2", title: NSLocalizedString("Мини-приложения", comment: "Applets"), action: {})
} }
} }
.padding() .padding()
@ -247,9 +254,14 @@ struct SideMenuView: View {
// Footer // Footer
HStack(spacing: 20) { HStack(spacing: 20) {
Spacer() Spacer()
SideMenuFooterButton(icon: "qrcode.viewfinder", title: "Scan", action: {}) SideMenuFooterButton(icon: "qrcode.viewfinder", title: NSLocalizedString("Сканировать", comment: "Scan"), action: {})
SideMenuFooterButton(icon: "questionmark.circle", title: "Help Center", action: {}) SideMenuFooterButton(icon: "questionmark.circle", title: NSLocalizedString("Центр помощи", comment: "Help Center")) {
SideMenuFooterButton(icon: "wrench", title: "Settings") { withAnimation(.easeInOut) {
isPresented = false
}
navigateToFAQ = true
}
SideMenuFooterButton(icon: "gear", title: NSLocalizedString("Настройки", comment: "Settings")) {
withAnimation(.easeInOut) { withAnimation(.easeInOut) {
isPresented = false isPresented = false
} }