Skip to content

Fix i18n. Add ru.po & .desktop #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Maintainer: [email protected]

pkgname=screentest
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"
license=('GPL2')
depends=('gtk3' )
makedepends=('meson')
source=(git+$url)
sha256sums=('SKIP')

pkgver() {
cd $pkgname
# 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() {
cd $pkgname
meson build --prefix /usr
meson compile -C build
}

package() {
cd $pkgname
DESTDIR="$pkgdir" meson install -C build
}
9 changes: 7 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@

#include <config.h>

#include <glib/gi18n.h>
#include <locale.h>
#include <libintl.h>

#include <gtk/gtk.h>
#include <stdlib.h>

#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);
Expand Down
12 changes: 11 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -62,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')
)
1 change: 1 addition & 0 deletions po/LINGUAS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ da
de
fi
fr
ru
102 changes: 102 additions & 0 deletions po/ru.po
Original file line number Diff line number Diff line change
@@ -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 <EMAIL@ADDRESS>, 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 <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\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 "Градиент"

7 changes: 7 additions & 0 deletions po/screentest.pot
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,10 @@ msgstr ""
#: ../screentest.ui.h:13
msgid "Background Color"
msgstr ""

msgid "Bright Pixels"
msgstr ""

msgid "Gradient"
msgstr ""

28 changes: 28 additions & 0 deletions screentest.desktop.in
Original file line number Diff line number Diff line change
@@ -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
8 changes: 5 additions & 3 deletions test_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@

#include <gtk/gtk.h>
#include <stdio.h>
#include <glib/gi18n.h>
#include <locale.h>

#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

Expand Down