Yes - i18n does work inside DataTemplates... BUT each template uses its DataContext as its TextSource
so you need to expose a mechanism to get to the individual items in your list to also expose the TextSource - just like the VMs do. ListItem wrapping techniques - like in https://stackoverflow.com/a/22696529/373321 may help with this.
MvvmCross - Does Localization work in DataTemplate?
-
23-06-2023 - |
Question
I'm developing a Win Store App with MvvmCross. I have some problems with internationalization technique when I have to apply it to a DataTemplate of a GridView or ListView. In these cases it seems it uses only the FallbackValue.
In the same view other TextBlocks are correctly translated, so I think that the Json file is ok. Here a sample of TextBlock that is not translated:
<TextBlock mvx:Bi.nd="Text TextSource, Converter=Language, ConverterParameter=Name, FallbackValue=TestName" />
Has someone already faced this problem?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow