diff --git a/.gitmodules b/.gitmodules index 5c36f7e..309b0cd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "cmake/backbone"] path = cmake/backbone url = git@git.backbone.ws:cmake/backbone.git +[submodule "util/backbone"] + path = util/backbone + url = git@git.backbone.ws:cmake/backbone-utils.git diff --git a/CMakeLists.txt b/CMakeLists.txt index be92415..1a80667 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ SET (PATCH 0) LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/backbone) ADD_SUBDIRECTORY (config) +ADD_SUBDIRECTORY (po) ADD_SUBDIRECTORY (src) ADD_SUBDIRECTORY (pkg-config) ADD_SUBDIRECTORY (cpack) diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index c128bbd..0176ae1 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -1,2 +1,2 @@ -SET (GSchemaFile "ws.backbone.gsettings.glib.gschema.xml") +SET (GSchemaFile "ws.backbone.gschema-test.gschema.xml") INCLUDE (GSchemaCommonRules) diff --git a/config/ws.backbone.gsettings.glib.gschema.xml b/config/ws.backbone.gschema-test.gschema.xml similarity index 53% rename from config/ws.backbone.gsettings.glib.gschema.xml rename to config/ws.backbone.gschema-test.gschema.xml index a4d432b..17b1268 100644 --- a/config/ws.backbone.gsettings.glib.gschema.xml +++ b/config/ws.backbone.gschema-test.gschema.xml @@ -1,28 +1,22 @@ - + "Hello, earthlings" A greeting - - Greeting of the invading martians - + Greeting of the invading martians 99 Bottles of beer - - Number of bottles of beer on the wall - + Number of bottles of beer on the wall false Is the light switched on? - - State of an imaginary light switch. - + State of an imaginary light switch. diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..c191c1b --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1 @@ +INCLUDE (GettextCommonRules) diff --git a/po/gschema-test-0.pot b/po/gschema-test-0.pot new file mode 100644 index 0000000..98fb54d --- /dev/null +++ b/po/gschema-test-0.pot @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the gschema-test-0 package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: gschema-test-0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-22 23:08+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: config/ws.backbone.gschema-test.gschema.xml.h:1 +msgid "\"Hello, earthlings\"" +msgstr "" + +#: config/ws.backbone.gschema-test.gschema.xml.h:2 +msgid "A greeting" +msgstr "" + +#: config/ws.backbone.gschema-test.gschema.xml.h:3 +msgid "Greeting of the invading martians" +msgstr "" + +#: config/ws.backbone.gschema-test.gschema.xml.h:4 +msgid "Bottles of beer" +msgstr "" + +#: config/ws.backbone.gschema-test.gschema.xml.h:5 +msgid "Number of bottles of beer on the wall" +msgstr "" + +#: config/ws.backbone.gschema-test.gschema.xml.h:6 +msgid "Is the light switched on?" +msgstr "" + +#: config/ws.backbone.gschema-test.gschema.xml.h:7 +msgid "State of an imaginary light switch." +msgstr "" + +#: src/GLib.Settings.vala:22 +msgid "greeting" +msgstr "" diff --git a/po/ru/CMakeLists.txt b/po/ru/CMakeLists.txt new file mode 100644 index 0000000..0b6020c --- /dev/null +++ b/po/ru/CMakeLists.txt @@ -0,0 +1 @@ +INCLUDE (GettextLangRules) diff --git a/po/ru/gschema-test-0.po b/po/ru/gschema-test-0.po new file mode 100644 index 0000000..4e28a4c --- /dev/null +++ b/po/ru/gschema-test-0.po @@ -0,0 +1,54 @@ +# Russian translations for gschema-test-0 package. +# Copyright (C) 2015 THE gschema-test-0'S COPYRIGHT HOLDER +# This file is distributed under the same license as the gschema-test-0 package. +# , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: gschema-test-0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-22 23:08+0300\n" +"PO-Revision-Date: 2015-10-22 22:33+0300\n" +"Last-Translator: \n" +"Language-Team: Russian\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: config/ws.backbone.gschema-test.gschema.xml.h:1 +msgid "\"Hello, earthlings\"" +msgstr "\"Привет, земляне\"" + +#: config/ws.backbone.gschema-test.gschema.xml.h:2 +msgid "A greeting" +msgstr "Приветствие" + +#: config/ws.backbone.gschema-test.gschema.xml.h:3 +msgid "Greeting of the invading martians" +msgstr "Приветствие вторгнушихся марсиан" + +#: config/ws.backbone.gschema-test.gschema.xml.h:4 +msgid "Bottles of beer" +msgstr "Бутылки пива" + +#: config/ws.backbone.gschema-test.gschema.xml.h:5 +msgid "Number of bottles of beer on the wall" +msgstr "Число бутылок пива на стене" + +#: config/ws.backbone.gschema-test.gschema.xml.h:6 +msgid "Is the light switched on?" +msgstr "Включен ли свет?" + +#: config/ws.backbone.gschema-test.gschema.xml.h:7 +msgid "State of an imaginary light switch." +msgstr "Состояние воображаемого выключателя света" + +#: src/GLib.Settings.vala:22 +msgid "greeting" +msgstr "приветствие" + +#~ msgid "button" +#~ msgstr "кнопка" diff --git a/src/GLib.Settings.vala b/src/GLib.Settings.vala index 0093d42..dc7f8bb 100644 --- a/src/GLib.Settings.vala +++ b/src/GLib.Settings.vala @@ -5,7 +5,7 @@ public static int main (string[] args) { string settings_dir = Path.build_path (Path.DIR_SEPARATOR_S, exec_file.get_parent().get_parent().get_path(), "share/glib-2.0/schemas"); SettingsSchemaSource sss = new SettingsSchemaSource.from_directory (settings_dir, null, false); - SettingsSchema schema = sss.lookup ("org.example.glib-settings-schema-source", false); + SettingsSchema schema = sss.lookup ("ws.backbone.gschema-test", false); if (sss.lookup == null) { stdout.printf ("ID not found."); return 0; @@ -19,7 +19,7 @@ public static int main (string[] args) { // Output: ``Hello, earthlings`` - string greeting = settings.get_string ("greeting"); + string greeting = settings.get_string (_("greeting")); stdout.printf ("%s\n", greeting); // Output: ``99`` @@ -55,7 +55,7 @@ public static int main (string[] args) { settings.set_string ("greeting", "hello, world"); - stdout.puts ("\nPlease start 'dconf-editor' and edit keys in /org/example/my-app/\n"); + stdout.puts ("\nPlease start 'dconf-editor' and edit keys in /ws/backbone/gschema-test/\n"); new MainLoop ().run (); } catch (Error e) { stdout.printf ("Error: %s\n", e.message); diff --git a/util/backbone b/util/backbone new file mode 160000 index 0000000..4a53bfb --- /dev/null +++ b/util/backbone @@ -0,0 +1 @@ +Subproject commit 4a53bfb279f13ff3e21a8f57d3c34ef8c213f235 diff --git a/valadoc_env b/valadoc_env new file mode 100644 index 0000000..e9c3820 --- /dev/null +++ b/valadoc_env @@ -0,0 +1,2 @@ +BASEDIR=src +PKGS=gio-2.0