Skip to content

Localization Module #102

@lukaskollmer

Description

@lukaskollmer

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 LocalizedStringResource values
    • eg: turning them into Strings, etc
  • 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.md from File+en-US.md, File+es-US.md, File+en-UK.md for a user in the eu-US locale

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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions