GSettings translations added.

This commit is contained in:
Kolan Sh 2015-10-21 23:17:16 +03:00
parent a686100015
commit 258b5e9307
11 changed files with 121 additions and 14 deletions

3
.gitmodules vendored
View File

@ -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

View File

@ -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)

View File

@ -1,2 +1,2 @@
SET (GSchemaFile "ws.backbone.gsettings.glib.gschema.xml")
SET (GSchemaFile "ws.backbone.gschema-test.gschema.xml")
INCLUDE (GSchemaCommonRules)

View File

@ -1,28 +1,22 @@
<schemalist>
<schema id="org.example.glib-settings-schema-source" path="/org/example/my-app/" gettext-domain="my-app">
<schema id="ws.backbone.gschema-test" path="/ws/backbone/gschema-test/" gettext-domain="gschema-test-0">
<key name="greeting" type="s">
<default l10n="messages">"Hello, earthlings"</default>
<summary>A greeting</summary>
<description>
Greeting of the invading martians
</description>
<description>Greeting of the invading martians</description>
</key>
<key name="bottles-of-beer" type="i">
<default>99</default>
<summary>Bottles of beer</summary>
<description>
Number of bottles of beer on the wall
</description>
<description>Number of bottles of beer on the wall</description>
</key>
<key name="lighting" type="b">
<default>false</default>
<summary>Is the light switched on?</summary>
<description>
State of an imaginary light switch.
</description>
<description>State of an imaginary light switch.</description>
</key>
</schema>

1
po/CMakeLists.txt Normal file
View File

@ -0,0 +1 @@
INCLUDE (GettextCommonRules)

50
po/gschema-test-0.pot Normal file
View File

@ -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 <EMAIL@ADDRESS>, 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 <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"
#: 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 ""

1
po/ru/CMakeLists.txt Normal file
View File

@ -0,0 +1 @@
INCLUDE (GettextLangRules)

54
po/ru/gschema-test-0.po Normal file
View File

@ -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.
# <backbone@backbone.ws>, 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: <backbone@backbone.ws>\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 "кнопка"

View File

@ -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);

1
util/backbone Submodule

@ -0,0 +1 @@
Subproject commit 4a53bfb279f13ff3e21a8f57d3c34ef8c213f235

2
valadoc_env Normal file
View File

@ -0,0 +1,2 @@
BASEDIR=src
PKGS=gio-2.0