[Feature] Markup Extension for Resource string localization #4647
Replies: 4 comments
-
Hello, 'HerrickSpencer! Thanks for submitting a new feature request. I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future! |
Beta Was this translation helpful? Give feedback.
-
Thanks, @HerrickSpencer! The feature seems interesting. Let's see what other community members think about this one. |
Beta Was this translation helpful? Give feedback.
-
I tried this method on WinUI3 (Project Reunion 0.8-rc) with Uno Platform (v2.4.0). |
Beta Was this translation helpful? Give feedback.
-
thanks for the information @jaldinger ! |
Beta Was this translation helpful? Give feedback.
-
Describe the problem this feature would solve
Microsoft's current documentation shows examples of how to globalize your UI facing strings in UWP/WPF XAML by using the Uid as a lookup in an included resx file. This technique works great, but does have some limitations. There is another way of using a custom markup extension to keep the UI development agile, as well as reduce globalization costs when redesigning UI.
Commonly used resources technique:
Using the markup extension:
This method reduces friction in globalization efforts and translation when there are UI redesigns. Because the developer will not be tied to a Uid, they can reuse the already translated strings in resources by referencing the string name instead. It also allows one string to be used for multiple controls without the problem of duplicating the Uid.
Describe the solution
The
ResourceString
code example would look like this:Where it would live in the code base is with the other markup extensions
Describe alternatives you've considered
Using the Uid, but it has issues as detailed above.
Additional context & Screenshots
Beta Was this translation helpful? Give feedback.
All reactions