From 54d35f2e6096ec34ca13efedf2c520842eb4b507 Mon Sep 17 00:00:00 2001 From: sfs-pra Date: Wed, 6 Aug 2025 15:02:30 +0300 Subject: [PATCH 1/3] Fix i18n & make PKGBUILD --- PKGBUILD | 30 ++++++++++++++++++++++++++++++ main.c | 9 +++++++-- meson.build | 3 ++- test_basic.c | 8 +++++--- 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 PKGBUILD diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..82b5374 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: sfslinux@gmail.com + +pkgname=screentest +pkgver=3.0.r5.gf30e3fc +pkgrel=3 +pkgdesc="tesing the quality of CRT/LCD screens" +arch=('x86_64') +#url="https://github.com/TobiX/screentest" +url="https://github.com/sfs-pra/screentest" +license=('GPL2') +depends=('gtk3' ) +makedepends=('meson') +source=(git+$url) +sha256sums=('SKIP') + +pkgver() { + cd $pkgname + git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { + cd $pkgname + meson build --prefix /usr + meson compile -C build +} + +package() { + cd $pkgname + DESTDIR="$pkgdir" meson install -C build +} diff --git a/main.c b/main.c index 5e1dec0..a8cd83d 100644 --- a/main.c +++ b/main.c @@ -20,18 +20,23 @@ #include +#include +#include +#include + #include #include -#include "gettext.h" +//#include "gettext.h" #include "main.h" -#define _(String) gettext(String) +//#define _(String) gettext(String) GtkBuilder *builder; int main(int argc, char *argv[]) { guint err; + setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); bind_textdomain_codeset(PACKAGE, "UTF-8"); textdomain(PACKAGE); diff --git a/meson.build b/meson.build index 7ca4a4c..fb6dbc0 100644 --- a/meson.build +++ b/meson.build @@ -19,10 +19,11 @@ screentest_deps = [ prefix = get_option('prefix') datadir = join_paths(prefix, get_option('datadir')) localdir = join_paths(datadir, 'local') +localedir = get_option('prefix') / get_option('localedir') config_h = configuration_data() config_h.set_quoted('DATADIR', datadir) -config_h.set_quoted('LOCALEDIR', localdir) +config_h.set_quoted('LOCALEDIR', localedir) config_h.set_quoted('PACKAGE', meson.project_name()) config_h.set_quoted('PACKAGE_NAME', meson.project_name()) config_h.set_quoted('VERSION', meson.project_version()) diff --git a/test_basic.c b/test_basic.c index f3fec05..dad71a7 100644 --- a/test_basic.c +++ b/test_basic.c @@ -23,12 +23,14 @@ #include #include +#include +#include #include "callbacks.h" -#include "gettext.h" +//#include "gettext.h" #include "screentest_colors.h" -#define _(String) gettext(String) -#define N_(String) gettext_noop(String) +//#define _(String) gettext(String) +//#define N_(String) gettext_noop(String) #define BASIC_STEP 40 From e51403f1496ebe78508278e3805cebcf2ac665e2 Mon Sep 17 00:00:00 2001 From: sfs-pra Date: Wed, 6 Aug 2025 15:03:38 +0300 Subject: [PATCH 2/3] Add ru.po --- po/LINGUAS | 1 + po/ru.po | 102 ++++++++++++++++++++++++++++++++++++++++++++++ po/screentest.pot | 7 ++++ 3 files changed, 110 insertions(+) create mode 100644 po/ru.po diff --git a/po/LINGUAS b/po/LINGUAS index b62aa4c..4ad6576 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -3,3 +3,4 @@ da de fi fr +ru diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 0000000..9b1d28c --- /dev/null +++ b/po/ru.po @@ -0,0 +1,102 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-10 13:52+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: sfs \n" +"Language-Team: LANGUAGE \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../main.c:52 +msgid "" +"The interface definition file was not found.\n" +"Please make sure this program is installed correctly." +msgstr "" +"Файл определения интерфейса не найден.\n" +"Пожалуйста, убедитесь, что программа установлена правильно." + +#: ../callbacks.c:182 +#, c-format +msgid "No implementation for the test \"%s\" found." +msgstr "Реализация для теста \"%s\" не найдена." + +#: ../test_basic.c:75 +msgid "Left Button - param cycle, if any" +msgstr "Левая кнопка - перебор параметров (если есть)" + +#: ../test_basic.c:76 +msgid "Middle Button - color cycle" +msgstr "Средняя кнопка - перебор цветов" + +#: ../test_basic.c:77 +msgid "Right Button - menu" +msgstr "Правая кнопка - меню" + +#: ../screentest.ui.h:1 +msgid "Screen test" +msgstr "Тест экрана" + +#: ../screentest.ui.h:2 +msgid "Select Foreground color" +msgstr "Выбрать цвет переднего плана" + +#: ../screentest.ui.h:3 +msgid "Select Background color" +msgstr "Выбрать цвет фона" + +#: ../screentest.ui.h:4 +msgid "Mode" +msgstr "Режим" + +#: ../screentest.ui.h:5 +msgid "Basic" +msgstr "Базовый" + +#: ../screentest.ui.h:6 +msgid "Grid" +msgstr "Сетка" + +#: ../screentest.ui.h:7 +msgid "Horizontal" +msgstr "Горизонтальный" + +#: ../screentest.ui.h:8 +msgid "Vertical" +msgstr "Вертикальный" + +#: ../screentest.ui.h:9 +msgid "Blink" +msgstr "Мигание" + +#: ../screentest.ui.h:10 +msgid "Text" +msgstr "Текст" + +#: ../screentest.ui.h:11 +msgid "LCD Alignment" +msgstr "Выравнивание LCD" + +#: ../screentest.ui.h:12 +msgid "Foreground Color" +msgstr "Цвет переднего плана" + +#: ../screentest.ui.h:13 +msgid "Background Color" +msgstr "Цвет фона" + +msgid "Bright Pixels" +msgstr "Яркие пиксели" + +msgid "Gradient" +msgstr "Градиент" + diff --git a/po/screentest.pot b/po/screentest.pot index f50b2f4..170d1ee 100644 --- a/po/screentest.pot +++ b/po/screentest.pot @@ -91,3 +91,10 @@ msgstr "" #: ../screentest.ui.h:13 msgid "Background Color" msgstr "" + +msgid "Bright Pixels" +msgstr "" + +msgid "Gradient" +msgstr "" + From ae998890f552363330327e6df240b21bbeadf495 Mon Sep 17 00:00:00 2001 From: sfs-pra Date: Wed, 6 Aug 2025 15:31:05 +0300 Subject: [PATCH 3/3] Add .desktop --- PKGBUILD | 9 +++++---- meson.build | 9 +++++++++ screentest.desktop.in | 28 ++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 screentest.desktop.in diff --git a/PKGBUILD b/PKGBUILD index 82b5374..8a21856 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,9 +1,9 @@ # Maintainer: sfslinux@gmail.com pkgname=screentest -pkgver=3.0.r5.gf30e3fc -pkgrel=3 -pkgdesc="tesing the quality of CRT/LCD screens" +pkgver=r86.f30e3fc +pkgrel=1 +pkgdesc="Tesing the quality of CRT/LCD screens" arch=('x86_64') #url="https://github.com/TobiX/screentest" url="https://github.com/sfs-pra/screentest" @@ -15,7 +15,8 @@ sha256sums=('SKIP') pkgver() { cd $pkgname - git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +# git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { diff --git a/meson.build b/meson.build index fb6dbc0..a4086fa 100644 --- a/meson.build +++ b/meson.build @@ -63,3 +63,12 @@ install_data( 'screentest.ui', install_dir: uidir, ) + +desktop_file = i18n.merge_file( + input: 'screentest.desktop.in', + output: 'screentest.desktop', + type: 'desktop', + po_dir: join_paths(meson.source_root(), 'po'), + install: true, + install_dir: join_paths(get_option('datadir'), 'applications') +) \ No newline at end of file diff --git a/screentest.desktop.in b/screentest.desktop.in new file mode 100644 index 0000000..927f6b5 --- /dev/null +++ b/screentest.desktop.in @@ -0,0 +1,28 @@ +[Desktop Entry] +Type=Application +Name=Screen Test +Name[ru]=Тест экрана +Name[es]=Prueba de pantalla +Name[fr]=Test d'écran +Name[de]=Bildschirmtest +Name[it]=Test dello schermo +Name[pt]=Teste de tela +Name[zh_CN]=屏幕测试 +Name[ja]=画面テスト +Name[ar]=اختبار الشاشة + +Comment=Testing the quality of CRT/LCD monitors +Comment[ru]=Проверка качества CRT/LCD мониторов +Comment[es]=Prueba de calidad de monitores CRT/LCD +Comment[fr]=Test de qualité des écrans CRT/LCD +Comment[de]=Test der Bildqualität von CRT/LCD-Monitoren +Comment[it]=Test della qualità dei monitor CRT/LCD +Comment[pt]=Teste de qualidade de monitores CRT/LCD +Comment[zh_CN]=CRT/LCD显示器质量测试 +Comment[ja]=CRT/LCDモニターの品質テスト +Comment[ar]=اختبار جودة شاشات CRT/LCD + +Icon=gtk-fullscreen +Exec=screentest +Categories=Utility;System; +Terminal=false