Skip to content

Commit

Permalink
Wip add translation with gettext
Browse files Browse the repository at this point in the history
  • Loading branch information
np authored and allinurl committed Apr 4, 2017
1 parent 04190f3 commit 61e8684
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,14 @@ AM_CFLAGS += -Wbad-function-cast -Winline -Wcast-align -Wextra
AM_CFLAGS += -Wdeclaration-after-statement -Wno-missing-field-initializers

dist_man_MANS = goaccess.1

SUBDIRS = po


ACLOCAL_AMFLAGS = -I m4
datadir = @datadir@
datarootdir= @datarootdir@
localedir = @localedir@
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@

EXTRA_DIST = config.rpath m4/ChangeLog
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/goaccess.c])
AC_CONFIG_HEADERS([src/config.h])

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19])

# Use empty CFLAGS by default so autoconf does not add
# CFLAGS="-O2 -g"
: ${CFLAGS=""}
Expand Down Expand Up @@ -271,7 +274,7 @@ AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([strtol])
AC_CHECK_FUNCS([strtoull])

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile po/Makefile.in])
AC_OUTPUT

cat << EOF
Expand Down
1 change: 1 addition & 0 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fr
85 changes: 85 additions & 0 deletions po/Makevars
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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 = ..
AM_CPPFLAGS = -I. -I$(srcdir)

# These options get passed to xgettext.
#XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --add-comments
XGETTEXT_OPTIONS = \
--keyword=_ --flag=_:1:pass-c-format \
--keyword=N_ --flag=N_:1:pass-c-format \
--keyword=__ --flag=__:1:pass-c-format
--keyword=R_ --flag=R_:1:pass-c-format


# 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 = Free Software Foundation, Inc.

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

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

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

# 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
2 changes: 2 additions & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
../src/goaccess.c \
../src/ui.h
95 changes: 95 additions & 0 deletions po/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the goaccess package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# Nicolas P <np>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: goaccess 1.2\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-04-02 20:11+0200\n"
"PO-Revision-Date: 2017-04-02 17:37+0200\n"
"Last-Translator: Nicolas P <np>\n"
"Language-Team: français <>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Gtranslator 2.91.7\n"

#: src/goaccess.c:1428
msgid "Hello, world!"
msgstr "bonj"

#: src/ui.h:69
msgid "Date/Time"
msgstr "Date/Heure"

#: src/ui.h:70
msgid "Total Requests"
msgstr "Temps de calcul"

#: src/ui.h:71
msgid "Init. Proc. Time"
msgstr "Requètes échouées"

#: src/ui.h:72
msgid "Failed Requests"
msgstr "Requètes échouées"

#: src/ui.h:73
msgid "Valid Requests"
msgstr "Requètes valides"

#: src/ui.h:74
msgid "Unique Visitors"
msgstr "Visiteurs uniques"

#: src/ui.h:75
msgid "Unique Files"
msgstr "Fichiers uniques"

#: src/ui.h:76
msgid "Excl. IP Hits"
msgstr "Excl. IP Hits"

#: src/ui.h:77
msgid "Referrers"
msgstr "Origine"

#: src/ui.h:78
msgid "Unique 404"
msgstr "Unique 404"

#: src/ui.h:79
msgid "Static Files"
msgstr "Fichiers statiques"

#: src/ui.h:80
msgid "Log Size"
msgstr "Taille du log"

#: src/ui.h:81
msgid "Bandwidth"
msgstr "Bande passante"

#: src/ui.h:82
msgid "Log Source"
msgstr "Fichier de log"

#: src/ui.h:92
msgid "Unique visitors per day"
msgstr "Visiteurs uniques par jour"

#~ msgid "visitors"
#~ msgstr "visitors"

#~ msgid "Visitors"
#~ msgstr "Visiteurs"

#~ msgid "Hits having the same IP, date and agent are a unique visit."
#~ msgstr ""
#~ "Les hits depuis la même IP, date et user-agent comptent comme visite "
#~ "unique"
82 changes: 82 additions & 0 deletions po/goaccess.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the goaccess package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: goaccess 1.2\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-04-02 20:11+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/goaccess.c:1428
msgid "Hello, world!"
msgstr ""

#: src/ui.h:69
msgid "Date/Time"
msgstr ""

#: src/ui.h:70
msgid "Total Requests"
msgstr ""

#: src/ui.h:71
msgid "Init. Proc. Time"
msgstr ""

#: src/ui.h:72
msgid "Failed Requests"
msgstr ""

#: src/ui.h:73
msgid "Valid Requests"
msgstr ""

#: src/ui.h:74
msgid "Unique Visitors"
msgstr ""

#: src/ui.h:75
msgid "Unique Files"
msgstr ""

#: src/ui.h:76
msgid "Excl. IP Hits"
msgstr ""

#: src/ui.h:77
msgid "Referrers"
msgstr ""

#: src/ui.h:78
msgid "Unique 404"
msgstr ""

#: src/ui.h:79
msgid "Static Files"
msgstr ""

#: src/ui.h:80
msgid "Log Size"
msgstr ""

#: src/ui.h:81
msgid "Bandwidth"
msgstr ""

#: src/ui.h:82
msgid "Log Source"
msgstr ""

#: src/ui.h:92
msgid "Unique visitors per day"
msgstr ""

0 comments on commit 61e8684

Please sign in to comment.