Started first translation approach

This commit is contained in:
Mario Hüttel 2019-10-18 21:19:29 +02:00
parent b6c6262662
commit b2ffc709bb
4 changed files with 117 additions and 4 deletions

8
main.c
View File

@ -197,10 +197,6 @@ static int start_gui(int argc, char **argv)
GMenu *m_quit;
GMenu *m_about;
bindtextdomain(GETTEXT_PACKAGE, LOCALEDATADIR "/locale");
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
/*
* Generate version dependent application id
* This allows running the application in different versions at the same time.
@ -273,6 +269,10 @@ int main(int argc, char **argv)
int scale = 1000;
int app_status = 0;
bindtextdomain(GETTEXT_PACKAGE, LOCALEDATADIR "/locale");
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
GOptionEntry entries[] = {
{"version", 'v', 0, G_OPTION_ARG_NONE, &version, "Print version", NULL},
{"renderer", 'r', 0, G_OPTION_ARG_STRING_ARRAY, &renderer_args, "Renderer to use. Can be used multiple times.", "pdf|svg|tikz|ext"},

44
translations/pot/main.pot Normal file
View File

@ -0,0 +1,44 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-18 20:50+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../main.c:99
#, c-format
msgid ""
"\n"
"\n"
"Full git commit: %s"
msgstr ""
#: ../main.c:118
#, c-format
msgid "Logo could not be displayed: %s\n"
msgstr ""
#: ../main.c:219
#, c-format
msgid ""
"There is already an open instance. Will open second window in that "
"instance.\n"
msgstr ""
#: ../main.c:98
msgid ""
"gds-render is a free tool for rendering GDS2 layout files into vector "
"graphics."
msgstr ""

View File

@ -0,0 +1,47 @@
# German translations for gds-render package.
# Copyright (C) 2019 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the gds-render package.
# Mario Hüttel <mario.huettel@gmx.net>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: gds-render VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-18 20:32+0200\n"
"PO-Revision-Date: 2019-10-18 20:49+0200\n"
"Last-Translator: <mario.huettel@gmx.net>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
"Language: de\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"
#: ../main.c:99
#, c-format
msgid ""
"\n"
"\n"
"Full git commit: %s"
msgstr ""
"\n"
"\n"
"Vollständige git Commit-ID %s"
#: ../main.c:118
#, c-format
msgid "Logo could not be displayed: %s\n"
msgstr "Logo konnte nicht angezeigt werden: %s\n"
#: ../main.c:219
#, c-format
msgid ""
"There is already an open instance. Will open second window in that "
"instance.\n"
msgstr "Es is bereits eine Instanz dieses Programms geöffnet. Ein weiteres Fenster in dieser wird geöffnet.\n"
#: ../main.c:98
msgid ""
"gds-render is a free tool for rendering GDS2 layout files into vector "
"graphics."
msgstr "gds-render is ein freies Werkzeug zum Wandeln von GDS2 Layouts in Vektorgrafiken."

View File

@ -9,3 +9,25 @@ done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"
cd "$DIR"
if [ -z $1 ]; then
echo "Please specify language code to generate/update"
fi
locale="$1"
podir="./po/$locale"
echo "Selected locale: $locale"
mkdir -p "$podir"
pots=`find . -name '*.pot'`
for pot in $pots; do
po=`echo "$podir/${pot%.pot}.po" | sed -e "s/\/.\//\//g"`
echo -n "$po: "
if [ -f "$po" ]; then
echo "update"
msgmerge --update "$po" "$pot"
else
echo "generate"
msginit --input="$pot" --locale="$locale" --output="$po"
fi
done