Bug 43324 - Localize... Button Throws an Error for Xamarin.Mac
Summary: Localize... Button Throws an Error for Xamarin.Mac
Status: RESOLVED DUPLICATE of bug 44630
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Other ()
Version: Master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-08-12 21:31 UTC by Sparksteam
Modified: 2016-10-11 15:14 UTC (History)
2 users (show)

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

screen capture of error message (76.70 KB, image/png)
2016-08-12 21:43 UTC, Sparksteam
Sample Project (346.52 KB, application/zip)
2016-08-15 17:17 UTC, Sparksteam
Another Test Localization Project (365.89 KB, application/zip)
2016-08-18 16:27 UTC, Sparksteam
Error Message Again (343.34 KB, application/zip)
2016-08-18 18:06 UTC, Sparksteam
No Source Control (32.00 KB, image/png)
2016-08-19 16:06 UTC, Sparksteam
Under Source Control (85.64 KB, image/png)
2016-08-19 16:07 UTC, Sparksteam

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 or GitHub 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:

Description Sparksteam 2016-08-12 21:31:45 UTC

Comment 1 Sparksteam 2016-08-12 21:43:58 UTC
Created attachment 17013 [details]
screen capture of error message

Error message upon Localization attempt.
Comment 2 Sparksteam 2016-08-12 21:47:52 UTC
Following the instructions in https://developer.xamarin.com/guides/ios/advanced_topics/localization_and_internationalization/ to localize a Tamarin.Mac app.

Trying to localize Main.storyboard by selecting Localize in the Localization section of the File inspector just produces the attached error message.
Comment 3 Sparksteam 2016-08-12 22:08:20 UTC
it would be good if there was a step-by-step guide for Xamarin Studio/XCode to localize a storyboard as well as strings that would be retrieved programmatically. 

Also, is there a way to produce one "strings" file per language per platform? Is it possible to use localized UWP .resw or .resx files in other platforms?
Comment 4 Sparksteam 2016-08-15 17:17:14 UTC
Created attachment 17033 [details]
Sample Project

I've attached a sample project with my attempts to manually build the necessary localization files, working around that Localize... error. For both "Base" and "da" there are .strings files.

1. Localizable.strings - miscellaneous strings.
2. Main.strings - localization for a single UI element.
3. InfoPlist.strings - localize the Copyright.

With #1 above, I can use NSBundle.MainBundle.LocalizedString() in code to successfully get the localized string. But #2 and #3 are not being honored.

I created those files based on that Xamarin iOS documentation as well as a couple of other sources.

Just another datapoint.
Comment 5 Sparksteam 2016-08-15 18:39:11 UTC
I added the missing semi-colons to the InfoPlist.strings files and now the localized Copyright strings are showing up. So just the Main.strings is not working for this workaround.

Of course the original error when Localizing... the Main.storyboard is still the main problem, so to speak.

Comment 6 Chris Hamons 2016-08-18 15:15:08 UTC
Hmm. I was able to open the storyboard project and click localization without error on my end.

Can you attach the following:

Xcode Version
Xamarin Studio / Xamarin.Mac version

Detailed step by step instructions (so I click things the way you do) or video.
Comment 7 Sparksteam 2016-08-18 16:26:26 UTC
Sorry Chris, I'm not sure what's up with that project I sent because I attempted to build another, simpler project and it Localized ok. However, when I added Italian (it) and changed the OS language to Italian, the Italian strings did not display. I've attached this new project.

Xamarin Studio - 6.0.2 (build 73)
Xamarin.Mac - not sure, but I assume 6.0.2
XCode - 7.3.1 (7D1014)

Here are the steps I took...

1. Create a Mac Cocoa App
2. Edit info.plist by adding CFBundleLocalizations. "en" was already there so I just added "it".
3. Open the SB and added 2 labels. Exit and run is ok.
4. Open the SB, selected the SB and hit "Localize...". No error so ok.
5. Selected the project in Xcode and in the Localizations section, added the Italian language and checked the Use Base Internationalization. Exit and run is ok.
6. Open the SB, selected the new Main.storyboard, and in the File Inspector's Localization section, converted the Italian from "Interface Builder" to "localizable Strings". This generated a Main.strings file under it.lproj folder.
7. Edited that Main.strings file by changing the titles of the 2 labels.
8. Changed the OS language to Italian.
9. Running the app still shows the labels in English.

What do you think? Meanwhile, I will try to rebuild that original project again and verify there aren't any errors when localizing.

Comment 8 Sparksteam 2016-08-18 16:27:46 UTC
Created attachment 17102 [details]
Another Test Localization Project

Doesn't show localized UI strings.
Comment 9 Sparksteam 2016-08-18 18:02:29 UTC
Hey Chris - I'm getting the error again while rebuilding the original project from scratch. So following the steps in my previous post, 

On step 3 I added the ComboBox, 2 labels, and the Button. I trimmed down the AppBar, and added the Outlets and Actions. In the ViewController I added an override for ViewDidAppear() and populated the ComboBox, and added handlers for the cmbItemChanged and btnQuit Actions. In the AppDelegate I added an override for 		 ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender) and returned true.

On step 4, I get that error again about it not being under source control.

I will attach this project as well.
Comment 10 Sparksteam 2016-08-18 18:06:07 UTC
Created attachment 17106 [details]
Error Message Again

A rebuild of the original, but in Italian this time.
Comment 11 Sparksteam 2016-08-19 16:04:18 UTC
Chris - I tried doing a bunch of Mac App creations to try to get more data-points and I think I found a connection.

If I create a new solution from scratch, just open up the SB and hit "Localize...", there's no problem.

If I add a new project to that solution, open up the SB and hot "Localize...", also there's no problem.


If I add a new project to an exiting solution which is under version control, I get the error on "Localize..."

See the 2 attached images of the File Inspector's Source Control section for the storyboards
Comment 12 Sparksteam 2016-08-19 16:06:02 UTC
Created attachment 17125 [details]
No Source Control

New solution not under version control.
Comment 13 Sparksteam 2016-08-19 16:07:12 UTC
Created attachment 17126 [details]
Under Source Control

A new empty project added to an existing solution which is under version control.
Comment 14 Sparksteam 2016-08-19 16:29:59 UTC
But aside from this "Localize..." error, even without the error, the localized Main.strings are not displaying when the OS Language is set appropriately.
Comment 15 Chris Hamons 2016-09-12 16:57:15 UTC
Reports attached ^.
Comment 16 Sparksteam 2016-09-22 16:20:17 UTC
My System Information

=== Xamarin Studio Community ===

Version 6.1 (build 5441)
Installation UUID: 036dad07-9860-4965-94a9-aa8abd5b8698
	Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406000245

=== NuGet ===


=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.3.1 (10188.1)
Build 7D1014

=== Xamarin.Mac ===

Version: (Xamarin Studio Community)

=== Xamarin.Android ===

Version: (Xamarin Studio Community)
Android SDK: /Users/hpadmin/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)

SDK Tools Version: 25.1.2
SDK Platform Tools Version: 24.0.0
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:

=== Xamarin Android Player ===

Not Installed

=== Xamarin.iOS ===

Version: (Xamarin Studio Community)
Hash: 6c3fee4
Branch: xcode8
Build date: 2016-09-09 13:01:32-0400

=== Build Information ===

Release ID: 601005441
Git revision: 68292d1ab289911c815ddc715dd7cc29a9752f9f
Build date: 2016-09-09 04:43:23-04
Xamarin addins: ed25d008672663eeb9db55f1ccecb3c24d2fd3b2
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.11.6
Darwin hpadmins-Mini.sdg.rd.hpicorp.net 15.6.0 Darwin Kernel Version 15.6.0
    Mon Aug 29 20:21:34 PDT 2016
    root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64
Comment 17 Chris Hamons 2016-10-11 15:14:09 UTC
I believe I can now close this as a duplicate of 


In it, i've reproduced the localize button causing strange xcode projects to be generated for XI as well as XM.

Please reopen a new bug with specific details if there are additional issues beyond 44630's scope. Parsing this bug has become a bit difficult.
Comment 18 Chris Hamons 2016-10-11 15:14:15 UTC

*** This bug has been marked as a duplicate of bug 44630 ***