Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Defining language does not work properly

$
0
0

Hi all of you,

In my WPF project I've got two RESX files, one is MasterGIT.en.resx and the another one is MasterGIT.resx.

They have got label either spanish or english (ContextualClientes and ContextualVehiculos)

Code-behind of the view affected:

    Public Sub New()

        Me.InitializeComponent()

        CultureManager.UICulture = New CultureInfo("es")
.
.
.


This is my XAML, where you can see "GIT_CuadroMando.MasterGIT" as the default RESX...

<Window  ResxExtension.DefaultResxName="GIT_CuadroMando.MasterGIT" Language="{UICulture}"

    <Window.Resources>
        <ResourceDictionary>

            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Assets/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

    </Window.Resources>

..

..

<ContextMenu><MenuItem Name="Contextual_Clientes" Header="{Resx _ContextualClientes}"><MenuItem.Icon><Image Source="/Imagenes/clientes.png" Height="20" Width="20"/></MenuItem.Icon></MenuItem><MenuItem Name="Contextual_Vehiculos" Header="{Resx _ContextualVehiculos}"><MenuItem.Icon><Image Source="/Imagenes/ferrari.ico" Height="20" Width="20"/></MenuItem.Icon>


When I run my app in my contextual menu I see this:


Nevertheless, when I choose in my Menu the language option I can see perfectly the language:

 'Selección de idioma: ESPAÑOL
    Private Sub Español_MouseEnter(sender As Object, e As MouseEventArgs) Handles Español.MouseEnter
        Me.Ingles.Opacity = 0.3
        Me.Español.Opacity = 1
        CultureManager.UICulture = New CultureInfo("es")
    End Sub
    'Selección de idioma: INGLÉS
    Private Sub Ingles_MouseEnter(sender As Object, e As MouseEventArgs) Handles Ingles.MouseEnter
        Me.Ingles.Opacity = 1
        Me.Español.Opacity = 0.3
        CultureManager.UICulture = New CultureInfo("en")
    End Sub

What is happening when I run my APP, why ain't I seeing #variable instead of the correct content?

Thanks for your advices,


Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF and SilverLight stuff


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>