Skip to content

Commit

Permalink
Release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Constantin Clerc committed Jan 14, 2024
1 parent b0d035b commit 6d9d9e9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Geranium.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = live.cclerc.geranium;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -911,7 +911,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = live.cclerc.geranium;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
48 changes: 48 additions & 0 deletions Geranium/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,41 @@ struct SettingsView: View {
@State var DebugStuff: Bool = false
@State var MinimCal: String = ""
@State var LocSimTries: String = ""
@State var localisation: String = {
if let languages = UserDefaults.standard.array(forKey: "AppleLanguages") as? [String],
let firstLanguage = languages.first {
return firstLanguage
} else {
return Locale.current.languageCode ?? "en"
}
}()
@StateObject private var appSettings = AppSettings()

let languageMapping: [String: String] = [
// i made catgpt work for me on this one
"ca": "Catalan",
"cs": "Czech",
"de": "German",
"el": "Greek",
"en": "English",
"es": "Spanish",
"es-419": "Spanish (Latin America)",
"fi": "Finnish",
"fr": "French",
"it": "Italian",
"ja": "Japanese",
"ko": "Korean",
"ru": "Russian",
"sk": "Slovak",
"sr": "Serbian",
"sv": "Swedish",
"vi": "Vietnamese",
"zh-Hans": "Chinese (Simplified)",
"zh-Hant": "Chinese (Traditional)",
]
var sortedLocalisalist: [String] {
Bundle.main.localizations.sorted()
}
var body: some View {
NavigationView {
List {
Expand All @@ -23,6 +57,20 @@ struct SettingsView: View {
}
}

Section(header: Label("App Language", systemImage: "magnifyingglass"), footer: Text("Here you can choose in what language you want the app to be. The app will automatically exit to apply changes ; feel free to launch it again.")) {
Picker("Language", selection: $localisation) {
ForEach(sortedLocalisalist, id: \.self) { abbreviation in
Text(languageMapping[abbreviation] ?? abbreviation)
.tag(abbreviation)
}
}
.onChange(of: localisation) { newValue in
UserDefaults.standard.set([newValue], forKey: "AppleLanguages")
exitGracefully()
}
}


Section(header: Label("Debug Stuff", systemImage: "chevron.left.forwardslash.chevron.right"), footer: Text("This setting allows you to see experimental values from some app variables.")) {
Toggle(isOn: $DebugStuff) {
Text("Debug Info")
Expand Down
9 changes: 9 additions & 0 deletions Geranium/Translations/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,9 @@
}
}
}
},
"App Language" : {

},
"Apps Leftover Caches" : {
"localizations" : {
Expand Down Expand Up @@ -3545,6 +3548,9 @@
}
}
}
},
"Here you can choose in what language you want the app to be. The app will automatically exit to apply changes ; feel free to launch it again." : {

},
"Hi ! SE 1 User" : {
"localizations" : {
Expand Down Expand Up @@ -4227,6 +4233,9 @@
}
}
}
},
"Language" : {

},
"Latitude: %lf Longitude: %lf" : {
"localizations" : {
Expand Down

0 comments on commit 6d9d9e9

Please sign in to comment.