samc
Topic Author
Posts: 94
Joined: 21 Aug 2019, 19:22

localization inside a resource dictionary

02 Oct 2023, 19:04

Hi,

We've been using the localization extension:

https://www.noesisengine.com/docs/App.A ... nsion.html

And so far it's been working well for us.

We did have one question - we haves several resource dictionaries declared in xaml (not user controls) that contain styling information, default buttons, and templates (for use in list controls). Many of these have strings we want to localize.

Is there a way to use loc extension in resource dictionaries like these? Or is there a recommendation on how best to make this work?

thanks,
sam
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: localization inside a resource dictionary

03 Oct 2023, 18:09

Hi Sam,

The use case will be to use the Loc extension in elements of a template, right?
<ControlTemplate x:Key="Button" TargetType="Button">
  <StackPanel>
    <TextBlock Text="{noesis:Loc BtnHeader}"/>
    <ContentPresenter/>
  </StackPanel>
</ControlTemplate>
Do you need to use the localization extension in any other context in a ResourceDictionary? I want to confirm we cover all the situations.
 
samc
Topic Author
Posts: 94
Joined: 21 Aug 2019, 19:22

Re: localization inside a resource dictionary

03 Oct 2023, 19:12

The other case where we're using it is in data templates. Here's a snipped example from our project:
    <DataTemplate x:Key="NetworkGroupEntryTemplate">
        <Grid x:Name="Root">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{noesis:Loc Members}" Style="{StaticResource Text.Body}"/>
                </StackPanel>
        </Grid>
    </DataTemplate>
I'll check with our designers to see if they can think of any other examples, but i think data template is the main one.

thanks,
sam
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: localization inside a resource dictionary

03 Oct 2023, 19:39

Ok, I did some tests and that scenario (using the loc extension inside templates - ControlTemplate or DataTemplate) is not supported with the current implementation.
Could you please report it in our bugtracker? We will provide a patch for you to try.

Who is online

Users browsing this forum: No registered users and 9 guests