Compare commits
3 Commits
592dcbae53
...
b2ffc709bb
Author | SHA1 | Date | |
---|---|---|---|
b2ffc709bb | |||
b6c6262662 | |||
c70f99a283 |
@ -37,7 +37,6 @@ else(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-DGETTEXT_PACKAGE=\"gds-render\" -DLOCALEDATADIR=\"/usr/share\")
|
||||
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
||||
|
||||
add_subdirectory(resources)
|
||||
add_subdirectory(doxygen)
|
||||
add_subdirectory(version)
|
||||
|
8
main.c
8
main.c
@ -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"},
|
||||
|
19
translations/generate_templates.sh
Executable file
19
translations/generate_templates.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"
|
||||
cd "$DIR"
|
||||
|
||||
files=`find ../ -name "*.c"`
|
||||
mkdir -p "pot"
|
||||
|
||||
for file in $files; do
|
||||
pot="pot/"$(echo "${file#*/}" | sed -e "s/\//_/g")
|
||||
pot="${pot%.c}.pot"
|
||||
xgettext --keyword=_ --language=C --add-comments --sort-output -o "$pot" "$file"
|
||||
done
|
44
translations/pot/main.pot
Normal file
44
translations/pot/main.pot
Normal 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 ""
|
47
translations/pot/po/de/main.po
Normal file
47
translations/pot/po/de/main.po
Normal 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."
|
33
translations/pot/prepare_language.sh
Executable file
33
translations/pot/prepare_language.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
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
|
Loading…
Reference in New Issue
Block a user