From 667123895db5adfd6515f630d0d6daa740b6576b Mon Sep 17 00:00:00 2001 From: mszulecki Date: Fri, 23 Feb 2007 18:39:43 +0000 Subject: Add i18n support stubs and adjust chain. git-svn-id: http://svn.sukimashita.com/repos/dskel/trunk@15 4281df72-ff29-0410-8fee-2d9ac0c5f5a7 --- src/Makefile.am | 4 ++-- src/catalog.d | 19 +++++++++++++++++++ src/helloworld.d | 6 ++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/catalog.d (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 84f04c3..947351c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,12 +1,12 @@ lib_LTLIBRARIES = libtestshlibrary.la libtestshlibrary_la_SOURCES = testshlibrary.d -libtestshlibrary_la_LDFLAGS = -version-info 0:1:0 -module +libtestshlibrary_la_LDFLAGS = -version-info 0:0:0 -module noinst_LIBRARIES = libtestlibrary.a libtestlibrary_a_SOURCES = testlibrary.d bin_PROGRAMS = helloworld -helloworld_SOURCES = helloworld.d +helloworld_SOURCES = helloworld.d catalog.d helloworld_LDADD = $(DEPS_LIBS) $(top_srcdir)/config.d libtestlibrary.a libtestshlibrary.la helloworld_LINK = $(GDC) $(DFLAGS) -o $@ diff --git a/src/catalog.d b/src/catalog.d new file mode 100644 index 0000000..ff48a58 --- /dev/null +++ b/src/catalog.d @@ -0,0 +1,19 @@ +module catalog; + +public static class Catalog +{ + public static void Init(char[] p, char[] localedir) + { + + } + + public static char[] GetString(char[] s) + { + return s; + } + + public static char[] GetPluralString(char[] s, char[] p, char[] n) + { + return s; + } +} diff --git a/src/helloworld.d b/src/helloworld.d index f2f328b..05ed01b 100755 --- a/src/helloworld.d +++ b/src/helloworld.d @@ -2,9 +2,15 @@ import config; import testlibrary; import testshlibrary; import std.stdio; +import catalog; void main(char[][] args) { + // Internationalization Example + Catalog.Init("i18n","./locale"); + + writefln(Catalog.GetString("Hello!")); + writefln(HelloWorldFactory.getName() ~ ", " ~ HelloWorldSharedObjectFactory.getVersion() ~ " " ~ config.VERSION); // auto type inference and built-in foreach -- cgit v1.1-32-gdbae