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

@@ -227,7 +227,8 @@ struct ControlsBar: View {
}
VStack(alignment: .leading, spacing: 0) {
Text(model.currentVideo?.title ?? "Not Playing")
let notPlaying = "Not Playing".localized()
Text(model.currentVideo?.title ?? notPlaying)
.font(.system(size: 14))
.fontWeight(.semibold)
.foregroundColor(model.currentVideo.isNil ? .secondary : .accentColor)

View File

@@ -89,13 +89,19 @@ struct ShareButton: View {
}
private func labelForShareURL(_ app: String, withTime: Bool = false) -> String {
let time = withTime ? "with time" : ""
#if os(macOS)
return "Copy \(app) link \(time)"
#else
return "Share \(app) link \(time)"
#endif
if withTime {
#if os(macOS)
return String(format: "Copy %@ link with time".localized(), app)
#else
return String(format: "Share %@ link with time".localized(), app)
#endif
} else {
#if os(macOS)
return String(format: "Copy %@ link".localized(), app)
#else
return String(format: "Share %@ link".localized(), app)
#endif
}
}
}

View File

@@ -16,7 +16,7 @@ struct SubscriptionsView: View {
var body: some View {
BrowserPlayerControls {
SignInRequiredView(title: "Subscriptions") {
SignInRequiredView(title: "Subscriptions".localized()) {
VerticalCells(items: videos)
.onAppear {
loadResources()

View File

@@ -112,14 +112,15 @@ struct VideoContextMenuView: View {
private var watchedAtString: String? {
if watchingNow {
return "Watching now"
return "Watching now".localized()
}
if let watch = watch, let watchedAtString = watch.watchedAtString {
if watchedAtString == "in 0 seconds" {
return "Just watched"
return "Just watched".localized()
}
return "Watched \(watchedAtString)"
let localizedWatchedString = "Watched %@".localized()
return String(format: localizedWatchedString, watchedAtString)
}
return nil

View File

@@ -61,8 +61,8 @@ struct WelcomeScreen: View {
.background(RoundedRectangle(cornerRadius: 4).foregroundColor(Color.accentColor))
.frame(maxWidth: .infinity)
#endif
Text("This information will be processed only on your device and used to connect you to the server in the specified country.\n" +
"It can be changed later in settings. You can use your own locations too.")
Text("This information will be processed only on your device and used to connect you to the server in the specified country.".localized() + "\n" +
"It can be changed later in settings. You can use your own locations too.".localized())
.font(.caption)
.foregroundColor(.secondary)
}