Multilanguage: Add infrastructure for multilanguage support.

Added macros _(), that should be used for each string,
that will be translated to other languages.
This commit is contained in:
Mykyta Biliavskyi 2015-11-17 16:59:55 +00:00
parent 9b2c054002
commit 2f6f020f65
9 changed files with 1404 additions and 11 deletions

24
.gitignore vendored
View File

@ -7,11 +7,14 @@
*~
.*
*.eo.*
*.sed
*.sin
Enventor.h
enventor
enventorql
Makefile.in.in
Makefile.in
Makefile
@ -32,12 +35,21 @@ install-sh
libtool
ltmain.sh
enventor.pc
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
m4/efl.m4
!m4/efl_attribute.m4
!m4/efl_binary.m4
!m4/elm_quicklaunch.m4
!m4/efl_beta.m4
!m4/efl_eo.m4
m4/*
po/Makevars.template
po/POTFILES
po/Rules-quot
po/en@boldquot.header
po/en@quot.header
po/stamp-po
po/enventor.pot
intl/
config.rpath
missing
src/bin/.deps/
src/bin/.libs/

1282
ABOUT-NLS

File diff suppressed because it is too large Load Diff

View File

@ -13,15 +13,15 @@ missing
filesdir = $(datadir)/$(PACKAGE)/docs
files_DATA = README
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
README \
AUTHORS \
COPYING \
autogen.sh
SUBDIRS = src data
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src data . po
pkgconfigdir = $(libdir)/pkgconfig

View File

@ -6,7 +6,7 @@ rm -f aclocal.m4 ltmain.sh
touch README
touch ABOUT-NLS
# echo "Running autopoint..." ; autopoint -f || :
echo "Running autopoint..." ; autopoint -f || :
echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
echo "Running autoheader..." ; autoheader || exit 1
echo "Running autoconf..." ; autoconf || exit 1

View File

@ -21,6 +21,7 @@ AC_INIT(enventor, [v_ver], hermet@hermet.pe.kr)
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(configure.ac)
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
@ -28,12 +29,18 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6 dist-bzip2 dist-xz)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS(config.h)
AC_GNU_SOURCE
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
ELM_QUICKLAUNCH
AM_PROG_AS
##-- localization with using gettext
AM_GNU_GETTEXT_VERSION(0.18.1)
AM_GNU_GETTEXT([external])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
@ -95,6 +102,7 @@ AM_CONDITIONAL([HAVE_EOLIAN_GEN], [true])
AM_CONDITIONAL([HAVE_EOLIAN_CXX], [true])
AC_CONFIG_FILES([
po/Makefile.in
Makefile
src/Makefile
src/include/Makefile

1
po/LINGUAS Normal file
View File

@ -0,0 +1 @@

42
po/Makevars Normal file
View File

@ -0,0 +1,42 @@
# Makefile variables for PO directory in any package using GNU gettext.
# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)
# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
# package. (Note that the msgstr strings, extracted from the package's
# sources, belong to the copyright holder of the package.) Translators are
# expected to transfer the copyright for their translations to this person
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Enventor development team
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
# in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
# understood.
# - Strings which make invalid assumptions about notation of date, time or
# money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS = enlightenment-devel@lists.sourceforge.net
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =

34
po/POTFILES.in Normal file
View File

@ -0,0 +1,34 @@
src/bin/base_gui.c
src/bin/config_data.c
src/bin/console.c
src/bin/file_mgr.c
src/bin/globals.c
src/bin/goto.c
src/bin/live_edit.c
src/bin/main.c
src/bin/Makefile
src/bin/menu.c
src/bin/newfile.c
src/bin/panes.c
src/bin/search.c
src/bin/setting.c
src/bin/statusbar.c
src/bin/text_setting.c
src/bin/tools.c
src/lib/auto_comp.c
src/lib/build.c
src/lib/ctxpopup.c
src/lib/dummy_obj.c
src/lib/edc_editor.c
src/lib/edc_parser.c
src/lib/edj_mgr.c
src/lib/edj_viewer.c
src/lib/enventor_main.c
src/lib/enventor_smart.c
src/lib/indent.c
src/lib/Makefile
src/lib/redoundo.c
src/lib/syntax_color.c
src/lib/syntax_helper.c
src/lib/template.c

View File

@ -80,4 +80,18 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
#include "console.h"
#include "file_mgr.h"
/* localization */
#ifdef HAVE_GETTEXT
#include <libintl.h>
#define _(string) gettext(string)
#define N_(string) string
#define NGETTEXT(single, plur, n) ngettext(single, plur, n)
#else
#define _(string) string
#define N_(string) string
#define NGETTEXT(single, plur, n) (((n)==1)? (single):(plur))
#endif /* localization */
#endif