Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
This repository was archived by the owner on May 15, 2024. It is now read-only.

[Enhancement] Add DeviceInfo.CurrentCulture to get language currently selected on device #1762

@maxkoshevoi

Description

@maxkoshevoi

Hi, I initially created the issue and PR, but I think it would fit better in essentials.
Would you accept such feature here? If so, I'll retarget that PR to here.

Summary

If user changes device language while app is running, CultureInfo.CurrentCulture and other ways to see current culture won't be updated, and continue to return device language that was set during app start.

API Changes

  • CultureInfo DeviceInfo.CurrentCulture { get; }

Intended Use Case

Get language currently selected on device for app localization:

protected override void OnStart()
{
    LocalizationResourceManager.Current.CurrentCulture = DeviceInfo.CurrentCulture;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions