Reference Error in globalization

Hadi_AleidHadi_Aleid Member ✭✭
edited March 26 in Xamarin.Forms

Hello all

Please can anyone help me?

When I am trying to globalize my texts using this XAML code:

xmlns:translate="clr-namespace:MeatStore.Supports;assembly=LocalizationSample"

 x:Class="MeatStore.Views.Onboarding">

        <StackLayout>

                <Label Text="{translate:Translate MeatSore}" />

        </StackLayout>

</ContentPage>

Error apears:

Severity Code Description Project File Line Suppression State
Error XLS0414 The type 'translate:Translate' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies >have been built. MeatStore.Android Onboarding.xaml 11

and

Failed to resolve assembly: 'LocalizationSample, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' MeatStore.UWP

I am using Xamarin.form Shared Project in VS Enterprize

What is wrong with my code?

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    The error message is obvious , the compiler can't find the assembly named LocalizationSample in namespace MeatStore.Supports . Could you check this with your project ?

  • Hadi_AleidHadi_Aleid Member ✭✭
    edited March 27

    @ColeX said:
    The error message is obvious , the compiler can't find the assembly named LocalizationSample in namespace MeatStore.Supports . Could you check this with your project ?

    Sorry because I am new to Xamarin.

    What a assembly should I use to globolize the texts?

    and what shoud I write instead of this?
    xmlns:translate="clr-namespace:MeatStore.Supports;assembly=MeatStore"

  • ColeXColeX Member, Xamarin Team Xamurai

    It shoule be

    xmlns:translate="clr-namespace:MeatStore.Supports;assembly=MeatStore.Supports" 
    
    <Label Text="{translate:TranslateExtension Text = MeatStore}"  
    
  • Hadi_AleidHadi_Aleid Member ✭✭

    Thank you so much,

    I have used:

    xmlns:translate1="clr-namespace:MeatStore.Supports"
    <Label Text="{translate1:TranslateExtension Text = MeatStore}" 
    

    It compiled now. However, it gives me an exception:

    System.Resources.MissingManifestResourceException
    HResult=0x80131532
    Message=Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "MeatStore.Resources.AppResources.resources" was correctly embedded or linked into assembly "MeatStore.UWP" at compile time, or that all the satellite assemblies required are loadable and fully signed.
    Source=System.Private.CoreLib

    You can download the edited project from:
    https://tltechsa-my.sharepoint.com/:f:/g/personal/hadi_ltechpro_com/EoJD1_pfPJxNi8izySN9mPkBOfFYXK1b0kMKRYtJw0JPwQ?e=t6Zaqs

Sign In or Register to comment.