diff options
author | mszulecki | 2007-06-11 18:18:54 +0000 |
---|---|---|
committer | mszulecki | 2007-06-11 18:18:54 +0000 |
commit | 63db083d9b76e2db4db274a2a99e28cdfc96ed2f (patch) | |
tree | a96478edba3f8678ef11e2e25ed8a89e97b4afc2 | |
parent | 0d8a3ccfe29681d855bb18649af75cc177335a6b (diff) | |
download | dskel-63db083d9b76e2db4db274a2a99e28cdfc96ed2f.tar.gz dskel-63db083d9b76e2db4db274a2a99e28cdfc96ed2f.tar.bz2 |
Fix localedir if prefix not defined and mark more strings as translated.
git-svn-id: http://svn.sukimashita.com/repos/dskel/trunk@23 4281df72-ff29-0410-8fee-2d9ac0c5f5a7
-rw-r--r-- | configure.ac | 9 | ||||
-rwxr-xr-x | src/helloworld.d | 6 | ||||
-rw-r--r-- | src/testlibrary.d | 4 | ||||
-rw-r--r-- | src/testshlibrary.d | 4 |
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:"); } } |