Skip to content

[iOS] Threading issues with changing locale at runtime #818

Open
@hasancanakgunduz

Description

@hasancanakgunduz

I have the following function in commonMain, which I call from my iOS project:

fun setLocale(languageCode: String) {
    StringDesc.localeType = StringDesc.LocaleType.Custom(languageCode)
}

If I don’t run it on the main thread, it is ignored. The README does not mention this, so I wanted to confirm.

Another issue is that; after changing the locale, all subsequent localized() calls must also be made on the main thread to obtain the strings in the newly selected locale; otherwise, the English (base) string is returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions