Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
The resource strings does not load from localised resource files (resx), when using Visual studio for iOS
If you set `Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("de-DE");` it's expected that resources to be loaded from Resources.de.resx file. But always english resources are used in the app.
It works as expected when using Xamarin Studio for development.
It might be a problem with satellite assemblies not being copied to the build server.
What additional info do you need?
Daniel, I think it would be great if you could attach a simple sample project which fails to work for you. That way Jose will be able to fix the issue much faster.
Created attachment 3624 [details]
I thought that info flows through internal channels - I attached a full repro to my support request to Prashant. Nevertheless, please find attached my sample project. Below is the support request I sent:
Localization of resource files in Visual Studio:
No matter what the CurrentUICulture is, the App always uses the string from the default resource file.
Please find attached a small solution that contains two projects:
1. An iOS project that has two resx files and a view controller that tries to use the German resource but it always displays the English text.
2. A console project that has the same resx files and performs the same action as the iOS project. It correctly uses the German text.
As Prashant wrote in the bug request: Running this project from within XS on the Mac produces the expected result but running it from within VS on Windows doesn't.
TESTING NOTES: (with Daniel's Reproduction attached solution)
Besides of the DE resources I have been trying this commit out with more than one resources. In my case I tested locally both DE (German) and ES (Spanish) cultures. All the satellites assemblies are being grabbed and uploaded to Mac build host. By executing the app in the emulator I can observe the String localized string being displayed successfully.
It looks like the test case for this bug (the `ResourceTest1` project) has gone back to displaying "Hello world" when compiled using Visual Studio in the recent versions of XamarinVS.iOS,
Tested in XamarinVS.iOS versions:
In my testing, I noticed that I had to manually delete the app off the phone in order to ensure consistent results. For example, if I ran the app using Xamarin Studio, and then cleaned, rebuilt, and ran the app from Visual Studio, it would still show the correct "Hallo Welt" text. But if I then deleted the app from the phone, and redeployed from VS, it would show "Hello world".
Created attachment 6001 [details]
Additional test case, using PCL
Here's an additional test case that I think shows the same problem. In this solution, the resource files are contained in a PCL rather than in the app project itself.
When built and run from Xamarin Studio, the project shows the following in the console output:
> Hello Hola
With Visual Studio, the console output instead shows:
> Hello Hello
I have checked this issue with following builds:
Xamarin for VS 2.0.19(X.iOS 2.0.19)
X.iOS on Mac 220.127.116.11
I have tried this Issue with attached project and I am still seeing text in English for iOS application using VS. This is screencast for the same: http://www.screencast.com/t/X0fb2mbqAv. However this is working using Xamarin Studio.
Hence reopening this issue
Just cherry-picked the commits to the mtvs-2.0 branch:
I have checked this Issue with following builds:
Xamarin for Windows 2.0.74
I am still getting text in English using VS. This is the screencast for the same: http://www.screencast.com/t/97jkKEwb91U
Hence reopening this this
I have the same problem with my project. If I execute with Xamarin Studio on the Mac, the texts are localized, but if i execute with Visual Studio, the texts are all in english.
Visual Studio 2012 with Xamarin.iOS 1.12.275.0
With VS when attached Project 'ResourceTest' is built and run, project shows text 'Hello Welt' and 'de-DE'
With VS when attached project Case59588 is built and run, project shows text 'Hello Hola' in console output.
Xamarin 18.104.22.168 (172e5c004e0ff647f7bd378ab5298508e97c84cd)