From d68da0d5bdadba8ca23b1d34b6ea4af1fce35596 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Fri, 3 Nov 2023 16:32:18 +0100 Subject: [PATCH] WIP - more tests --- .../Resources/ll10n/Localizable.xcstrings | 23 ++++++++++++++++--- Apps/LekaUpdater/Sources/Localization.swift | 4 ++-- .../View/ConnectionView/ConnectionView.swift | 1 + .../Sources/View/ContentView.swift | 4 ++-- .../RobotInformationView.swift | 1 + 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Apps/LekaUpdater/Resources/ll10n/Localizable.xcstrings b/Apps/LekaUpdater/Resources/ll10n/Localizable.xcstrings index f9b9e7fc4f..95069e281d 100644 --- a/Apps/LekaUpdater/Resources/ll10n/Localizable.xcstrings +++ b/Apps/LekaUpdater/Resources/ll10n/Localizable.xcstrings @@ -229,6 +229,23 @@ } } }, + "information.robot.serial_number" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "nouveau serial number %@" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "ROBOT SERIAL %@" + } + } + } + }, "Installation de la mise à jour" : { "localizations" : { "en" : { @@ -314,18 +331,18 @@ }, "main.app_name" : { "comment" : "Name of the application", - "extractionState" : "stale", + "extractionState" : "translated", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Leka Updater" + "value" : "Leka Updater ENGLISH" } }, "fr" : { "stringUnit" : { "state" : "translated", - "value" : "Leka Updater" + "value" : "Leka Updater FRANçAIS" } } } diff --git a/Apps/LekaUpdater/Sources/Localization.swift b/Apps/LekaUpdater/Sources/Localization.swift index d0074dd98b..5b5c4a2195 100644 --- a/Apps/LekaUpdater/Sources/Localization.swift +++ b/Apps/LekaUpdater/Sources/Localization.swift @@ -41,7 +41,7 @@ enum l10n { enum main { // static let appName = "main.app_name".localized(value: "Leka Updater", comment: "Name of the application") - static let appName = String.localized("main.app_name", value: "Leka Updater", comment: "Name of the application") + static let appName = String.localized("main.app_name", value: "Leka Updater FROM swift", comment: "Name of the application") static let appDescription = "main.app_description".localized(value: "The app to update your Leka robots!", comment: "Description of the application") } @@ -78,7 +78,7 @@ enum l10n { enum robot { - static var serialNumber = "information.robot.serial_number".localized(interpolation: "Serial Number: %@", comment: "Connected robot serial number") + static var serialNumber = "information.robot.serial_number".localized(interpolation: "Serial Number blablabla: %@", comment: "Connected robot serial number") static let battery = "information.robot.battery".localized(interpolation: "Battery: %@", comment: "Connected robot battery level") static let version = "information.robot.version".localized(interpolation: "Version: %@", comment: "Connected robot version") static let isCharging = "information.robot.charging_status".localized(interpolation: "Charging: %@", comment: "Connected robot charging status") diff --git a/Apps/LekaUpdater/Sources/View/ConnectionView/ConnectionView.swift b/Apps/LekaUpdater/Sources/View/ConnectionView/ConnectionView.swift index c5b07550c4..cd4a306066 100644 --- a/Apps/LekaUpdater/Sources/View/ConnectionView/ConnectionView.swift +++ b/Apps/LekaUpdater/Sources/View/ConnectionView/ConnectionView.swift @@ -15,6 +15,7 @@ struct ConnectionView: View { var body: some View { NavigationStack { VStack { + Text(l10n.main.appName) RobotConnectionView(robotConnectionViewModel: viewModel.robotConnectionViewModel) continueButton diff --git a/Apps/LekaUpdater/Sources/View/ContentView.swift b/Apps/LekaUpdater/Sources/View/ContentView.swift index 7ffb26e4cd..5e72c61d2e 100644 --- a/Apps/LekaUpdater/Sources/View/ContentView.swift +++ b/Apps/LekaUpdater/Sources/View/ContentView.swift @@ -24,8 +24,8 @@ struct ContentView: View { struct ContentView_Previews: PreviewProvider { static var previews: some View { - ContentView() - .environment(\.locale, .init(identifier: "en")) + // ContentView() + // .environment(\.locale, .init(identifier: "en")) ContentView() .environment(\.locale, .init(identifier: "fr")) } diff --git a/Apps/LekaUpdater/Sources/View/InformationView/RobotInformationView.swift b/Apps/LekaUpdater/Sources/View/InformationView/RobotInformationView.swift index 5146d69235..253dfb7bb9 100644 --- a/Apps/LekaUpdater/Sources/View/InformationView/RobotInformationView.swift +++ b/Apps/LekaUpdater/Sources/View/InformationView/RobotInformationView.swift @@ -53,5 +53,6 @@ struct RobotInformationView_Previews: PreviewProvider { } } } + .environment(\.locale, .init(identifier: "fr")) } }