Avalonia localization #7131
Replies: 5 comments 3 replies
-
WPF always had sub-par localization compared to WinForms and UWP. What would it take to add an x:UID and resources system like in UWP to Avalonia? This would be the best way to do it in my opinion. |
Beta Was this translation helpful? Give feedback.
-
You can use something like https://github.com/DotNetPlus/ReswPlus Upd: it seems like ReswPlus doesn't support resx, but only resw files. So UWP only sadly. |
Beta Was this translation helpful? Give feedback.
-
@MelnikovDaniil , take a look over at #3139 where @braca shows an example of one method of localizing that was done in the WPF days -- writing your own markup extension as @Tirraon was saying.
|
Beta Was this translation helpful? Give feedback.
-
@maxkatz6 Here is another issue that can be moved to discussions now. In UWP I've gotten quite used to x:Uid based localization which is similar to what was done originally with Windows Forms. However, I've increasingly noticed a trend towards localization using XAML markup extensions as I mentioned above. Some points:
Really the only downside with markup extension based localization is it doesn't support all the property types that are not string. It's sometimes necessary to localize widths or margins for example. In practice most controls and layouts adjust perfectly fine to different text lengths though. In a decently-sized app I have never needed to localize anything other than text. Overall, I am strongly considering moving my app over to this localization technique. I wonder if perhaps Avalonia should have a built-in extension to support this out of the box. |
Beta Was this translation helpful? Give feedback.
-
take a look at https://www.codeproject.com/Articles/5317972/Theming-and-Localization-Functionality-for-Multipl |
Beta Was this translation helpful? Give feedback.
-
What features does Avalonia have for localizing applications?
Beta Was this translation helpful? Give feedback.
All reactions