I am trying to use .resx files for localization in xamarin.mac
Inside AppDelegate I changed current culture of the thread :
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo ("ru");
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo ("ru");
also I have two resource files inside my app:
But strings are always shown from the default resource file... Any solution?
I also use native language change, here is whole AppDelegate constructor :
public AppDelegate ()
{
string [] lang = { "ru", "en" };
NSUserDefaults.StandardUserDefaults.SetValueForKey (NSArray.FromObjects (lang), (Foundation.NSString)"AppleLanguages");
NSUserDefaults.StandardUserDefaults.Synchronize ();
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo ("ru");
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo ("ru");
Resources.Culture = GetCurrentCultureInfo ();
}
BTW , xamarin studio 6.1.1 (build 15) doesn't allow me to add resource.ru.resx if I have resource.ru in my project , kinda bug !
I have created resource-ru.resx file and than renamed it .