Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use standard gettext, following Geany core. #1183

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ jobs:
gettext
python-docutils
# geany-plugins
intltool
check
cppcheck
# debugger
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cscope.files
#-----------------------------------------------------------------------
# / (root)
#-----------------------------------------------------------------------
/ABOUT-NLS
/aclocal.m4
/autom4te.cache
/build/*.pyc
Expand All @@ -35,6 +36,7 @@ cscope.files
/config.log
/config.status
/config.sub
/config.rpath
/configure
/debian
/depcomp
Expand Down Expand Up @@ -62,10 +64,8 @@ cscope.files
/po/ChangeLog.save
/po/*.gmo
/po/*.header
/po/.intltool-merge-cache
/po/LINGUAS
/po/Makefile.in.in
/po/Makevars
/po/Makevars.template
/po/*.mo
/po/*.pot
/po/POTFILES
Expand All @@ -76,6 +76,7 @@ cscope.files
/po/*.sed
/po/*.sin
/po/stamp-it
/po/stamp-po

#-----------------------------------------------------------------------
# TeX
Expand Down
11 changes: 8 additions & 3 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/bin/sh -e

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

mkdir -p build/cache
intltoolize -c -f
autoreconf -vfi

(cd $srcdir; autoreconf --install --verbose)

if [ "$NOCONFIGURE" = 1 ]; then
echo "Done. configure skipped."
exit 0;
fi
exec ./configure "$@"

echo "Running $srcdir/configure $@ ..."
$srcdir/configure "$@" && echo "Now type 'make' to compile." || exit 1
1 change: 1 addition & 0 deletions build/common.m4
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ AC_DEFUN([GP_CHECK_MINGW],
*mingw*)
AC_DEFINE([WIN32], [1], [we are cross compiling for WIN32])
AM_CONDITIONAL([MINGW], true)
LIBS="$LIBS -liconv"
;;
*)
AM_CONDITIONAL([MINGW], false)
Expand Down
10 changes: 4 additions & 6 deletions build/i18n.m4
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
AC_DEFUN([GP_I18N],
[
if test -z "$conf_dir" ; then
conf_dir="."
fi
ALL_LINGUAS=`cd "$conf_dir/po" 2>/dev/null && ls *.po 2>/dev/null | $AWK 'BEGIN { FS="."; ORS=" " } { print $[1] }'`
GETTEXT_PACKAGE=geany-plugins
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(
[GETTEXT_PACKAGE],
o [GETTEXT_PACKAGE],
kugel- marked this conversation as resolved.
Show resolved Hide resolved
["$GETTEXT_PACKAGE"],
[The domain to use with gettext])
LOCALEDIR="${datadir}/locale"
AC_SUBST(LOCALEDIR)
AM_GLIB_GNU_GETTEXT

AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
])
8 changes: 5 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ AM_PROG_CC_C_O
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

dnl i18n
IT_PROG_INTLTOOL([0.35.0])
GP_I18N
eht16 marked this conversation as resolved.
Show resolved Hide resolved
dnl i18n, inline so autoreconf can detect gettext usage
AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
AC_SUBST([GETTEXT_PACKAGE],[$PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$PACKAGE"], [Gettext package.])

dnl common checks
GP_CHECK_GEANY(1.29)
Expand Down
1 change: 1 addition & 0 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
be ca da de el es fr gl it ja kk nl pt_BR pt ru tr uk zh_CN
82 changes: 82 additions & 0 deletions po/Makevars
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Makefile variables for PO directory in any package using GNU gettext.
#
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation gives
# unlimited permission to use, copy, distribute, and modify it.

# 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_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --from-code=UTF-8

# 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 = The Geany contributors

# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = no

# 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 = https://github.com/geany/geany/issues

# 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 =

# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no

# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS =

# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
MSGINIT_OPTIONS =

# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = no

# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = yes
8 changes: 4 additions & 4 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ geanyvc/src/utils.c
geniuspaste/src/geniuspaste.c

# GitChangeBar
[type: gettext/glade]git-changebar/data/prefs.ui
git-changebar/data/prefs.ui
git-changebar/src/gcb-plugin.c

# Keyrecord
Expand Down Expand Up @@ -247,14 +247,14 @@ overview/overview/overviewprefs.c
overview/overview/overviewprefspanel.c
overview/overview/overviewscintilla.c
overview/overview/overviewui.c
[type: gettext/glade]overview/data/prefs.ui
overview/data/prefs.ui

# Pairtaghighlighter
pairtaghighlighter/src/pair_tag_highlighter.c

# PoHelper
[type: gettext/glade]pohelper/data/menus.ui
[type: gettext/glade]pohelper/data/stats.ui
pohelper/data/menus.ui
pohelper/data/stats.ui
pohelper/src/gph-plugin.c

# Pretty-printer
Expand Down
Loading