I have images that I would like to show within a CustomMessageBox
, that have text within them, based upon the user's current language settings on their device. I do not want to make the mistake of showing a user an image with a language they would not understand or recognize. I realized that there are two options within System.Globalization
, CurrentCulture
and CurrentUICulture
. I want to be sure that I am showing the correct image to the user depending on what they would expect to see. I'm not sure which to use, and the specific differences. I know a user can have a culture set, and a different UI culture set.
C#
//string resourceLanguage = System.Globalization.CultureInfo.CurrentCulture.ToString();
string resourceLanguage = System.Globalization.CultureInfo.CurrentUICulture.ToString();
string imagePath = "Assets/Screenshots/" + resourceLanguage + "/" + Constants.inAppScreenshot + ".png";
CustomMessageBoxContent cmbc = new CustomMessageBoxContent(); //a custom class I defined to handle the image
CustomMessageBox messageBox = new CustomMessageBox()
{
Caption = "\n" + AppResources.App_Caption,
Message = "\n" + AppResources.App_Message + "\n",
LeftButtonContent = AppResources.App_OK,
Content = cmbc.CreateImage(imagePath),
FlowDirection = App.flow
};
...