-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Use Case
mobile health applications need to be able to provide their services to users from a range of regions and languages.
this requires localizing the resources used by the app.
for example, all text displayed in an app needs to be properly translated into the user's locale (i.e., language and region).
additionally, there might be non-textual resources used by an app that also need to be localized.
Problem
while e.g. iOS already covers localization for a range of aspects (e.g.: automatic selection of the correct translation of text/images displayed in-app, providing information about locale-specific versions of things like time formats, etc), most of this only works for resources statically bundled with the app.
applications that use dynamic resources (e.g., by fetching them from a server) cannot make use of iOS' localization APIs.
additionally, there are some things iOS currently doesn't expose localization info for (eg: locale-dependent preferred units).
Solution
we currently have multiple localization-related APIs spread across multiple Spezi packages:
- SpeziViews implements utilities for working with
LocalizedStringResourcevalues- eg: turning them into
Strings, etc
- eg: turning them into
- SpeziHealthKit provides information about locale-dependent preferred units
- e.g. for body weight, temperature, height, etc
- SpeziStudy implements an API for dynamically resolving the correct localization from a list of localized resources, based on locale suffizes
- eg: selecting
File+en-US.mdfromFile+en-US.md,File+es-US.md,File+en-UK.mdfor a user in the eu-US locale
- eg: selecting
these are the big ones we currently have; there are some smaller ones (e.g. locale-dependent paper size selection for PDF exporting in SpeziConsent, locale-dependent Firebase loading in MHC), and we'll surely run across additional such extensions going forward
Alternatives considered
we could keep the APIs spread across the different packages.
Additional context
the resulting package of consolidating all of the localization APIs would probably be on the smaller side, but it might still be worth doing this
Code of Conduct
- I agree to follow this project's Code of Conduct and Contributing Guidelines
Metadata
Metadata
Assignees
Labels
Type
Projects
Status