Skip to content
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

The Localizer does not work with Desktop/Skia #16627

Closed
ArchieCoder opened this issue May 8, 2024 · 4 comments · Fixed by unoplatform/uno.extensions#2302
Closed

The Localizer does not work with Desktop/Skia #16627

ArchieCoder opened this issue May 8, 2024 · 4 comments · Fixed by unoplatform/uno.extensions#2302
Assignees
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@ArchieCoder
Copy link
Contributor

Current behavior

The localizer will return the string key as result

SelectedPageText = _localizer["stringkey"]

-> SelectedPageText's value will be "stringkey"

Expected behavior

Get the proper string value from the Resources.resw file

How to reproduce it (as minimally and precisely as possible)

1- Create a blank project
2- Add a string in Resources.resw
3- Retrieve the string value with the localizer["stringkey"]

Workaround

No response

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

No response

Affected platforms

Skia (Linux Framebuffer)

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@ArchieCoder ArchieCoder added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels May 8, 2024
@jeromelaban
Copy link
Member

May be a duplicate of #16353

@ArchieCoder
Copy link
Contributor Author

image

@stephenhauck
Copy link

stephenhauck commented May 13, 2024

The title kept getting set to the key name and not the value
image
The loaded resource is correct
image

This is your template code with the value simply changed ...
the variable tmp is set to the value "ApplicationName"
I feel like I'm missing something really simple here

I am building for iOS and Android only ...

This code ..
image

Yields this output ...
image

@szv
Copy link

szv commented May 19, 2024

Hi, I think I just had the same issue, when migrating to Uno 5.2.
For me using the IStringLocalizer just worked when building for Windows 10+ with WinAppSDK, but not for other platforms.
I replaced the usage of IStringLocalizer with ResourceLoader.GetForViewIndependentUse(), which fixed the problem for me. (https://platform.uno/docs/articles/guides/localization.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants