+2004-01-10 Bruno Haible <bruno@clisp.org>
+
+ * hello-csharp/hello.cs: Work around mono-0.29 CurrentUICulture bug.
+ * hello-csharp-forms/hello.cs: Likewise.
+
2003-12-29 Bruno Haible <bruno@clisp.org>
* hello-perl/INSTALL: Mention that libintl-perl-1.09 required.
// Example for use of GNU gettext.
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003-2004 Free Software Foundation, Inc.
// This file is in the public domain.
//
// Source code of the C#/Forms program.
}
public static void Main () {
+ #if __MonoCS__
+ // Some systems don't set CurrentCulture and CurrentUICulture as specified
+ // by LC_ALL. So set it by hand.
+ String locale = System.Environment.GetEnvironmentVariable("LC_ALL");
+ if (locale == null || locale == "")
+ locale = System.Environment.GetEnvironmentVariable("LANG");
+ if (!(locale == null || locale == "")) {
+ if (locale.IndexOf('.') >= 0)
+ locale = locale.Substring(0,locale.IndexOf('.'));
+ System.Threading.Thread.CurrentThread.CurrentCulture =
+ System.Threading.Thread.CurrentThread.CurrentUICulture =
+ new System.Globalization.CultureInfo(locale.Replace('_','-'));
+ }
+ #endif
Application.Run(new HelloWindow());
}
}
// Example for use of GNU gettext.
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003-2004 Free Software Foundation, Inc.
// This file is in the public domain.
//
// Source code of the C# program.
public class Hello {
public static void Main (String[] args) {
+ #if __MonoCS__
+ // Some systems don't set CurrentCulture and CurrentUICulture as specified
+ // by LC_ALL. So set it by hand.
+ String locale = System.Environment.GetEnvironmentVariable("LC_ALL");
+ if (locale == null || locale == "")
+ locale = System.Environment.GetEnvironmentVariable("LANG");
+ if (!(locale == null || locale == "")) {
+ if (locale.IndexOf('.') >= 0)
+ locale = locale.Substring(0,locale.IndexOf('.'));
+ System.Threading.Thread.CurrentThread.CurrentCulture =
+ System.Threading.Thread.CurrentThread.CurrentUICulture =
+ new System.Globalization.CultureInfo(locale.Replace('_','-'));
+ }
+ #endif
GettextResourceManager catalog =
new GettextResourceManager("hello-csharp");
Console.WriteLine(catalog.GetString("Hello, world!"));
+2004-01-10 Bruno Haible <bruno@clisp.org>
+
+ * lang-csharp: Work around mono-0.29 CurrentUICulture bug.
+
2003-12-29 Bruno Haible <bruno@clisp.org>
* testlocale.c: Include stdlib.h.
# Assumes the following packages are installed: pnet, pnetlib.
# Note: This test fails with mono-0.28 because the CultureInfo.Parent pointers
-# are wrong for locales containing a language and a territory.
+# are wrong for locales containing a language and a territory. This is fixed
+# in mono-0.29.
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
using GNU.Gettext;
class Program {
static void Main (String[] args) {
-#if not_yet_needed
+ #if __MonoCS__
// Some systems don't set CurrentCulture and CurrentUICulture as specified
// by LC_ALL. So set it by hand.
System.Threading.Thread.CurrentThread.CurrentCulture =
System.Threading.Thread.CurrentThread.CurrentUICulture =
new System.Globalization.CultureInfo("fr-FR");
-#endif
+ #endif
int n = Int32.Parse(args[0]);
GettextResourceManager catalog = new GettextResourceManager("prog");
Console.WriteLine(catalog.GetString("'Your command, please?', asked the waiter."));