[vala/wip/gettext: 6/12] Use gettext to support localized warning and error messages
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/gettext: 6/12] Use gettext to support localized warning and error messages
- Date: Fri, 21 Sep 2018 07:19:33 +0000 (UTC)
commit b4e1c1ac4b79199ecc8fd891b01df2c87800ccff
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Apr 19 22:51:06 2018 +0200
Use gettext to support localized warning and error messages
.gitignore | 12 ++
Makefile.am | 1 +
ccode/Makefile.am | 1 +
codegen/Makefile.am | 1 +
compiler/Makefile.am | 1 +
compiler/valacompiler.vala | 2 +
configure.ac | 8 ++
gee/Makefile.am | 1 +
libvaladoc/Makefile.am | 1 +
po/Makevars | 87 ++++++++++++
po/POTFILES.in | 333 +++++++++++++++++++++++++++++++++++++++++++++
po/POTFILES.skip | 0
vala/Makefile.am | 1 +
valadoc/Makefile.am | 1 +
valadoc/valadoc.vala | 4 +
vapi/config.vapi | 1 +
vapigen/Makefile.am | 1 +
vapigen/valavapigen.vala | 4 +
18 files changed, 460 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index 1f8def72c..0f19e11fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@ install-sh
libtool
m4
missing
+mkinstalldirs
ltmain.sh
ylwrap
compile
@@ -32,6 +33,17 @@ stamp-h1
.version
.DS_Store
+ABOUT-NLS
+po/*.gmo
+po/*.header
+po/*.sed
+po/*.sin
+po/Makefile.in.in
+po/Makevars.template
+po/POTFILES
+po/Rules-quot
+po/stamp-po
+
*.gcda
*.gcno
coverage
diff --git a/Makefile.am b/Makefile.am
index 508c6618f..ddf68b17c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,6 +15,7 @@ SUBDIRS = \
vapigen \
libvaladoc \
valadoc \
+ po \
$(NULL)
if ENABLE_UNVERSIONED
diff --git a/ccode/Makefile.am b/ccode/Makefile.am
index b0d9b1358..1f5989d56 100644
--- a/ccode/Makefile.am
+++ b/ccode/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.common
NULL =
AM_CPPFLAGS = \
+ -include config.h \
$(COVERAGE_CFLAGS) \
-I$(top_srcdir)/gee \
-I$(top_srcdir)/vala \
diff --git a/codegen/Makefile.am b/codegen/Makefile.am
index 036652ef3..165394940 100644
--- a/codegen/Makefile.am
+++ b/codegen/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.common
NULL =
AM_CPPFLAGS = \
+ -include config.h \
$(COVERAGE_CFLAGS) \
-I$(top_srcdir)/gee \
-I$(top_srcdir)/ccode \
diff --git a/compiler/Makefile.am b/compiler/Makefile.am
index ff8759e25..de288952d 100644
--- a/compiler/Makefile.am
+++ b/compiler/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.common
NULL =
AM_CPPFLAGS = \
+ -include config.h \
$(COVERAGE_CFLAGS) \
-I$(top_srcdir)/gee \
-I$(top_srcdir)/ccode \
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 405a4965e..b881901d5 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -623,6 +623,8 @@ class Vala.Compiler {
static int main (string[] args) {
// initialize locale
Intl.setlocale (LocaleCategory.ALL, "");
+ Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
+ Intl.textdomain (Config.GETTEXT_PACKAGE);
if (Path.get_basename (args[0]) == "vala" || Path.get_basename (args[0]) == "vala" +
Config.PACKAGE_SUFFIX) {
return run_source (args);
diff --git a/configure.ac b/configure.ac
index 88ca0f94b..42c302236 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,13 @@ case "${host_os}" in
esac
AM_CONDITIONAL([HAVE_LINUX], [test "$build_linux" = "yes"])
+GETTEXT_PACKAGE=AC_PACKAGE_NAME
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
+
+AM_GNU_GETTEXT_VERSION([0.18.3])
+AM_GNU_GETTEXT([external])
+
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
PKG_PROG_PKG_CONFIG([0.21])
@@ -189,6 +196,7 @@ AC_CONFIG_FILES([Makefile
valadoc/doclets/gtkdoc/Makefile
valadoc/icons/Makefile
valadoc/tests/Makefile
+ po/Makefile.in
])
AC_OUTPUT
diff --git a/gee/Makefile.am b/gee/Makefile.am
index fd8779c6f..aeab4f538 100644
--- a/gee/Makefile.am
+++ b/gee/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.common
NULL =
AM_CPPFLAGS = \
+ -include config.h \
$(COVERAGE_CFLAGS) \
$(GLIB_CFLAGS) \
$(NULL)
diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
index 384292f57..635c6398e 100644
--- a/libvaladoc/Makefile.am
+++ b/libvaladoc/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.common
NULL =
AM_CFLAGS = \
+ -include config.h \
-DPACKAGE_ICONDIR=\"$(datadir)/valadoc/icons/\" \
-DPACKAGE_DATADIR=\"$(libdir)/valadoc\" \
-DPACKAGE_VERSION=\"$(VERSION)\" \
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 000000000..c67e9c2ac
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,87 @@
+# 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 = --from-code=UTF-8 --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 = The Vala Developers
+
+# 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.
+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://gitlab.gnome.org/GNOME/vala/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 = no
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 000000000..932a1e012
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,333 @@
+codegen/valaccodearraymodule.vala
+codegen/valaccodeassignmentmodule.vala
+codegen/valaccodeattribute.vala
+codegen/valaccodebasemodule.vala
+codegen/valaccodecompiler.vala
+codegen/valaccodecontrolflowmodule.vala
+codegen/valaccodedelegatemodule.vala
+codegen/valaccodememberaccessmodule.vala
+codegen/valaccodemethodcallmodule.vala
+codegen/valaccodemethodmodule.vala
+codegen/valaccodestructmodule.vala
+codegen/valaccode.vala
+codegen/valaclassregisterfunction.vala
+codegen/valactype.vala
+codegen/valaenumregisterfunction.vala
+codegen/valagasyncmodule.vala
+codegen/valagdbusclientmodule.vala
+codegen/valagdbusmodule.vala
+codegen/valagdbusservermodule.vala
+codegen/valagerrormodule.vala
+codegen/valagirwriter.vala
+codegen/valagobjectmodule.vala
+codegen/valagsignalmodule.vala
+codegen/valagtkmodule.vala
+codegen/valagtypemodule.vala
+codegen/valagvariantmodule.vala
+codegen/valainterfaceregisterfunction.vala
+codegen/valastructregisterfunction.vala
+codegen/valatyperegisterfunction.vala
+compiler/valacompiler.vala
+libvaladoc/api/array.vala
+libvaladoc/api/attributeargument.vala
+libvaladoc/api/attribute.vala
+libvaladoc/api/browsable.vala
+libvaladoc/api/callable.vala
+libvaladoc/api/childsymbolregistrar.vala
+libvaladoc/api/class.vala
+libvaladoc/api/constant.vala
+libvaladoc/api/delegate.vala
+libvaladoc/api/driver.vala
+libvaladoc/api/enum.vala
+libvaladoc/api/enumvalue.vala
+libvaladoc/api/errorcode.vala
+libvaladoc/api/errordomain.vala
+libvaladoc/api/field.vala
+libvaladoc/api/formalparametertype.vala
+libvaladoc/api/formalparameter.vala
+libvaladoc/api/girsourcecomment.vala
+libvaladoc/api/interface.vala
+libvaladoc/api/item.vala
+libvaladoc/api/member.vala
+libvaladoc/api/methodbindingtype.vala
+libvaladoc/api/method.vala
+libvaladoc/api/namespace.vala
+libvaladoc/api/nodetype.vala
+libvaladoc/api/node.vala
+libvaladoc/api/ownership.vala
+libvaladoc/api/package.vala
+libvaladoc/api/pointer.vala
+libvaladoc/api/propertyaccessortype.vala
+libvaladoc/api/propertyaccessor.vala
+libvaladoc/api/propertybindingtype.vala
+libvaladoc/api/property.vala
+libvaladoc/api/signal.vala
+libvaladoc/api/signaturebuilder.vala
+libvaladoc/api/sourcecomment.vala
+libvaladoc/api/sourcefile.vala
+libvaladoc/api/struct.vala
+libvaladoc/api/symbolaccessibility.vala
+libvaladoc/api/symbol.vala
+libvaladoc/api/tree.vala
+libvaladoc/api/typeparameter.vala
+libvaladoc/api/typereference.vala
+libvaladoc/api/typesymbol.vala
+libvaladoc/api/visitor.vala
+libvaladoc/charts/chartfactory.vala
+libvaladoc/charts/chart.vala
+libvaladoc/charts/hierarchychart.vala
+libvaladoc/charts/simplechartfactory.vala
+libvaladoc/content/blockcontent.vala
+libvaladoc/content/block.vala
+libvaladoc/content/comment.vala
+libvaladoc/content/contentelement.vala
+libvaladoc/content/contentfactory.vala
+libvaladoc/content/contentrenderer.vala
+libvaladoc/content/contentvisitor.vala
+libvaladoc/content/embedded.vala
+libvaladoc/content/headline.vala
+libvaladoc/content/inlinecontent.vala
+libvaladoc/content/inlinetaglet.vala
+libvaladoc/content/inline.vala
+libvaladoc/content/link.vala
+libvaladoc/content/listitem.vala
+libvaladoc/content/list.vala
+libvaladoc/content/note.vala
+libvaladoc/content/page.vala
+libvaladoc/content/paragraph.vala
+libvaladoc/content/resourcelocator.vala
+libvaladoc/content/run.vala
+libvaladoc/content/sourcecode.vala
+libvaladoc/content/styleattributes.vala
+libvaladoc/content/symbollink.vala
+libvaladoc/content/tablecell.vala
+libvaladoc/content/tablerow.vala
+libvaladoc/content/table.vala
+libvaladoc/content/taglet.vala
+libvaladoc/content/text.vala
+libvaladoc/content/warning.vala
+libvaladoc/content/wikilink.vala
+libvaladoc/ctyperesolver.vala
+libvaladoc/devhelp-markupwriter.vala
+libvaladoc/doclet.vala
+libvaladoc/documentation/commentscanner.vala
+libvaladoc/documentation/documentationparser.vala
+libvaladoc/documentation/documentation.vala
+libvaladoc/documentation/girmetadata.vala
+libvaladoc/documentation/gtkdoccommentparser.vala
+libvaladoc/documentation/gtkdoccommentscanner.vala
+libvaladoc/documentation/gtkdocmarkdownparser.vala
+libvaladoc/documentation/gtkdocmarkdownscanner.vala
+libvaladoc/documentation/importerhelper.vala
+libvaladoc/documentation/wikiscanner.vala
+libvaladoc/documentation/wiki.vala
+libvaladoc/errorreporter.vala
+libvaladoc/filehelper.vala
+libvaladoc/gtkdocmarkupwriter.vala
+libvaladoc/gtkdocrenderer.vala
+libvaladoc/highlighter/codescanner.vala
+libvaladoc/highlighter/codetoken.vala
+libvaladoc/highlighter/highlighter.vala
+libvaladoc/highlighter/scanner.vala
+libvaladoc/highlighter/xmlscanner.vala
+libvaladoc/html/basicdoclet.vala
+libvaladoc/html/cssclassresolver.vala
+libvaladoc/html/htmlchartfactory.vala
+libvaladoc/html/htmlmarkupwriter.vala
+libvaladoc/html/htmlrenderer.vala
+libvaladoc/html/linkhelper.vala
+libvaladoc/importer/documentationimporter.vala
+libvaladoc/importer/girdocumentationimporter.vala
+libvaladoc/importer/internalidregistrar.vala
+libvaladoc/importer/valadocdocumentationimporterscanner.vala
+libvaladoc/importer/valadocdocumentationimporter.vala
+libvaladoc/markupwriter.vala
+libvaladoc/moduleloader.vala
+libvaladoc/parser/manyrule.vala
+libvaladoc/parser/oneofrule.vala
+libvaladoc/parser/optionalrule.vala
+libvaladoc/parser/parsercallback.vala
+libvaladoc/parser/parser.vala
+libvaladoc/parser/rule.vala
+libvaladoc/parser/scanner.vala
+libvaladoc/parser/sequencerule.vala
+libvaladoc/parser/stubrule.vala
+libvaladoc/parser/tokentype.vala
+libvaladoc/parser/token.vala
+libvaladoc/settings.vala
+libvaladoc/taglets/tagletdeprecated.vala
+libvaladoc/taglets/tagletinheritdoc.vala
+libvaladoc/taglets/tagletinit.vala
+libvaladoc/taglets/tagletlink.vala
+libvaladoc/taglets/tagletparam.vala
+libvaladoc/taglets/tagletreturn.vala
+libvaladoc/taglets/tagletsee.vala
+libvaladoc/taglets/tagletsince.vala
+libvaladoc/taglets/tagletthrows.vala
+valadoc/doclets/devhelp/doclet.vala
+valadoc/doclets/gtkdoc/commentconverter.vala
+valadoc/doclets/gtkdoc/dbus.vala
+valadoc/doclets/gtkdoc/doclet.vala
+valadoc/doclets/gtkdoc/gcomment.vala
+valadoc/doclets/gtkdoc/generator.vala
+valadoc/doclets/gtkdoc/utils.vala
+valadoc/doclets/html/doclet.vala
+valadoc/driver.vala
+valadoc/girwriter.vala
+valadoc/initializerbuilder.vala
+valadoc/symbolresolver.vala
+valadoc/treebuilder.vala
+valadoc/valadoc.vala
+vala/valaaddressofexpression.vala
+vala/valaarraycopymethod.vala
+vala/valaarraycreationexpression.vala
+vala/valaarraylengthfield.vala
+vala/valaarraymovemethod.vala
+vala/valaarrayresizemethod.vala
+vala/valaarraytype.vala
+vala/valaassignment.vala
+vala/valaattribute.vala
+vala/valabaseaccess.vala
+vala/valabasicblock.vala
+vala/valabinaryexpression.vala
+vala/valablock.vala
+vala/valabooleanliteral.vala
+vala/valabooleantype.vala
+vala/valabreakstatement.vala
+vala/valacallabletype.vala
+vala/valacallable.vala
+vala/valacastexpression.vala
+vala/valacatchclause.vala
+vala/valacharacterliteral.vala
+vala/valaclasstype.vala
+vala/valaclass.vala
+vala/valacodecontext.vala
+vala/valacodegenerator.vala
+vala/valacodenode.vala
+vala/valacodevisitor.vala
+vala/valacodewriter.vala
+vala/valacomment.vala
+vala/valaconditionalexpression.vala
+vala/valaconstant.vala
+vala/valaconstructor.vala
+vala/valacontinuestatement.vala
+vala/valacreationmethod.vala
+vala/valadatatype.vala
+vala/valadeclarationstatement.vala
+vala/valadelegatetype.vala
+vala/valadelegate.vala
+vala/valadeletestatement.vala
+vala/valadestructor.vala
+vala/valadostatement.vala
+vala/valadynamicmethod.vala
+vala/valadynamicproperty.vala
+vala/valadynamicsignal.vala
+vala/valaelementaccess.vala
+vala/valaemptystatement.vala
+vala/valaenum.vala
+vala/valaenumvaluetype.vala
+vala/valaenumvalue.vala
+vala/valaerrorcode.vala
+vala/valaerrordomain.vala
+vala/valaerrortype.vala
+vala/valaexpressionstatement.vala
+vala/valaexpression.vala
+vala/valafieldprototype.vala
+vala/valafield.vala
+vala/valafloatingtype.vala
+vala/valaflowanalyzer.vala
+vala/valaforeachstatement.vala
+vala/valaforstatement.vala
+vala/valagenerictype.vala
+vala/valagenieparser.vala
+vala/valageniescanner.vala
+vala/valagenietokentype.vala
+vala/valagircomment.vala
+vala/valagirparser.vala
+vala/valaifstatement.vala
+vala/valainitializerlist.vala
+vala/valaintegerliteral.vala
+vala/valaintegertype.vala
+vala/valainterfacetype.vala
+vala/valainterface.vala
+vala/valainvalidtype.vala
+vala/valalambdaexpression.vala
+vala/valaliteral.vala
+vala/valalocalvariable.vala
+vala/valalockable.vala
+vala/valalockstatement.vala
+vala/valaloop.vala
+vala/valamarkupreader.vala
+vala/valamemberaccess.vala
+vala/valamemberinitializer.vala
+vala/valamethodcall.vala
+vala/valamethodtype.vala
+vala/valamethod.vala
+vala/valanamedargument.vala
+vala/valanamespace.vala
+vala/valanullliteral.vala
+vala/valanulltype.vala
+vala/valaobjectcreationexpression.vala
+vala/valaobjecttypesymbol.vala
+vala/valaobjecttype.vala
+vala/valaparameter.vala
+vala/valaparser.vala
+vala/valaphifunction.vala
+vala/valapointerindirection.vala
+vala/valapointertype.vala
+vala/valapostfixexpression.vala
+vala/valaprofile.vala
+vala/valapropertyaccessor.vala
+vala/valaproperty.vala
+vala/valarealliteral.vala
+vala/valareferencetransferexpression.vala
+vala/valareferencetype.vala
+vala/valaregexliteral.vala
+vala/valareport.vala
+vala/valareturnstatement.vala
+vala/valascanner.vala
+vala/valascope.vala
+vala/valasemanticanalyzer.vala
+vala/valasignaltype.vala
+vala/valasignal.vala
+vala/valasizeofexpression.vala
+vala/valasliceexpression.vala
+vala/valasourcefile.vala
+vala/valasourcelocation.vala
+vala/valasourcereference.vala
+vala/valastatementlist.vala
+vala/valastatement.vala
+vala/valastringliteral.vala
+vala/valastruct.vala
+vala/valastructvaluetype.vala
+vala/valasubroutine.vala
+vala/valaswitchlabel.vala
+vala/valaswitchsection.vala
+vala/valaswitchstatement.vala
+vala/valasymbolresolver.vala
+vala/valasymbol.vala
+vala/valatargetvalue.vala
+vala/valatemplate.vala
+vala/valathrowstatement.vala
+vala/valatokentype.vala
+vala/valatrystatement.vala
+vala/valatuple.vala
+vala/valatypecheck.vala
+vala/valatypeofexpression.vala
+vala/valatypeparameter.vala
+vala/valatypesymbol.vala
+vala/valaunaryexpression.vala
+vala/valaunlockstatement.vala
+vala/valaunresolvedsymbol.vala
+vala/valaunresolvedtype.vala
+vala/valausedattr.vala
+vala/valausingdirective.vala
+vala/valavaluetype.vala
+vala/valavariable.vala
+vala/valaversionattribute.vala
+vala/valavoidtype.vala
+vala/valawhilestatement.vala
+vala/valayieldstatement.vala
+vapigen/valagidlparser.vala
+vapigen/valavapicheck.vala
+vapigen/valavapigen.vala
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
new file mode 100644
index 000000000..e69de29bb
diff --git a/vala/Makefile.am b/vala/Makefile.am
index 585f10426..eb9ff746e 100644
--- a/vala/Makefile.am
+++ b/vala/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.common
NULL =
AM_CPPFLAGS = \
+ -include config.h \
$(COVERAGE_CFLAGS) \
-I$(top_srcdir)/gee \
$(GLIB_CFLAGS) \
diff --git a/valadoc/Makefile.am b/valadoc/Makefile.am
index 33f3a9375..caf3815c7 100644
--- a/valadoc/Makefile.am
+++ b/valadoc/Makefile.am
@@ -9,6 +9,7 @@ SUBDIRS = \
$(NULL)
AM_CFLAGS = \
+ -include config.h \
-DPACKAGE_DATADIR=\"$(libdir)/valadoc\" \
-DPACKAGE_VERSION=\"$(VERSION)\" \
-I$(top_srcdir)/libvaladoc/ \
diff --git a/valadoc/valadoc.vala b/valadoc/valadoc.vala
index 7e74a187b..840c092d2 100644
--- a/valadoc/valadoc.vala
+++ b/valadoc/valadoc.vala
@@ -293,7 +293,11 @@ public class ValaDoc : Object {
}
static int main (string[] args) {
+ // initialize locale
Intl.setlocale (LocaleCategory.ALL, "");
+ Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
+ Intl.textdomain (Config.GETTEXT_PACKAGE);
+
ErrorReporter reporter = new ErrorReporter();
try {
diff --git a/vapi/config.vapi b/vapi/config.vapi
index 543a92fa8..3b6e1049d 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -22,6 +22,7 @@
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
namespace Config {
+ public const string GETTEXT_PACKAGE;
public const string PACKAGE_DATADIR;
public const string PACKAGE_SUFFIX;
}
diff --git a/vapigen/Makefile.am b/vapigen/Makefile.am
index 1e262c1aa..0bf9e8eea 100644
--- a/vapigen/Makefile.am
+++ b/vapigen/Makefile.am
@@ -7,6 +7,7 @@ SUBDIRS = \
$(NULL)
AM_CPPFLAGS = \
+ -include config.h \
$(COVERAGE_CFLAGS) \
$(GLIB_CFLAGS) \
-I$(top_srcdir)/gee \
diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala
index f4ae9a50e..8c4b8fd79 100644
--- a/vapigen/valavapigen.vala
+++ b/vapigen/valavapigen.vala
@@ -216,7 +216,11 @@ class Vala.VAPIGen {
}
static int main (string[] args) {
+ // initialize locale
Intl.setlocale (LocaleCategory.ALL, "");
+ Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
+ Intl.textdomain (Config.GETTEXT_PACKAGE);
+
try {
var opt_context = new OptionContext ("- Vala API Generator");
opt_context.set_help_enabled (true);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]