diff --git a/meson.build b/meson.build index 802607b..c192dc5 100644 --- a/meson.build +++ b/meson.build @@ -17,6 +17,31 @@ add_project_arguments( ['--vapidir', meson.current_source_dir() / 'vapi'], language: 'vala' ) + +conf = configuration_data() +# Get the package data directory under Meson +pkgdatadir = join_paths([ get_option('prefix'), + get_option('datadir'), + meson.project_name() ]) + +conf.set_quoted('PKGDATADIR', pkgdatadir) +conf.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir'))) + +# Other configs +conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) +add_global_arguments('-DDATADIR="' + get_option('datadir') + '"', language: 'c') +configure_file(output: 'config.h', configuration: conf) +config_h_dir = include_directories('.') + +# Arguments for C +c_args = [ + '-include', 'config.h', + '-w' +] + +# Arguments for Vala +vala_args = ['--target-glib=2.50', meson.source_root() + '/vapi/config.vapi'] + # Listing dependencies dependencies = [ dependency ('glib-2.0'), @@ -34,6 +59,7 @@ executable ( meson.project_name (), sources, dependencies: dependencies, + c_args: c_args, vala_args: vala_args, install: true ) diff --git a/po/LINGUAS b/po/LINGUAS index b25ae57..cc314dd 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -1,2 +1,3 @@ fr nl +ru \ No newline at end of file diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 0000000..a4725b2 --- /dev/null +++ b/po/ru.po @@ -0,0 +1,124 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2022-10-08 13:49+0800\n" +"PO-Revision-Date: 2022-10-08 13:51+0800\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ru_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<12 || n%100>14) ? 1 : 2);\n" +"X-Generator: Poedit 3.1.1\n" +"X-Poedit-Basepath: ../src\n" +"X-Poedit-SearchPath-0: MainWindow.vala\n" + +#: MainWindow.vala:33 +msgid "Raddiola" +msgstr "" + +#: MainWindow.vala:74 +msgid "Back" +msgstr "Назад" + +#: MainWindow.vala:75 +msgid "Add station" +msgstr "Добавить станцию" + +#: MainWindow.vala:76 +msgid "Delete station" +msgstr "Удалить станцию" + +#: MainWindow.vala:77 +msgid "Edit station" +msgstr "Редактировать станцию" + +#: MainWindow.vala:78 +msgid "Play" +msgstr "Воспроизвести" + +#: MainWindow.vala:79 +msgid "Stop" +msgstr "Остановить" + +#: MainWindow.vala:80 +msgid "Start recording" +msgstr "Начать запись" + +#: MainWindow.vala:81 +msgid "Stop recording" +msgstr "Остановить запись" + +#: MainWindow.vala:82 +msgid "Open the Records folder" +msgstr "Открыть папку с записями" + +#: MainWindow.vala:131 +msgid "_Name:" +msgstr "_Название:" + +#: MainWindow.vala:144 +msgid "_URL:" +msgstr "" + +#: MainWindow.vala:149 +msgid "OK" +msgstr "" + +#: MainWindow.vala:164 MainWindow.vala:284 MainWindow.vala:313 +#: MainWindow.vala:324 MainWindow.vala:339 MainWindow.vala:441 +#, c-format +msgid "Error: %s" +msgstr "Ошибка: \"%s\"" + +#: MainWindow.vala:179 MainWindow.vala:212 MainWindow.vala:273 +#: MainWindow.vala:363 +msgid "Please choose a station" +msgstr "Пожалуйста, выберите станцию" + +#: MainWindow.vala:291 +msgid "Please enter the name" +msgstr "Пожалуйста, введите название" + +#: MainWindow.vala:296 +msgid "Please enter the url" +msgstr "Пожалуйста, введите url" + +#: MainWindow.vala:307 +msgid "Rename failed" +msgstr "Не удалось переименовать" + +#: MainWindow.vala:317 MainWindow.vala:332 +msgid "A station with the same name already exists" +msgstr "Станция с таким названием уже существует" + +#: MainWindow.vala:342 +msgid "Add failed" +msgstr "Не удалось добавить" + +#: MainWindow.vala:368 +msgid "Question" +msgstr "Вопрос" + +#: MainWindow.vala:368 +#, c-format +msgid "Delete station %s ?" +msgstr "Удалить станцию \"%s\"?" + +#: MainWindow.vala:369 +msgid "No" +msgstr "Нет" + +#: MainWindow.vala:370 +msgid "Delete" +msgstr "Удалить" + +#: MainWindow.vala:380 +msgid "Delete failed" +msgstr "Не удалось удалить" + +#: MainWindow.vala:446 +msgid "Message" +msgstr "Сообщение" diff --git a/src/Application.vala b/src/Application.vala index 644d272..46a6328 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -19,6 +19,9 @@ namespace Raddiola { } public static int main(string[] args) { + Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR); + Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8"); + Intl.textdomain (Config.GETTEXT_PACKAGE); Gst.init (ref args); var app = new Raddiola.Application(); return app.run(args); diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 93dfe7c..c73e60a 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -77,9 +77,9 @@ private int mode; edit_button.set_tooltip_text(_("Edit station")); play_button.set_tooltip_text(_("Play")); stop_button.set_tooltip_text(_("Stop")); - record_button.set_tooltip_text("Start recording"); - stop_record_button.set_tooltip_text("Stop recording"); - open_directory_button.set_tooltip_text("Open the Records folder"); + record_button.set_tooltip_text(_("Start recording")); + stop_record_button.set_tooltip_text(_("Stop recording")); + open_directory_button.set_tooltip_text(_("Open the Records folder")); back_button.clicked.connect(on_back_clicked); add_button.clicked.connect(on_add_clicked); delete_button.clicked.connect(on_delete_dialog); diff --git a/vapi/config.vapi b/vapi/config.vapi new file mode 100644 index 0000000..17dc3b2 --- /dev/null +++ b/vapi/config.vapi @@ -0,0 +1,5 @@ +[CCode (lower_case_cprefix = "", cheader_filename = "config.h")] +namespace Config { + public const string GETTEXT_PACKAGE; + public const string LOCALEDIR; +}