android - Arabic strings not displaying in Xamarin Forms app -
i using resx approach localized resources in xamarin forms app, localizer class below, , 3 resource files (default en-us, es, ar).

when android device setting language spanish, appropriate translated string displayed, when device setting arabic, default string displayed. have set attribute android:supportsrtl:"true" in app manifest, , targeting android 4.2 or higher.
what missing?
public class localizer { #region constructors public localizer() { refreshlocale(); this.resources = new resourcemanager("myapp.resx.appresources", typeof(localizer).gettypeinfo().assembly); } #endregion constructors #region methods public void refreshlocale() { this.locale = dependencyservice.get<ilocale>().getcurrent(); } public string localize(string key) { return this.resources.getstring(key, new cultureinfo(this.locale)); } #endregion methods #region properties public string locale { get; private set; } private resourcemanager resources; #endregion properties }
oh duh, bitten again. build action set none arabic resource file appresources.ar.resx. appears default xamarin studio behavior when adding files filetype. changed build action embeddedresource, rebuilt , deployed, , works expected.
Comments
Post a Comment