r6441 - packages/trunk/sdlbasic/debian/patches

Miriam Ruiz baby-guest at alioth.debian.org
Fri Apr 4 15:58:28 UTC 2008


Author: baby-guest
Date: 2008-04-04 15:58:28 +0000 (Fri, 04 Apr 2008)
New Revision: 6441

Added:
   packages/trunk/sdlbasic/debian/patches/i18n.patch
Log:
Adding support for gettext. Still pending.



Added: packages/trunk/sdlbasic/debian/patches/i18n.patch
===================================================================
--- packages/trunk/sdlbasic/debian/patches/i18n.patch	                        (rev 0)
+++ packages/trunk/sdlbasic/debian/patches/i18n.patch	2008-04-04 15:58:28 UTC (rev 6441)
@@ -0,0 +1,119 @@
+# Copyright (C) 2008 by Miriam Ruiz <little_miry at yahoo.es>
+# Distributed under the same license as the program. See debian/copyright.
+
+Index: sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBasic/gtk/SciTEGTK.cxx
+===================================================================
+--- sdlbasic-0.0.20070714.orig/src/sdlBasic/src/sdlBasic/gtk/SciTEGTK.cxx	2008-04-04 15:33:00.000000000 +0000
++++ sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBasic/gtk/SciTEGTK.cxx	2008-04-04 15:53:16.000000000 +0000
+@@ -35,6 +35,34 @@
+ #include "SciTEBase.h"
+ #include "SciTEKeys.h"
+ 
++#ifdef USE_GETTEXT
++
++#include "i18n.h"
++
++#include <libintl.h>
++#include <locale.h>
++
++GetTextInit::GetTextInit()
++{
++	if  (!IsInit)
++	{
++		IsInit = true;
++		setlocale (LC_MESSAGES, "");
++		setlocale (LC_CTYPE, "");
++		setlocale (LC_COLLATE, "");
++		textdomain (PO_NAME);
++#ifdef PO_DIR
++		bindtextdomain (PO_NAME, PO_DIR);
++#else
++		bindtextdomain (PO_NAME, NULL);
++#endif
++	}
++}
++
++bool GetTextInit::IsInit = false;
++
++#endif
++
+ #ifndef NO_EXTENSIONS
+ #include "MultiplexExtension.h"
+ 
+Index: sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBasic/makefile.locales
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBasic/makefile.locales	2008-04-04 15:57:34.000000000 +0000
+@@ -0,0 +1,42 @@
++# Copyright (C) by Miriam Ruiz <little_miry at yahoo.es>, 2008
++
++PROGRAM=sdlbasic
++CFLAGS=-Wall -Werror -ansi -pedantic
++LOCALEDIR=.
++DEFS=-DUSE_GETTEXT -DPO_NAME="\"$(PROGRAM)\"" -DPO_DIR="\"$(LOCALEDIR)\""
++
++all: $(PROGRAM).pot build-locales
++
++clean: clean-locales
++	rm -f *.o *.mo test test.pot
++
++%.pot:
++	xgettext -k -k_ -o $@ $+ --from-code=iso-8859-1
++
++$(PROGRAM).pot: main.cpp
++
++build-locales:
++	@if ls *.po 2>/dev/null ; then  \
++		for f in *.po; do \
++			i=`basename $$f .po` ; \
++			echo Building Language \"$$i\" ; \
++			msgfmt $$f -o $$i.mo ; \
++		done \
++	fi
++	if ls *.mo 2>/dev/null ; then \
++		for f in *.mo; do \
++			i=`basename $$f .mo` ; \
++			echo Installing Language \"$$i\" ; \
++			mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES ; \
++			mv $$f $(LOCALEDIR)/$$i/LC_MESSAGES/test.mo ; \
++		done \
++	fi
++
++clean-locales:
++	@if ls *.po 2>/dev/null ; then  \
++		for f in *.po; do \
++			i=`basename $$f .po` ; \
++			echo Deleting Language \"$$i\" ; \
++			rm -rf $$i ; \
++		done \
++	fi
+Index: sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBasic/src/SciTE.h
+===================================================================
+--- sdlbasic-0.0.20070714.orig/src/sdlBasic/src/sdlBasic/src/SciTE.h	2008-04-04 15:32:15.000000000 +0000
++++ sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBasic/src/SciTE.h	2008-04-04 15:54:38.000000000 +0000
+@@ -254,4 +254,25 @@
+ #define IDR_GO 112
+ #define IDR_STOPEXECUTE 113
+ 
++#ifdef USE_GETTEXT
++
++#include <libintl.h>
++#define _(String) gettext (String)
++
++class GetTextInit
++{
++	protected:
++		static bool IsInit;
++	public:
++		GetTextInit();
++};
++
++static GetTextInit gettext_init;
++
++#else
++
++#define _(String) String
++
++#endif
++
+ #endif




More information about the Pkg-games-commits mailing list