From d950f0a7a2df33c8e9bf4bf9c6ac624a69058ad1 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 1 Nov 2018 22:08:06 -0300 Subject: [PATCH] make translations optional --- meson.build | 4 ++-- meson_options.txt | 4 ++++ po/POTFILES | 2 +- po/es.po | 21 ++++++++++----------- po/meson.build | 11 +++++++---- po/sernatur.pot | 18 +++++++----------- 6 files changed, 31 insertions(+), 29 deletions(-) diff --git a/meson.build b/meson.build index 8e28b77..ef28866 100644 --- a/meson.build +++ b/meson.build @@ -14,8 +14,8 @@ add_project_arguments(['--vapidir', join_paths(meson.current_source_dir(), 'src/vapi')], language: 'vala') -#subdir('po') +subdir('po') subdir('data') subdir('src') -#subdir('doc') +subdir('doc') subdir('script') diff --git a/meson_options.txt b/meson_options.txt index d0a845f..4640747 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,3 +10,7 @@ option('bundle_libs', type: 'boolean', value: false, description: 'Bundle the libs that the executable is linked against') +option('install_translations', + type: 'boolean', + value: true, + description: 'Install translation files') diff --git a/po/POTFILES b/po/POTFILES index 11d7560..165e401 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,4 +1,4 @@ src/sernatur.vala src/sernatur-window.vala data/ui/sernatur.window.ui -data/cl.cromer.ubb.sernatur.gschema.xml +data/gschema/cl.cromer.ubb.sernatur.gschema.xml diff --git a/po/es.po b/po/es.po index 925eaaf..8c2279b 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: sernatur\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-11-01 18:21-0300\n" +"POT-Creation-Date: 2018-11-01 22:00-0300\n" "PO-Revision-Date: 2018-10-31 18:05-0300\n" "Last-Translator: Chris Cromer \n" "Language-Team: none\n" @@ -18,15 +18,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 2.0.6\n" -#: src/sernatur-window.vala:84 +#: src/sernatur-window.vala:81 msgid "Error" msgstr "Error" -#: src/sernatur-window.vala:96 -msgid "Connection failed" -msgstr "Conexión falló" - -#: src/sernatur-window.vala:124 +#: src/sernatur-window.vala:109 msgid "Server version:" msgstr "Versión del servidor:" @@ -46,12 +42,15 @@ msgstr "" msgid "_Help" msgstr "" -#: data/cl.cromer.ubb.sernatur.gschema.xml:5 -#: data/cl.cromer.ubb.sernatur.gschema.xml:6 +#: data/gschema/cl.cromer.ubb.sernatur.gschema.xml:5 +#: data/gschema/cl.cromer.ubb.sernatur.gschema.xml:6 msgid "Host to connect to" msgstr "" -#: data/cl.cromer.ubb.sernatur.gschema.xml:12 -#: data/cl.cromer.ubb.sernatur.gschema.xml:13 +#: data/gschema/cl.cromer.ubb.sernatur.gschema.xml:12 +#: data/gschema/cl.cromer.ubb.sernatur.gschema.xml:13 msgid "Port number to use" msgstr "" + +#~ msgid "Connection failed" +#~ msgstr "Conexión falló" diff --git a/po/meson.build b/po/meson.build index 7ee0972..174a3e4 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,4 +1,7 @@ -i18n = import('i18n') -i18n.gettext(meson.project_name(), - args: '--directory=' + meson.source_root() -) +install_translations = get_option('install_translations') +if install_translations + i18n = import('i18n') + i18n.gettext(meson.project_name(), + args: '--directory=' + meson.source_root() + ) +endif diff --git a/po/sernatur.pot b/po/sernatur.pot index b23ea71..c44e529 100644 --- a/po/sernatur.pot +++ b/po/sernatur.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: sernatur\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-11-01 18:21-0300\n" +"POT-Creation-Date: 2018-11-01 22:00-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,15 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/sernatur-window.vala:84 +#: src/sernatur-window.vala:81 msgid "Error" msgstr "" -#: src/sernatur-window.vala:96 -msgid "Connection failed" -msgstr "" - -#: src/sernatur-window.vala:124 +#: src/sernatur-window.vala:109 msgid "Server version:" msgstr "" @@ -45,12 +41,12 @@ msgstr "" msgid "_Help" msgstr "" -#: data/cl.cromer.ubb.sernatur.gschema.xml:5 -#: data/cl.cromer.ubb.sernatur.gschema.xml:6 +#: data/gschema/cl.cromer.ubb.sernatur.gschema.xml:5 +#: data/gschema/cl.cromer.ubb.sernatur.gschema.xml:6 msgid "Host to connect to" msgstr "" -#: data/cl.cromer.ubb.sernatur.gschema.xml:12 -#: data/cl.cromer.ubb.sernatur.gschema.xml:13 +#: data/gschema/cl.cromer.ubb.sernatur.gschema.xml:12 +#: data/gschema/cl.cromer.ubb.sernatur.gschema.xml:13 msgid "Port number to use" msgstr ""