Localizations

This commit is contained in:
Arkadiusz Fal
2022-09-04 17:28:30 +02:00
parent 2d51f6adff
commit b66e177114
33 changed files with 2180 additions and 122 deletions

View File

@@ -112,7 +112,7 @@ struct AdvancedSettings: View {
}
var manifestHeader: some View {
SettingsHeader(text: "Public Manifest")
SettingsHeader(text: "Public Manifest".localized())
}
var showMPVPlaybackStatsToggle: some View {

View File

@@ -45,7 +45,7 @@ struct BrowsingSettings: View {
}
private var interfaceSettings: some View {
Section(header: SettingsHeader(text: "Interface")) {
Section(header: SettingsHeader(text: "Interface".localized())) {
#if os(iOS)
Toggle("Lock portrait mode", isOn: $lockPortraitWhenBrowsing)
.onChange(of: lockPortraitWhenBrowsing) { lock in
@@ -66,7 +66,7 @@ struct BrowsingSettings: View {
}
private var thumbnailsSettings: some View {
Section(header: SettingsHeader(text: "Thumbnails")) {
Section(header: SettingsHeader(text: "Thumbnails".localized())) {
thumbnailsQualityPicker
#if !os(tvOS)
Toggle("Round corners", isOn: $roundedThumbnails)
@@ -79,14 +79,14 @@ struct BrowsingSettings: View {
private var thumbnailsQualityPicker: some View {
Picker("Quality", selection: $thumbnailsQuality) {
ForEach(ThumbnailsQuality.allCases, id: \.self) { quality in
Text(quality.rawValue.capitalized + " quality").tag(quality)
Text(quality.description)
}
}
.modifier(SettingsPickerModifier())
}
private var visibleSectionsSettings: some View {
Section(header: SettingsHeader(text: "Sections")) {
Section(header: SettingsHeader(text: "Sections".localized())) {
#if os(macOS)
let list = ForEach(VisibleSection.allCases, id: \.self) { section in
VisibleSectionSelectionRow(

View File

@@ -17,34 +17,34 @@ struct Help: View {
ScrollView(.vertical, showsIndicators: false) {
VStack(alignment: .leading, spacing: 0) {
Section {
header("I am lost")
header("I am lost".localized())
Text("You can find information about using Yattee in the Wiki pages.")
.padding(.bottom, 8)
helpItemLink("Wiki", url: Self.wikiURL, systemImage: "questionmark.circle")
helpItemLink("Wiki".localized(), url: Self.wikiURL, systemImage: "questionmark.circle")
.padding(.bottom, 8)
}
Spacer()
Section {
header("I want to ask a question")
header("I want to ask a question".localized())
Text("Discussions take place in Discord and Matrix. It's a good spot for general questions.")
.padding(.bottom, 8)
helpItemLink("Discord Server", url: Self.discordURL, systemImage: "message")
helpItemLink("Discord Server".localized(), url: Self.discordURL, systemImage: "message")
.padding(.bottom, 8)
helpItemLink("Matrix Channel", url: Self.matrixURL, systemImage: "message")
helpItemLink("Matrix Channel".localized(), url: Self.matrixURL, systemImage: "message")
.padding(.bottom, 8)
}
Spacer()
Section {
header("I found a bug /")
header("I have a feature request")
header("I found a bug /".localized())
header("I have a feature request".localized())
Text("Bugs and great feature ideas can be sent to the GitHub issues tracker. ")
Text("If you are reporting a bug, include all relevant details (especially: app\u{00a0}version, used device and system version, steps to reproduce).")
@@ -52,8 +52,8 @@ struct Help: View {
.padding(.bottom, 8)
VStack(alignment: .leading, spacing: 8) {
helpItemLink("Issues Tracker", url: Self.issuesURL, systemImage: "ladybug")
helpItemLink("Milestones", url: Self.milestonesURL, systemImage: "list.star")
helpItemLink("Issues Tracker".localized(), url: Self.issuesURL, systemImage: "ladybug")
helpItemLink("Milestones".localized(), url: Self.milestonesURL, systemImage: "list.star")
}
.padding(.bottom, 8)
}
@@ -61,15 +61,14 @@ struct Help: View {
Spacer()
Section {
header("I like this app!")
header("I like this app!".localized())
Text("That's nice to hear. It is fun to deliver apps other people want to use. " +
"You can consider donating to the project or help by contributing to new features development.")
Text("That's nice to hear. It is fun to deliver apps other people want to use. You can consider donating to the project or help by contributing to new features development.")
.padding(.bottom, 8)
VStack(alignment: .leading, spacing: 8) {
helpItemLink("Donations", url: Self.donationsURL, systemImage: "dollarsign.circle")
helpItemLink("Contributing", url: Self.contributingURL, systemImage: "hammer")
helpItemLink("Donations".localized(), url: Self.donationsURL, systemImage: "dollarsign.circle")
helpItemLink("Contributing".localized(), url: Self.contributingURL, systemImage: "hammer")
}
.padding(.bottom, 8)
}

View File

@@ -39,7 +39,7 @@ struct HistorySettings: View {
private var sections: some View {
Group {
#if os(tvOS)
Section(header: SettingsHeader(text: "History")) {
Section(header: SettingsHeader(text: "History".localized())) {
Toggle("Save history of searches, channels and playlists", isOn: $saveRecents)
Toggle("Save history of played videos", isOn: $saveHistory)
Toggle("Show progress of watching on thumbnails", isOn: $showWatchingProgress)
@@ -53,7 +53,7 @@ struct HistorySettings: View {
watchedVideoBadgeColorPicker
}
#else
Section(header: SettingsHeader(text: "History")) {
Section(header: SettingsHeader(text: "History".localized())) {
Toggle("Save history of searches, channels and playlists", isOn: $saveRecents)
Toggle("Save history of played videos", isOn: $saveHistory)
Toggle("Show progress of watching on thumbnails", isOn: $showWatchingProgress)
@@ -61,7 +61,7 @@ struct HistorySettings: View {
Toggle("Keep last played video in the queue after restart", isOn: $saveLastPlayed)
}
Section(header: SettingsHeader(text: "Watched")) {
Section(header: SettingsHeader(text: "Watched".localized())) {
watchedVideoPlayNowBehaviorPicker
#if os(macOS)
.padding(.top, 1)
@@ -70,7 +70,7 @@ struct HistorySettings: View {
resetWatchedStatusOnPlayingToggle
}
Section(header: SettingsHeader(text: "Interface")) {
Section(header: SettingsHeader(text: "Interface".localized())) {
watchedVideoStylePicker
#if os(macOS)
.padding(.top, 1)
@@ -88,7 +88,7 @@ struct HistorySettings: View {
}
private var watchedThresholdPicker: some View {
Section(header: SettingsHeader(text: "Mark video as watched after playing", secondary: true)) {
Section(header: SettingsHeader(text: "Mark video as watched after playing".localized(), secondary: true)) {
Picker("Mark video as watched after playing", selection: $watchedThreshold) {
ForEach(Self.watchedThresholds, id: \.self) { threshold in
Text("\(threshold)%").tag(threshold)
@@ -100,7 +100,7 @@ struct HistorySettings: View {
}
private var watchedVideoStylePicker: some View {
Section(header: SettingsHeader(text: "Mark watched videos with", secondary: true)) {
Section(header: SettingsHeader(text: "Mark watched videos with".localized(), secondary: true)) {
Picker("Mark watched videos with", selection: $watchedVideoStyle) {
Text("Nothing").tag(WatchedVideoStyle.nothing)
Text("Badge").tag(WatchedVideoStyle.badge)
@@ -113,7 +113,7 @@ struct HistorySettings: View {
}
private var watchedVideoBadgeColorPicker: some View {
Section(header: SettingsHeader(text: "Badge color", secondary: true)) {
Section(header: SettingsHeader(text: "Badge color".localized(), secondary: true)) {
Picker("Badge color", selection: $watchedVideoBadgeColor) {
Text("Based on system color scheme").tag(WatchedVideoBadgeColor.colorSchemeBased)
Text("Blue").tag(WatchedVideoBadgeColor.blue)
@@ -127,7 +127,7 @@ struct HistorySettings: View {
}
private var watchedVideoPlayNowBehaviorPicker: some View {
Section(header: SettingsHeader(text: "When partially watched video is played", secondary: true)) {
Section(header: SettingsHeader(text: "When partially watched video is played".localized(), secondary: true)) {
Picker("When partially watched video is played", selection: $watchedVideoPlayNowBehavior) {
Text("Continue").tag(WatchedVideoPlayNowBehavior.continue)
Text("Restart").tag(WatchedVideoPlayNowBehavior.restart)

View File

@@ -11,7 +11,7 @@ struct InstanceSettings: View {
var body: some View {
List {
Section(header: Text("Accounts")) {
Section(header: Text("Accounts".localized())) {
if instance.app.supportsAccounts {
ForEach(InstancesModel.accounts(instance.id), id: \.self) { account in
#if os(tvOS)
@@ -61,7 +61,7 @@ struct InstanceSettings: View {
}
}
if instance.app.hasFrontendURL {
Section(header: Text("Frontend URL")) {
Section(header: Text("Frontend URL".localized())) {
TextField(
"Frontend URL",
text: $frontendURL

View File

@@ -41,7 +41,7 @@ struct LocationsSettings: View {
}
@ViewBuilder var settings: some View {
Section(header: SettingsHeader(text: "Public Locations"), footer: countryFooter) {
Section(header: SettingsHeader(text: "Public Locations".localized()), footer: countryFooter) {
Picker("Country", selection: $countryOfPublicInstances) {
Text("Don't use public locations").tag(String?.none)
ForEach(countries, id: \.self) { country in
@@ -65,7 +65,7 @@ struct LocationsSettings: View {
.disabled(countryOfPublicInstances.isNil)
}
Section(header: SettingsHeader(text: "Custom Locations")) {
Section(header: SettingsHeader(text: "Custom Locations".localized())) {
#if os(macOS)
InstancesSettings()
.environmentObject(model)
@@ -80,8 +80,8 @@ struct LocationsSettings: View {
@ViewBuilder var countryFooter: some View {
if let account = accounts.current {
let locationType = account.isPublic ? (account.country ?? "Unknown") : "Custom"
let description = account.isPublic ? account.url : account.instance?.description ?? "unknown"
let locationType = account.isPublic ? (account.country ?? "Unknown") : "Custom".localized()
let description = account.isPublic ? account.url : account.instance?.description ?? "unknown".localized()
Text("Current: \(locationType)\n\(description)")
.foregroundColor(.secondary)
@@ -99,7 +99,7 @@ struct LocationsSettings: View {
}
}
.onFailure { _ in
model.presentAlert(title: "Could not load locations manifest")
model.presentAlert(title: "Could not load locations manifest".localized())
}
}

View File

@@ -61,7 +61,7 @@ struct PlayerSettings: View {
private var sections: some View {
Group {
Section(header: SettingsHeader(text: "Playback")) {
Section(header: SettingsHeader(text: "Playback".localized())) {
sourcePicker
pauseOnHidingPlayerToggle
#if !os(macOS)
@@ -73,20 +73,20 @@ struct PlayerSettings: View {
}
#if !os(tvOS)
Section(header: SettingsHeader(text: "Controls"), footer: controlsLayoutFooter) {
Section(header: SettingsHeader(text: "Controls".localized()), footer: controlsLayoutFooter) {
horizontalPlayerGestureEnabledToggle
SettingsHeader(text: "Seek gesture sensitivity", secondary: true)
SettingsHeader(text: "Seek gesture sensitivity".localized(), secondary: true)
seekGestureSensitivityPicker
SettingsHeader(text: "Seek gesture speed", secondary: true)
SettingsHeader(text: "Seek gesture speed".localized(), secondary: true)
seekGestureSpeedPicker
SettingsHeader(text: "Regular size", secondary: true)
SettingsHeader(text: "Regular size".localized(), secondary: true)
playerControlsLayoutPicker
SettingsHeader(text: "Fullscreen size", secondary: true)
SettingsHeader(text: "Fullscreen size".localized(), secondary: true)
fullScreenPlayerControlsLayoutPicker
}
#endif
Section(header: SettingsHeader(text: "Interface")) {
Section(header: SettingsHeader(text: "Interface".localized())) {
#if os(iOS)
if idiom == .pad {
sidebarPicker
@@ -103,7 +103,7 @@ struct PlayerSettings: View {
}
#if os(iOS)
Section(header: SettingsHeader(text: "Orientation")) {
Section(header: SettingsHeader(text: "Orientation".localized())) {
if idiom == .pad {
enterFullscreenInLandscapeToggle
}
@@ -111,7 +111,7 @@ struct PlayerSettings: View {
}
#endif
Section(header: SettingsHeader(text: "Picture in Picture")) {
Section(header: SettingsHeader(text: "Picture in Picture".localized())) {
closePiPOnNavigationToggle
closePiPOnOpeningPlayerToggle
closePlayerOnOpeningPiPToggle
@@ -124,7 +124,7 @@ struct PlayerSettings: View {
private var sourcePicker: some View {
Picker("Source", selection: $playerInstanceID) {
Text("Account Instance").tag(String?.none)
Text("Instance of current account").tag(String?.none)
ForEach(instances) { instance in
Text(instance.description).tag(Optional(instance.id))
@@ -136,15 +136,15 @@ struct PlayerSettings: View {
private var systemControlsCommandsPicker: some View {
func labelText(_ label: String) -> String {
#if os(macOS)
"System controls show buttons for \(label)"
String(format: "System controls show buttons for %@".localized(), label)
#else
label
#endif
}
return Picker("System controls buttons", selection: $systemControlsCommands) {
Text(labelText("10 seconds forwards/backwards")).tag(SystemControlsCommands.seek)
Text(labelText("Restart/Play next")).tag(SystemControlsCommands.restartAndAdvanceToNext)
Text(labelText("10 seconds forwards/backwards".localized())).tag(SystemControlsCommands.seek)
Text(labelText("Restart/Play next".localized())).tag(SystemControlsCommands.restartAndAdvanceToNext)
}
.onChange(of: systemControlsCommands) { _ in
player.updateRemoteCommandCenter()

View File

@@ -68,7 +68,7 @@ struct QualitySettings: View {
forceAVPlayerForLiveStreamsToggle
}
.disabled(qualityProfiles.isEmpty)
Section(header: SettingsHeader(text: "Profiles"), footer: profilesFooter) {
Section(header: SettingsHeader(text: "Profiles".localized()), footer: profilesFooter) {
profilesList
Button {

View File

@@ -99,7 +99,7 @@ struct SettingsView: View {
.tag(Tabs.help)
}
.padding(20)
.frame(width: 520, height: windowHeight)
.frame(width: 600, height: windowHeight)
#else
NavigationView {
settingsList

View File

@@ -39,7 +39,7 @@ struct SponsorBlockSettings: View {
#endif
}
Section(header: SettingsHeader(text: "Categories to Skip"), footer: categoriesDetails) {
Section(header: SettingsHeader(text: "Categories to Skip".localized()), footer: categoriesDetails) {
#if os(macOS)
let list = ForEach(SponsorBlockAPI.categories, id: \.self) { category in
MultiselectRow(