Forum Xamarin.iOS

internationalization xamarin mac appllication

NinineaNininea USUniversity ✭✭✭

It there anyone who implemented internationalization and localization in xamarin.mac application...

I have so many problems to do this , posted several question in stackoverflow :

Generally, I followed some tutorials for cocoa mac , but it seems that doesn't work in xamarin , for example, I implemented following example :

but no result .


  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    You might be running into this bug:

    Where if you use resx localization, we are not copying in the generated localized resources into the bundle.

    Which you can work around with:

    If you aren't using resx files, could you attach a small example showing what you are doing.

  • The xamarin mac docs do not have much on this subject BUT is works mostly the same as Xamarin.IOS localization:

    I use only Localizable.strings files and assign everything in code.

    Also I have my own utility function for translations that falls back to english if a string is not translated in the current language:

        static NSBundle LocStrFallbackBundle;
            public static string LocStr(string key, string comment = "")
                string result = NSBundle.MainBundle.LocalizedString (key, "#NOTFOUND#", null);
                if (result == null || result == "#NOTFOUND#")
                    if (LocStrFallbackBundle == null)
                        LocStrFallbackBundle = NSBundle.FromPath (NSBundle.MainBundle.PathForResource ("en", "lproj"));
                    result = LocStrFallbackBundle.LocalizedString (key, null, null);
                if (result == null)
                    result = key;
                return result;
  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Yep, it's almost the same as XI. Almost all of the docs apply.

    The only issue they might be hitting is the secondary assemblies not being copied into the app bundle (XI does not have that bug currently).

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    So there have been multiple people lately who's run into trouble with localization, so I burned some time today and write a sample.

    It hasn't landed in mac-samples yet, but you can get it from

    It uses both resx and storyboard strings localization to translate a few items. Hopefully it'll be helpful.

Sign In or Register to comment.