Hi, people. I've got a mail with Hebrew translation for some strings. As Hebrew is an RTL language, the contributor has also provided a patch to have RTL support in Wesnoth using libfribidi. Could somebody check if it is ok? I'm not sure if there is any other way to support RTL without adding another library. We should also check if it works correctly in every supported platform.
Ivanovic is already adding the language. Best regards -- Isaac Clerencia at Warp Networks, http://www.warp.es Work: <[EMAIL PROTECTED]> | Debian: <[EMAIL PROTECTED]>
diff -rc wesnoth-0.9.4/configure.ac wesnoth-0.9.4.bidi/configure.ac
*** wesnoth-0.9.4/configure.ac 2005-07-21 23:22:14.000000000 +0300
--- wesnoth-0.9.4.bidi/configure.ac 2005-07-25 02:19:54.000000000 +0300
***************
*** 192,197 ****
--- 192,202 ----
[tools=$enableval],
[tools=no])
+ AC_ARG_WITH([fribidi],
+ AS_HELP_STRING([--with-fribidi], [enable Bidirectional language support]),
+ [fribidi=$withval],
+ [fribidi=no])
+
AC_ARG_WITH([kde],
AS_HELP_STRING([--with-kde], [enable installation of icon and KDE menu entry]),
[kde=$withval],
***************
*** 282,287 ****
--- 287,309 ----
fi
+ # fribidi-config
+
+ AC_PATH_PROGS([FRIBIDI_CONFIG], [fribidi-config], [none])
+
+ if test "x$FRIBIDI_CONFIG" = "xnone"; then
+ fribidifound=no
+ AC_MSG_WARN([*** FRIBIDI not found.])
+ else
+ fribidifound=yes
+ FRIBIDI_CFLAGS=`$FRIBIDI_CONFIG --cflags`
+ FRIBIDI_LIBS=`$FRIBIDI_CONFIG --libs`
+ fi
+
+ AC_SUBST([FRIBIDI_CFLAGS])
+ AC_SUBST([FRIBIDI_LIBS])
+ AM_CONDITIONAL([FRIBIDI], [test x$fribidifound = xyes])
+
# libpng-config
AC_PATH_PROGS([PNG_CONFIG], [libpng-config libpng12-config], [none])
diff -rc wesnoth-0.9.4/po/wesnoth/LINGUAS wesnoth-0.9.4.bidi/po/wesnoth/LINGUAS
*** wesnoth-0.9.4/po/wesnoth/LINGUAS 2005-05-08 21:25:38.000000000 +0300
--- wesnoth-0.9.4.bidi/po/wesnoth/LINGUAS 2005-07-25 02:19:54.000000000 +0300
***************
*** 1 ****
! af bg ca cs da de el_GR en_GB es et eu fi fr hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
--- 1 ----
! af bg ca cs da de el_GR en_GB es et eu fi fr he hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
diff -rc wesnoth-0.9.4/po/wesnoth-editor/LINGUAS wesnoth-0.9.4.bidi/po/wesnoth-editor/LINGUAS
*** wesnoth-0.9.4/po/wesnoth-editor/LINGUAS 2005-05-08 21:25:38.000000000 +0300
--- wesnoth-0.9.4.bidi/po/wesnoth-editor/LINGUAS 2005-07-25 08:37:01.000000000 +0300
***************
*** 1 ****
! af bg ca cs da de el_GR en_GB es et eu fi fr hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
--- 1 ----
! af bg ca cs da de el_GR en_GB es et eu fi fr he hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
diff -rc wesnoth-0.9.4/po/wesnoth-ei/LINGUAS wesnoth-0.9.4.bidi/po/wesnoth-ei/LINGUAS
*** wesnoth-0.9.4/po/wesnoth-ei/LINGUAS 2005-05-08 21:25:38.000000000 +0300
--- wesnoth-0.9.4.bidi/po/wesnoth-ei/LINGUAS 2005-07-25 08:37:17.000000000 +0300
***************
*** 1 ****
! af bg ca cs da de el_GR en_GB es et eu fi fr hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
--- 1 ----
! af bg ca cs da de el_GR en_GB es et eu fi fr he hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
diff -rc wesnoth-0.9.4/po/wesnoth-httt/LINGUAS wesnoth-0.9.4.bidi/po/wesnoth-httt/LINGUAS
*** wesnoth-0.9.4/po/wesnoth-httt/LINGUAS 2005-05-08 21:25:38.000000000 +0300
--- wesnoth-0.9.4.bidi/po/wesnoth-httt/LINGUAS 2005-07-25 08:37:21.000000000 +0300
***************
*** 1 ****
! af bg ca cs da de el_GR en_GB es et eu fi fr hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
--- 1 ----
! af bg ca cs da de el_GR en_GB es et eu fi fr he hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
diff -rc wesnoth-0.9.4/po/wesnoth-lib/LINGUAS wesnoth-0.9.4.bidi/po/wesnoth-lib/LINGUAS
*** wesnoth-0.9.4/po/wesnoth-lib/LINGUAS 2005-05-08 21:25:38.000000000 +0300
--- wesnoth-0.9.4.bidi/po/wesnoth-lib/LINGUAS 2005-07-25 08:36:22.000000000 +0300
***************
*** 1 ****
! af bg ca cs da de el_GR en_GB es et eu fi fr hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
--- 1 ----
! af bg ca cs da de el_GR en_GB es et eu fi fr he hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
diff -rc wesnoth-0.9.4/po/wesnoth-sotbe/LINGUAS wesnoth-0.9.4.bidi/po/wesnoth-sotbe/LINGUAS
*** wesnoth-0.9.4/po/wesnoth-sotbe/LINGUAS 2005-05-08 21:25:38.000000000 +0300
--- wesnoth-0.9.4.bidi/po/wesnoth-sotbe/LINGUAS 2005-07-25 08:37:33.000000000 +0300
***************
*** 1 ****
! af bg ca cs da de el_GR en_GB es et eu fi fr hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
--- 1 ----
! af bg ca cs da de el_GR en_GB es et eu fi fr he hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
diff -rc wesnoth-0.9.4/po/wesnoth-tdh/LINGUAS wesnoth-0.9.4.bidi/po/wesnoth-tdh/LINGUAS
*** wesnoth-0.9.4/po/wesnoth-tdh/LINGUAS 2005-05-08 21:25:38.000000000 +0300
--- wesnoth-0.9.4.bidi/po/wesnoth-tdh/LINGUAS 2005-07-25 08:37:36.000000000 +0300
***************
*** 1 ****
! af bg ca cs da de el_GR en_GB es et eu fi fr hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
--- 1 ----
! af bg ca cs da de el_GR en_GB es et eu fi fr he hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
diff -rc wesnoth-0.9.4/po/wesnoth-trow/LINGUAS wesnoth-0.9.4.bidi/po/wesnoth-trow/LINGUAS
*** wesnoth-0.9.4/po/wesnoth-trow/LINGUAS 2005-05-08 21:25:38.000000000 +0300
--- wesnoth-0.9.4.bidi/po/wesnoth-trow/LINGUAS 2005-07-25 08:37:40.000000000 +0300
***************
*** 1 ****
! af bg ca cs da de el_GR en_GB es et eu fi fr hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
--- 1 ----
! af bg ca cs da de el_GR en_GB es et eu fi fr he hu it ja la nl no pl pt_BR ru sk sl sr sv tr zh_CN
diff -rc wesnoth-0.9.4/src/about.cpp wesnoth-0.9.4.bidi/src/about.cpp
*** wesnoth-0.9.4/src/about.cpp 2005-07-18 23:59:53.000000000 +0300
--- wesnoth-0.9.4.bidi/src/about.cpp 2005-07-25 02:19:54.000000000 +0300
***************
*** 209,214 ****
--- 209,217 ----
"- Katerina Sykioti",
"- Konstantinos Karasavvas",
+ "_" N_("+Hebrew Translation"),
+ "- Oron Peled",
+
"_" N_("+Hungarian Translation"),
"- adson",
"- dentro",
diff -rc wesnoth-0.9.4/src/font.cpp wesnoth-0.9.4.bidi/src/font.cpp
*** wesnoth-0.9.4/src/font.cpp 2005-07-06 02:04:21.000000000 +0300
--- wesnoth-0.9.4.bidi/src/font.cpp 2005-07-25 02:19:54.000000000 +0300
***************
*** 53,58 ****
--- 53,65 ----
#error Please use the SDL_ttf files in the sdl_ttf directory, and not the original SDL_ttf library.
#endif
+ #ifdef HAVE_FRIBIDI
+ #include <fribidi/fribidi.h>
+
+ #else
+
+ #endif
+
namespace {
// Signed int. Negative values mean "no subset".
***************
*** 366,373 ****
void hash();
};
text_surface::text_surface(std::string const &str, int size, SDL_Color color, int style)
! : font_size_(size), color_(color), style_(style), w_(-1), h_(-1), str_(str),
initialized_(false)
{
hash();
--- 373,400 ----
void hash();
};
+ #ifdef HAVE_FRIBIDI
+ static std::string bidi_cvt(std::string const &str)
+ {
+ char *c_str = const_cast<char *>(str.c_str()); // fribidi forgot const...
+ int len = str.length();
+ FriBidiChar bidi_logical[len + 2];
+ FriBidiChar bidi_visual[len + 2];
+ char utf8str[len + 1];
+ FriBidiCharType base_dir = FRIBIDI_TYPE_ON;
+ int n;
+
+ n = fribidi_utf8_to_unicode (c_str, len, bidi_logical);
+ fribidi_log2vis(bidi_logical, n, &base_dir, bidi_visual, NULL, NULL, NULL);
+ fribidi_unicode_to_utf8 (bidi_visual, n, utf8str);
+ return std::string(utf8str);
+ }
+ #else
+ # define bidi_cvt(x) (x)
+ #endif
+
text_surface::text_surface(std::string const &str, int size, SDL_Color color, int style)
! : font_size_(size), color_(color), style_(style), w_(-1), h_(-1), str_(bidi_cvt(str)),
initialized_(false)
{
hash();
***************
*** 383,389 ****
initialized_ = false;
w_ = -1;
h_ = -1;
! str_ = str;
hash();
}
--- 410,416 ----
initialized_ = false;
w_ = -1;
h_ = -1;
! str_ = bidi_cvt(str);
hash();
}
diff -rc wesnoth-0.9.4/src/language.cpp wesnoth-0.9.4.bidi/src/language.cpp
*** wesnoth-0.9.4/src/language.cpp 2005-07-18 23:59:54.000000000 +0300
--- wesnoth-0.9.4.bidi/src/language.cpp 2005-07-25 02:19:54.000000000 +0300
***************
*** 53,58 ****
--- 53,59 ----
language_def("fr_FR", "Français"),
language_def("it_IT", "Italiano"),
language_def("la_IT", "Latina"),
+ language_def("he_IL", "עברית"),
language_def("hu_HU", "Magyar"),
language_def("nl_NL", "Nederlands"),
language_def("ja_JP", "日本語 (Nihongo)"),
diff -rc wesnoth-0.9.4/src/Makefile.am wesnoth-0.9.4.bidi/src/Makefile.am
*** wesnoth-0.9.4/src/Makefile.am 2005-07-21 22:39:04.000000000 +0300
--- wesnoth-0.9.4.bidi/src/Makefile.am 2005-07-25 02:19:54.000000000 +0300
***************
*** 550,555 ****
--- 550,560 ----
AM_CFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR)
+ if FRIBIDI
+ AM_CXXFLAGS += -DHAVE_FRIBIDI @FRIBIDI_CFLAGS@
+ AM_CFLAGS += -DHAVE_FRIBIDI @FRIBIDI_CFLAGS@
+ endif
+
if X11
CXXFLAGS += -D_X11 @X_CFLAGS@
CFLAGS += -D_X11 @X_CFLAGS@
***************
*** 563,569 ****
THELIBS = $(SDL_IMAGE_LIBS) $(SDL_MIXER_LIBS) $(SDL_NET_LIBS) \
! $(SDL_TTF_LIBS) $(SDL_LIBS) $(LIBZIPIOS) $(FREETYPE_LIBS) $(LIBINTL)
wesnoth_LDADD = $(THELIBS)
wesnoth_editor_LDADD = $(THELIBS)
--- 568,575 ----
THELIBS = $(SDL_IMAGE_LIBS) $(SDL_MIXER_LIBS) $(SDL_NET_LIBS) \
! $(SDL_TTF_LIBS) $(SDL_LIBS) $(LIBZIPIOS) $(FREETYPE_LIBS) $(LIBINTL) \
! @FRIBIDI_LIBS@
wesnoth_LDADD = $(THELIBS)
wesnoth_editor_LDADD = $(THELIBS)
pgpUboorHVcTU.pgp
Description: PGP signature
