Commit 33368767 authored by Martin Kröning's avatar Martin Kröning

Merge branch 'localisation' into 'master'

German translation

See merge request !1
parents 2e418c13 fb4a4a88
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<interface domain="pi2-view">
<requires lib="gtk+" version="3.20"/>
<object class="GtkWindow">
<property name="can_focus">False</property>
......@@ -31,7 +31,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Scale:</property>
<property name="label" translatable="yes" context="Label for ComboBox">Zoom Level</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -61,7 +61,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Time: </property>
<property name="label" translatable="yes" context="Label for digital clock">Simulation Time</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -73,7 +73,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">00:00</property>
<property name="label">00:00</property>
<attributes>
<attribute name="font-desc" value="Monospace 10"/>
</attributes>
......@@ -99,7 +99,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Drives on: </property>
<property name="label" translatable="yes" context="Driving on $lane">Driving on</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -111,7 +111,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">lane</property>
<property name="label" translatable="yes" context="Placeholder for lane name">Lane</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -123,7 +123,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Position on Lane: </property>
<property name="label" translatable="yes" context="Label for percentage">Completion of Lane</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -135,7 +135,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes"> 0 %</property>
<property name="label"> 0 %</property>
<attributes>
<attribute name="font-desc" value="Monospace 10"/>
</attributes>
......@@ -150,7 +150,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Speed: </property>
<property name="label" translatable="yes" context="Label for speed in km/h">Speed</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -162,7 +162,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">0.00 km/h</property>
<property name="label">0.00 km/h</property>
<attributes>
<attribute name="font-desc" value="Monospace 10"/>
</attributes>
......@@ -177,7 +177,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Remaining fuel: </property>
<property name="label" translatable="yes" context="Label for fuel in l">Remaining Fuel</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -189,7 +189,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">0.00 l</property>
<property name="label">0.00 l</property>
<attributes>
<attribute name="font-desc" value="Monospace 10"/>
</attributes>
......
......@@ -15,6 +15,7 @@ public:
static void removeWindow(Gtk::Window &window);
private:
static void initGettext();
static Glib::RefPtr<Gtk::Application> application;
static std::thread thread;
};
subdir('po')
pi2_view_inc = include_directories('include')
pi2_view_src = files(
'src/Drawable.cpp',
......
# keep this file sorted alphabetically, one language code per line
de
pi2-view/data/pi2-view.glade
# German pi2-view translation.
#
msgid ""
msgstr ""
"Project-Id-Version: pi2-view\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-03-27 15:34+0100\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: pi2-view/data/pi2-view.glade:34
msgctxt "Label for ComboBox"
msgid "Zoom Level"
msgstr "Vergrößerungsstufe"
#: pi2-view/data/pi2-view.glade:64
msgctxt "Label for digital clock"
msgid "Simulation Time"
msgstr "Simulationszeit"
#: pi2-view/data/pi2-view.glade:102
msgctxt "Driving on $lane"
msgid "Driving on"
msgstr "Fährt auf"
#: pi2-view/data/pi2-view.glade:114
msgctxt "Placeholder for lane name"
msgid "Lane"
msgstr "Spur"
#: pi2-view/data/pi2-view.glade:126
msgctxt "Label for percentage"
msgid "Completion of Lane"
msgstr "Absolvierung der Spur"
#: pi2-view/data/pi2-view.glade:153
msgctxt "Label for speed in km/h"
msgid "Speed"
msgstr "Geschwindigkeit"
#: pi2-view/data/pi2-view.glade:180
msgctxt "Label for fuel in l"
msgid "Remaining Fuel"
msgstr "Verbleibender Treibstoff"
i18n = import('i18n')
# define GETTEXT_PACKAGE
add_project_arguments('-DGETTEXT_PACKAGE="pi2-view"', language:'c')
i18n.gettext(meson.project_name(),
args: '--directory=' + meson.source_root()
)
#include "MapApplication.hpp"
#include <glibmm/i18n.h>
#include <glibmm/refptr.h>
#include <gtkmm/application.h>
#include <gtkmm/window.h>
#include <vector>
Glib::RefPtr<Gtk::Application> MapApplication::application =
Gtk::Application::create();
void MapApplication::initGettext() {
#ifdef G_OS_WIN32
gchar *win32_dir = g_win32_get_package_installation_directory_of_module(NULL);
bindtextdomain("pi2-view",
g_build_filename(win32_dir, "share", "locale", NULL));
g_free(win32_dir);
#endif /* G_OS_WIN32 */
bind_textdomain_codeset("pi2-view", "UTF-8");
}
Glib::RefPtr<Gtk::Application> MapApplication::application = []() {
initGettext();
return Gtk::Application::create();
}();
std::thread MapApplication::thread;
void MapApplication::addWindow(Gtk::Window &window) {
......
......@@ -35,8 +35,9 @@ MapWindow::MapWindow(std::string windowTitle)
remainingFuelLabel(nullptr), zoomComboBoxText(nullptr) {
set_title(std::move(windowTitle));
auto builder =
Gtk::Builder::create_from_resource("/pi2-view/pi2-view.glade", "box");
auto builder = Gtk::Builder::create();
builder->set_translation_domain("pi2-view");
builder->add_from_resource("/pi2-view/pi2-view.glade", "box");
Gtk::Box *box;
builder->get_widget("box", box);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment