From fe123c9dadf313ea0b944d1115f7c0b84cbe5443 Mon Sep 17 00:00:00 2001 From: Mathieu GROUSSEAU Date: Wed, 14 May 2025 11:34:34 +0200 Subject: [PATCH] Add translations string catalog --- App/App.xcodeproj/project.pbxproj | 5 + .../xcshareddata/xcschemes/App.xcscheme | 103 ++++++++++++++++++ App/App/Localizable.xcstrings | 23 ++++ App/App/View/ContentView.swift | 2 +- 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme create mode 100644 App/App/Localizable.xcstrings diff --git a/App/App.xcodeproj/project.pbxproj b/App/App.xcodeproj/project.pbxproj index 3bd36d7..5b7800f 100644 --- a/App/App.xcodeproj/project.pbxproj +++ b/App/App.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ F0F59E4A2DD4958800BE32D6 /* C4Persistance.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0F59E412DD492B400BE32D6 /* C4Persistance.xcframework */; }; F0F59E4B2DD4958800BE32D6 /* C4Players.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0F59E422DD492B400BE32D6 /* C4Players.xcframework */; }; F0F59E4C2DD4958800BE32D6 /* C4Rules.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0F59E442DD492B400BE32D6 /* C4Rules.xcframework */; }; + F0F59E4F2DD4996F00BE32D6 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = F0F59E4E2DD4996F00BE32D6 /* Localizable.xcstrings */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,6 +54,7 @@ F0F59E422DD492B400BE32D6 /* C4Players.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = C4Players.xcframework; path = ../precompiled/xcframeworks/C4Players.xcframework; sourceTree = ""; }; F0F59E432DD492B400BE32D6 /* C4.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = C4.xcframework; path = ../precompiled/xcframeworks/C4.xcframework; sourceTree = ""; }; F0F59E442DD492B400BE32D6 /* C4Rules.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = C4Rules.xcframework; path = ../precompiled/xcframeworks/C4Rules.xcframework; sourceTree = ""; }; + F0F59E4E2DD4996F00BE32D6 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; name = Localizable.xcstrings; path = App/Localizable.xcstrings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -87,6 +89,7 @@ F001A03F2DD48FAB00809561 = { isa = PBXGroup; children = ( + F0F59E4E2DD4996F00BE32D6 /* Localizable.xcstrings */, F001A04A2DD48FAB00809561 /* App */, F001A05C2DD48FAE00809561 /* AppTests */, F001A0662DD48FAE00809561 /* AppUITests */, @@ -247,6 +250,7 @@ knownRegions = ( en, Base, + fr, ); mainGroup = F001A03F2DD48FAB00809561; productRefGroup = F001A0492DD48FAB00809561 /* Products */; @@ -267,6 +271,7 @@ files = ( F001A0542DD48FAD00809561 /* Preview Assets.xcassets in Resources */, F001A0502DD48FAD00809561 /* Assets.xcassets in Resources */, + F0F59E4F2DD4996F00BE32D6 /* Localizable.xcstrings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme b/App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme new file mode 100644 index 0000000..eeefba3 --- /dev/null +++ b/App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/App/Localizable.xcstrings b/App/App/Localizable.xcstrings new file mode 100644 index 0000000..fa3bf14 --- /dev/null +++ b/App/App/Localizable.xcstrings @@ -0,0 +1,23 @@ +{ + "sourceLanguage" : "en", + "strings" : { + "genericAppName" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Connect 4" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Puissance 4" + } + } + } + } + }, + "version" : "1.0" +} \ No newline at end of file diff --git a/App/App/View/ContentView.swift b/App/App/View/ContentView.swift index 8264b30..28b7901 100644 --- a/App/App/View/ContentView.swift +++ b/App/App/View/ContentView.swift @@ -13,7 +13,7 @@ struct ContentView: View { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) - Text("Hello, world!") + Text(String(localized: "genericAppName")) } .padding() }