New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTL-820: LanguageService translation works only for the last element if used in a DataTemplate #813

Closed
GeertvanHorrik opened this Issue Jan 13, 2016 · 3 comments

Comments

Projects
None yet
1 participant
@GeertvanHorrik
Member

GeertvanHorrik commented Jan 13, 2016

Jira issue originally created by user Andreas:

Setting the preferred culture in the LanguageService will update only the last element of an ItemsControl list if the content is bound in a DataTemplate.

In the following example only the fourth entry will be updated to the new preferred culture.

        <ItemsControl>
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Label Content="{catel:LanguageBinding Entry}" />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <system:String>First Entry</system:String>
            <system:String>Second Entry</system:String>
            <system:String>Third Entry</system:String>
            <system:String>Fourth Entry</system:String>
        </ItemsControl>
@GeertvanHorrik

This comment has been minimized.

Show comment
Hide comment
@GeertvanHorrik

GeertvanHorrik Jan 13, 2016

Member

Comment created by @GeertvanHorrik:

I think this is caused by the DataTemplates. We had a similar question in the past, need to look it up. I remember it was caused by using templates.

Member

GeertvanHorrik commented Jan 13, 2016

Comment created by @GeertvanHorrik:

I think this is caused by the DataTemplates. We had a similar question in the past, need to look it up. I remember it was caused by using templates.

@GeertvanHorrik

This comment has been minimized.

Show comment
Hide comment
@GeertvanHorrik

GeertvanHorrik Sep 15, 2016

Member

Comment created by Andreas:

A workaround has been found for this. The language is being changed if the content of the DataTemplate tag is in its own UserControl. [^ChangeLanguageBugWorkaround.zip]

        <ItemsControl>
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <views:Item />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <system:String>First Entry</system:String>
            <system:String>Second Entry</system:String>
            <system:String>Third Entry</system:String>
            <system:String>Fourth Entry</system:String>
        </ItemsControl>
Member

GeertvanHorrik commented Sep 15, 2016

Comment created by Andreas:

A workaround has been found for this. The language is being changed if the content of the DataTemplate tag is in its own UserControl. [^ChangeLanguageBugWorkaround.zip]

        <ItemsControl>
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <views:Item />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <system:String>First Entry</system:String>
            <system:String>Second Entry</system:String>
            <system:String>Third Entry</system:String>
            <system:String>Fourth Entry</system:String>
        </ItemsControl>

@GeertvanHorrik GeertvanHorrik added the bug label Apr 12, 2017

@GeertvanHorrik GeertvanHorrik self-assigned this Apr 12, 2017

@GeertvanHorrik GeertvanHorrik added this to the Up for grabs milestone May 31, 2017

@GeertvanHorrik

This comment has been minimized.

Show comment
Hide comment
@GeertvanHorrik

GeertvanHorrik Jan 25, 2018

Member

Closing since we never encountered this ourselves. Feel free to re-open if this occurs to you.

Member

GeertvanHorrik commented Jan 25, 2018

Closing since we never encountered this ourselves. Feel free to re-open if this occurs to you.

@GeertvanHorrik GeertvanHorrik removed this from the Up for grabs milestone Jan 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment