rjmg
Topic Author
Posts: 2
Joined: 20 Sep 2024, 10:08

Best practice for dynamic localised content

29 Oct 2026, 12:52

In my current project, we're looking to have dynamically updating localised text, which has caused some issues in certain ares and I'm not sure of the best practice to implement this. The simpler scenario is that a button's content will update based on certain game states, and both of those contents need to be localised. I could implement a duplicate button with the specific action and content, but I do wonder if there would be a way to update only the text and keep the button as is.

The more frustrating scenario is an item details that's taken from a compendium (with hundreds of items). Currently, the keys to the localised text for that item are stored in a configuration, which is then read and pushed to the code-behind that will call on the localisation object to retrieve the raw localised text to display on a single text block object. This works, however what's missing is the automatic update provided by the Noesis extension, as the compendium is created once and lives throughout the game cycle (since the data doesn't change). When the localisation source changes elsewhere in the game, the bound elements update but the dynamic text on the details panels do not.

What method should I look to implement? Can binding objects be dynamically applied? I have thought to create a content control in code with the content set to the binding provided by the Noesis extension using the resource key, though I haven't had any luck displaying that. The binding evaluates correctly, however the details panel displays "BindingExperssion" - I assume then it's trying to display the binding through .ToString() on the object.
 
User avatar
sfernandez
Site Admin
Posts: 3366
Joined: 22 Dec 2011, 19:20

Re: Best practice for dynamic localised content

30 Oct 2026, 12:44

For simple scenarios like the button you described, you can have the 2 localized contents in the template, and based on the game state show one or the other, but this is too specific and won't work everywhere.

So basically you should provide localized values directly from your viewmodel and use simple bindings to show the localized info. To do this your viewmodels would need access to some kind of global Localization system that provides the localized content, and an event to indicate when localization changes.
MyViewModel::MyViewModel()
{
  Localization::Instance()->Changed() += MakeDelegate(this, &MyViewModel::OnLocalizationChanged);
}
void MyViewModel::OnLocalizationChanged()
{
  NotifyPropertyChanged("Info");
}
const char* MyViewModel::GetInfo() const
{
  return Localization::Instance()->Get("INFO_KEY");
}
<TextBlock Text="{Binding Info}"/>
Is this what you're looking for?
 
rjmg
Topic Author
Posts: 2
Joined: 20 Sep 2024, 10:08

Re: Best practice for dynamic localised content

05 Nov 2026, 13:04

This should solve the issue, however I realise my initial message did not directly address the trouble with the Noesis Localisation extension which we are trying to leverage. Is there no way currently to handle dynamic text through the existing extension? Extending on the extension shouldn't be a problem however, I am only curious in case I have missed an approach that I should be implementing.
 
User avatar
sfernandez
Site Admin
Posts: 3366
Joined: 22 Dec 2011, 19:20

Re: Best practice for dynamic localised content

05 Nov 2026, 20:33

Our LocExtension only supports specifying a Key to search for a resource in the selected language ResourceDictionary, and there's no way to dynamically change that key, so you didn't miss anything.

Who is online

Users browsing this forum: Semrush [Bot] and 8 guests