Bug 26734 - Mono framework on alpha channel breaks translations (amongst other things)
Summary: Mono framework on alpha channel breaks translations (amongst other things)
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: XI 8.6.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-02-04 10:31 UTC by Paul Johnson
Modified: 2016-05-26 21:26 UTC (History)
4 users (show)

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

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 Paul Johnson 2015-02-04 10:31:44 UTC
Found a couple of problems with the alpha channel release on the mono framework (version

Bug 1.

Prior to the update on the alpha channel of the mono framework (version ) the following worked fine for localisation

(in AppDelegate.cs)

        private bool createLB()
            bool retVal = false;
            string resourcePath = NSBundle.MainBundle.PathForResource(NSLocale.PreferredLanguages[0], "lproj");
            if (string.IsNullOrEmpty(resourcePath))
                resourcePath = NSBundle.MainBundle.PathForResource("en", "lproj");
                retVal = true;
            LB = NSBundle.FromPath(resourcePath);
            return retVal;

        public NSBundle LB
            private set;

This gets my bundle correctly (has worked without an issue until the new version of the framework)

The code for getting the localised string is this

public static string GetString(string token)
            if (AppDelegate.Self == null)
                Console.WriteLine("AppDelegate.Self is null");
                return token;

            #if DEBUG
            //Console.WriteLine("token = {0}", token);

            string toReturn = AppDelegate.Self.LB.LocalizedString(token, null);
            #if DEBUG
            //Console.WriteLine("toReturn = {0}", toReturn);

            string temp = string.Empty;
            if (AppDelegate.Self.UseTranslate && toReturn == token)
                var trans = new translator(NSLocale.CurrentLocale.LanguageCode);
#if !DEBUG
                temp = trans.translate(toReturn);
                if (!string.IsNullOrEmpty(temp))
                    toReturn = temp;
            return toReturn;

trans.translate is not hit in debug, so doesn't matter for this example.

To get the string, I then use this

lblText.Text = StringUtils.GetString("some.token");

some.token is set in the the localization file.

Instead of the corrected localised string, I get the token back. Either there file has not been read or has not been included in the compile

Bug 2.

In the localisation files, not having a ; at the end of the string no longer causes a compilation error.

Bug 3.

If I change the application version number and build, the old build number is still used for the compiled binary.

Reverting to the MDK on beta or stable fixes these issues.

I've included all three in one report as they seem to be around the same area, but I'm happy to break them out into 3 different bugs if required.

=== Xamarin Studio ===

Version 5.7.1 (build 14)
Installation UUID: f3d1a29c-1ba2-4a83-a193-1087efe91a85
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.Mac ===

Version: (Business Edition)

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 3b3ef43
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/PFJ/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Build Information ===

Release ID: 507010014
Git revision: a4dd61ad7f8b3695be4b17bcb5c3ae6b81438cf7
Build date: 2015-01-19 15:21:09-05
Xamarin addins: 081208fe3bbf40e24a562867c6c7fba20a9b94b6

=== Operating System ===

Mac OS X 10.10.2
Darwin Pauls-iMac.local 14.1.0 Darwin Kernel Version 14.1.0
    Mon Dec 22 23:10:38 PST 2014
    root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-02-04 11:00:44 UTC
> I've included all three in one report as they seem to be around the same area,
> but I'm happy to break them out into 3 different bugs if required.

Yes, please, it's easier and less confusing to have 3 similar bug reports (which can refer to eachother and also be marked as duplicates if that's the case), than 3 potential different issues in the same report (it quickly becomes unwieldy if there are more than a few comments).

> Reverting to the MDK on beta or stable fixes these issues.

Are you sure you reverted only the MDK and not Xamarin.iOS as well?

In any case please attach a project so that we can easily reproduce these issues.
Comment 2 Sebastien Pouliot 2016-05-26 21:26:20 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!