Bug 56234 - Localization doesn't work
Summary: Localization doesn't work
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.5.0 (15.2)
Hardware: Macintosh Mac OS
: High blocker
Target Milestone: 15.3
Assignee: Emanuel
URL:
Depends on:
Blocks:
 
Reported: 2017-05-11 17:32 UTC by Alexandre Pepin
Modified: 2017-06-08 10:13 UTC (History)
11 users (show)

Tags: 15.2I
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project (36.12 KB, application/zip)
2017-05-11 17:32 UTC, Alexandre Pepin
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
VERIFIED FIXED

Description Alexandre Pepin 2017-05-11 17:32:14 UTC
# Steps to reproduce
I just upgraded to Xamarin 10.10 and the resources files are no longer localized correctly when changing the culture. See attached project

# Expected behavior
To print "en" then "fr"

# Actual behavior
Prints "en" then "en" again

# Test environment (full version information)
Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Professional

Visual Basic 2015   00322-40000-00000-AA258
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA258
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA258
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-40000-00000-AA258
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.18.00214.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1   14.1.20810.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.8.1   14.0.11123.0
Azure App Service Tools v2.8.1

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JustDecompile Tools   1.0
Makes JustDecompile functionality available in VIsual Studio. Requires JustDecompile installation.

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft .NET Core Tools (Preview 2)   14.1.20810.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PoxAutoRun   1.0
PoxAutoRun Visual Studio Package Detailed Info

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

tangible T4 Editor   2.3.0
tangible engineering GmbH

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Web Compiler   1.11.326
Compiler for LESS, Sass and CoffeeScript files

Web Essentials 2015.3   3.0.235
Adds many useful features to Visual Studio for web developers. Requires Visual Studio 2015

Xamarin   4.5.0.443 (c871575)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.3.0.13 (448f54f)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.10.0.30 (30b6e87)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Alexandre Pepin 2017-05-11 17:32:26 UTC
Created attachment 22094 [details]
Sample project
Comment 2 Timothy Risi 2017-05-11 21:31:40 UTC
The repro project works successfully for me on a mac (prints "en" then "ef" as the expected behavior describes), so looks like its probably an issue with Visual Studio
Comment 3 Michael W. 2017-05-16 14:38:49 UTC
@Timothy indeed, I could reproduce the error in visual studio as well. When I build on the mac everything behaves as expected.
Comment 4 vga 2017-05-18 13:16:04 UTC
Thank you for reporting this. We are currently investigating this and will keep you updated.
Comment 5 Alexandre Pepin 2017-06-02 13:32:22 UTC
Any update? We can't release an update to our app without a fix on this
Comment 6 xamarin-release-manager 2017-06-02 19:20:50 UTC
Fixed in version 4.6.0.221 (master)

Author: Emanuel
Commit: 94a6b858fc9d6d5443cf03ac0348d612dbb6eaf8 (xamarin/XamarinVS)
Comment 7 Emanuel 2017-06-02 19:22:47 UTC
Hi Alexandre,
I'm sorry you're facing this bug. We've already fixed it and it will be available on our next release. In the meantime, you can workaround it by following these steps:
1- On Windows, got to "C:\Program Files (x86)\MSBuild\Xamarin".
2- Open the Xamarin.Apple.Sdk.targets file in an editor with Administrator privileges.
3- Look for the CopyFilesToMacOutputDirectory target.
4- After the last _CopyFilesToMacOutput (line 95) add the following:
<_CopyFilesToMacOutput Include="@(EmbeddedResource -> '$(OutDir)%(Culture)\$(TargetName).resources.dll')" Condition="'%(EmbeddedResource.WithCulture)' == 'true'">
        <TargetPath>$(OutDir)%(EmbeddedResource.Culture)\$(TargetName).resources.dll</TargetPath>
      </_CopyFilesToMacOutput>

For anyone else interested on this workaround, in case you're using Visual Studio 2017 on step 1 you should go to "<VS installation folder>\MSBuild\Xamarin" (for instance "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Xamarin")

Thanks!
Comment 8 Pratik Lad 2017-06-07 09:22:32 UTC
Hello @Alexandre Pepin,
Can you provide proper steps or description with expectation for verify this bug.
Comment 9 Alexandre Pepin 2017-06-07 13:12:19 UTC
See my initial report and sample project. If you run the project, it is supposed to print "en" then "fr" in the console

I can confirm that the workaround works. Thanks!