summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac9
-rwxr-xr-xsrc/helloworld.d6
-rw-r--r--src/testlibrary.d4
-rw-r--r--src/testshlibrary.d4
4 files changed, 17 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index f82bedc..977aead 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,14 @@ GETTEXT_PACKAGE=$PACKAGE
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["${GETTEXT_PACKAGE}"], [gettext
domain])
-AC_SUBST(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
+
+dnl Set PACKAGE_LOCALE_DIR in config.d.
+if test "x${prefix}" = "xNONE"; then
+ AC_SUBST(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
+ AC_SUBST(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
+else
+ AC_SUBST(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
+fi
dnl Check for GNU D Compiler
AC_PATH_PROG(GDC, "gdc", no)
diff --git a/src/helloworld.d b/src/helloworld.d
index dcb4a37..fdf8063 100755
--- a/src/helloworld.d
+++ b/src/helloworld.d
@@ -13,7 +13,7 @@ void main(char[][] args)
writefln(HelloWorldFactory.getName() ~ ", " ~ HelloWorldSharedObjectFactory.getVersion() ~ " " ~ config.VERSION);
- writefln("Compiled using: " ~ config.GDC_VERSION);
+ writefln(Catalog.GetString("Compiled using: ") ~ config.GDC_VERSION);
// auto type inference and built-in foreach
foreach (argc, argv; args)
@@ -21,7 +21,7 @@ void main(char[][] args)
// Object Oriented Programming
CmdLin cl = new CmdLin(argc, argv);
// Improved typesafe printf
- writefln(cl.argnum, cl.suffix, " arg: %s", cl.argv);
+ writefln(cl.argnum, cl.suffix, Catalog.GetString(" arg: %s"), cl.argv);
// Automatic or explicit memory management
delete cl;
}
@@ -47,7 +47,7 @@ void main(char[][] args)
}
// built-in string and common string operations
- writefln("argc = %d, " ~ "allocated = %d",
+ writefln(Catalog.GetString("argc = %d, ") ~ Catalog.GetString("allocated = %d"),
argspecs().count, argspecs().allocated);
}
diff --git a/src/testlibrary.d b/src/testlibrary.d
index 744163b..5aea8dc 100644
--- a/src/testlibrary.d
+++ b/src/testlibrary.d
@@ -1,9 +1,11 @@
module testlibrary;
+import catalog;
+
public static class HelloWorldFactory
{
public static char[] getName()
{
- return "Hello World";
+ return Catalog.GetString("Hello World");
}
}
diff --git a/src/testshlibrary.d b/src/testshlibrary.d
index 13cbea9..0bdfc97 100644
--- a/src/testshlibrary.d
+++ b/src/testshlibrary.d
@@ -1,9 +1,11 @@
module testshlibrary;
+import catalog;
+
public static class HelloWorldSharedObjectFactory
{
public static char[] getVersion()
{
- return "Version:";
+ return Catalog.GetString("Version:");
}
}