-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Stale Localizations and Standardize Keys with Underscores #62
Comments
We have generally moved to use the non uppercase/underscore variants in the Spezi Packages & Apps to make the localization catalogues easier to understand. I would only aim to use them in exceptions where we have longer strings that continuously change such as prompts in LLMonFHIR or larger multiline text. |
Interesting, and good to know 👍 I mean, string literals can be error-prone during runtime. The same applies to the uppercase ones with underscores, though in this case, mistakes might be more noticeable. |
Perhaps it’s worth considering auto-generating these localized strings in code? |
I am not sure if I completely understood the comment, but as far as I see we should use Localization Catalogues and use an automatic extraction of strings anyways. Normally Xcode should warn us if a string is stale and should automatically extract new stings if we use |
I'm concerned about typos that might go unnoticed. Instead of using string literals as localizable keys, we can auto-generate (with a script or a something like this) these localizations as stored properties within an enum. WDYT? Going from this: private var openAISettings: some View {
Section("SETTINGS_OPENAI") {
NavigationLink(value: SettingsDestinations.openAIKey) {
Text("SETTINGS_OPENAI_KEY")
}
...
}
} To this: private var openAISettings: some View {
Section(.settings.openai) {
NavigationLink(value: SettingsDestinations.openAIKey) {
Text(.settings.openaiKey)
}
...
}
} |
Apple seems to have moved the other direction with their automatic extraction in Nevertheless, I like the idea of using some more type-safe elements. I think they are working on |
Problem
Localizable.strings
Solution
Localizable.strings
to clear Xcode warnings and improve maintainability.Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: