Author: mhutch
Date: 2008-01-16 19:17:18 -0500 (Wed, 16 Jan 2008)
New Revision: 93120
Added:
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs
Removed:
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs.in
Modified:
trunk/monodevelop/main/src/core/MonoDevelop.Core/ChangeLog
trunk/monodevelop/main/src/core/MonoDevelop.Core/Makefile.am
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.mdp
Log:
* MonoDevelop.Core/Makefile.am, MonoDevelop.Core/MonoDevelop.Core.mdp,
MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs,
MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs.in: Make
Gettext catalogue path relative to MD rather than hardcoding the
prefix set at build time.
Modified: trunk/monodevelop/main/src/core/MonoDevelop.Core/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Core/ChangeLog 2008-01-16
23:57:28 UTC (rev 93119)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Core/ChangeLog 2008-01-17
00:17:18 UTC (rev 93120)
@@ -1,3 +1,9 @@
+2008-01-16 Michael Hutchinson <[EMAIL PROTECTED]>
+
+ * Makefile.am, MonoDevelop.Core.mdp, MonoDevelop.Core/GettextCatalog.cs,
+ MonoDevelop.Core/GettextCatalog.cs.in: Make Gettext catalogue path
+ relative to MD rather than hardcoding the prefix set at build time.
+
2007-12-13 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* Makefile.am, MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp,
Modified: trunk/monodevelop/main/src/core/MonoDevelop.Core/Makefile.am
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Core/Makefile.am
2008-01-16 23:57:28 UTC (rev 93119)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Core/Makefile.am
2008-01-17 00:17:18 UTC (rev 93120)
@@ -48,6 +48,7 @@
MonoDevelop.Core/DefaultAddinLocalizer.cs \
MonoDevelop.Core/FileEventArgs.cs \
MonoDevelop.Core/FileService.cs \
+ MonoDevelop.Core/GettextCatalog.cs \
MonoDevelop.Core/IAsyncOperation.cs \
MonoDevelop.Core/ICustomXmlSerializer.cs \
MonoDevelop.Core/IProgressMonitor.cs \
@@ -64,7 +65,7 @@
MonoDevelop.Core/UserException.cs \
MonoDevelop.Core/XmlReadHelper.cs
-GENERATED_FILES = MonoDevelop.Core/GettextCatalog.cs \
+GENERATED_FILES = \
AssemblyInfo.cs
RES = MonoDevelop.Core.addin.xml
@@ -80,11 +81,6 @@
all: $(ASSEMBLY)
-MonoDevelop.Core/GettextCatalog.cs:
$(srcdir)/MonoDevelop.Core/GettextCatalog.cs.in
- mkdir -p MonoDevelop.Core
- sed -e 's,@''prefix@,$(prefix),g' $(srcdir)/[EMAIL PROTECTED] > [EMAIL
PROTECTED]
- mv [EMAIL PROTECTED] $@
-
$(ASSEMBLY): $(build_sources) $(build_resources)
$(CSC) $(CSC_FLAGS) -debug -out:$@ -target:library $(REFS)
$(build_resources:%=/resource:%) $(build_sources)
@@ -92,8 +88,7 @@
assembly_DATA = $(ASSEMBLY)
CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb
-DISTCLEANFILES = MonoDevelop.Core/GettextCatalog.cs
-EXTRA_DIST = $(FILES) MonoDevelop.Core/GettextCatalog.cs.in $(RES)
+EXTRA_DIST = $(FILES) $(RES)
include $(top_srcdir)/Makefile.include
Added:
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs
===================================================================
---
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs
2008-01-16 23:57:28 UTC (rev 93119)
+++
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs
2008-01-17 00:17:18 UTC (rev 93120)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2004 Jorn Baayen <[EMAIL PROTECTED]>
+ *
+ * Modified by Todd Berman <[EMAIL PROTECTED]> to fit with MonoDevelop.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * !!! Note that this class has to have the same API as the one
+ * from GNU.Gettext.dll, because otherwise the strings won't
+ * be picked up by update-po.
+ */
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+
+using MonoDevelop.Core;
+
+using Mono.Unix;
+
+namespace MonoDevelop.Core
+{
+
+ public class GettextCatalog
+ {
+ static GettextCatalog ()
+ {
+ //variable can be used to override where Gettext looks
for the catalogues
+ string catalog =
System.Environment.GetEnvironmentVariable ("MONODEVELOP_LOCALE_PATH");
+
+ if (string.IsNullOrEmpty (catalog)) {
+ string location =
System.Reflection.Assembly.GetExecutingAssembly ().Location;
+ location = Path.GetDirectoryName (location);
+ //adding "../.." should give us $prefix
+ string prefix = Path.Combine (Path.Combine
(location, ".."), "..");
+ //normalise it
+ prefix = Path.GetFullPath (prefix);
+ //catalogue is installed to
"$prefix/share/locale" by default
+ catalog = Path.Combine (Path.Combine (prefix,
"share"), "locale");
+ }
+ Catalog.Init ("monodevelop", catalog);
+ }
+
+ private GettextCatalog ()
+ {
+ }
+
+ public static string GetString (string str)
+ {
+ return str != null ? Catalog.GetString (str) : null;
+ }
+
+ public static string GetString (string str, params object[]
arguments)
+ {
+ return string.Format (GetString (str), arguments);
+ }
+
+ public static string GetPluralString (string singular,
+ string plural,
+ int n)
+ {
+ return Catalog.GetPluralString (singular, plural, n);
+ }
+
+ public static string GetPluralString (string singular,
+ string plural,
+ int n,
+ params object[] arguments)
+ {
+ return string.Format(GetPluralString (singular, plural,
n), arguments);
+ }
+
+ }
+}
Deleted:
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs.in
===================================================================
---
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs.in
2008-01-16 23:57:28 UTC (rev 93119)
+++
trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/GettextCatalog.cs.in
2008-01-17 00:17:18 UTC (rev 93120)
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2004 Jorn Baayen <[EMAIL PROTECTED]>
- *
- * Modified by Todd Berman <[EMAIL PROTECTED]> to fit with MonoDevelop.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * !!! Note that this class has to have the same API as the one
- * from GNU.Gettext.dll, because otherwise the strings won't
- * be picked up by update-po.
- */
-
-using System;
-using System.Runtime.InteropServices;
-
-using MonoDevelop.Core;
-
-using Mono.Unix;
-
-namespace MonoDevelop.Core
-{
-
- public class GettextCatalog
- {
- static GettextCatalog ()
- {
- Catalog.Init ("monodevelop", "@prefix@/share/locale");
- }
-
- private GettextCatalog ()
- {
- }
-
- public static string GetString (string str)
- {
- return str != null ? Catalog.GetString (str) : null;
- }
-
- public static string GetString (string str, params object[]
arguments)
- {
- return string.Format (GetString (str), arguments);
- }
-
- public static string GetPluralString (string singular,
- string plural,
- int n)
- {
- return Catalog.GetPluralString (singular, plural, n);
- }
-
- public static string GetPluralString (string singular,
- string plural,
- int n,
- params object[] arguments)
- {
- return string.Format(GetPluralString (singular, plural,
n), arguments);
- }
-
- }
-}
Modified: trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.mdp
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.mdp
2008-01-16 23:57:28 UTC (rev 93119)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.mdp
2008-01-17 00:17:18 UTC (rev 93120)
@@ -92,7 +92,6 @@
</References>
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True"
RelativeMakefileName="./Makefile.am" BuildTargetName="" CleanTargetName=""
SyncReferences="True" IsAutotoolsProject="True"
RelativeConfigureInPath="../../../">
<ExcludedFiles>
- <File>MonoDevelop.Core/GettextCatalog.cs</File>
<File>AssemblyInfo.cs</File>
</ExcludedFiles>
<BuildFilesVar Sync="True" Name="FILES" />
@@ -107,4 +106,4 @@
<DeploymentInformation strategy="File">
<excludeFiles />
</DeploymentInformation>
-</Project>
\ No newline at end of file
+</Project>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches