控制面板插件新增翻译文件;
This commit is contained in:
parent
15310ab084
commit
1bc2e4ff9d
|
@ -5,10 +5,8 @@ set(notification-ukcc-plugin_LIB_SRCS
|
|||
noticemenu.cpp
|
||||
noticemenu.h)
|
||||
|
||||
add_library(notification-ukcc-plugin SHARED ${notification-ukcc-plugin_LIB_SRCS})
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Widgets LinguistTools REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Widgets LinguistTools REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
set(UKUI_NOTIFICATION_EXTERNAL_LIBS "")
|
||||
set(UKUI_NOTIFICATION_PC_PKGS kysdk-qtwidgets)
|
||||
|
@ -26,6 +24,17 @@ include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
|
|||
include_directories(../libukui-notification/notification-settings)
|
||||
include_directories(../libukui-notification)
|
||||
|
||||
|
||||
file(GLOB TS_FILES "${PROJECT_SOURCE_DIR}/notification-ukcc-plugin/translations/*.ts")
|
||||
qt5_add_translation(QM_FILES ${TS_FILES})
|
||||
#set(QM_FILES ${QM_FILES} PARENT_SCOPE)
|
||||
add_custom_target(translations ALL DEPENDS ${QM_FILES})
|
||||
|
||||
add_library(notification-ukcc-plugin SHARED
|
||||
${notification-ukcc-plugin_LIB_SRCS}
|
||||
${QM_FILES}
|
||||
)
|
||||
|
||||
target_link_libraries(notification-ukcc-plugin
|
||||
PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
|
@ -34,5 +43,7 @@ target_link_libraries(notification-ukcc-plugin
|
|||
ukui-notification
|
||||
ukcc
|
||||
)
|
||||
install(TARGETS notification-ukcc-plugin DESTINATION /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/ukui-control-center)
|
||||
|
||||
install(TARGETS notification-ukcc-plugin DESTINATION /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/ukui-control-center)
|
||||
install(FILES ${TS_FILES} ${QM_FILES} DESTINATION /usr/share/ukui-notification/notification-ukcc-plugin/translations)
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include <QToolButton>
|
||||
#include <QFile>
|
||||
#include <QThread>
|
||||
#include <QApplication>
|
||||
#include <QTranslator>
|
||||
|
||||
#define THEME_QT_SCHEMA "org.ukui.style"
|
||||
|
||||
|
@ -25,6 +27,12 @@ protected:
|
|||
|
||||
Notice::Notice()
|
||||
{
|
||||
QTranslator* translator = new QTranslator(this);
|
||||
if(!translator->load("/usr/share/ukui-notification/notification-ukcc-plugin/translations/" + QLocale::system().name())) {
|
||||
qWarning() << "/usr/share/ukui-notification/notification-ukcc-plugin/translations/" + QLocale::system().name() << "load failed";
|
||||
}
|
||||
QApplication::installTranslator(translator);
|
||||
|
||||
m_pluginName = tr("Notice");
|
||||
m_pluginType = SYSTEM;
|
||||
|
||||
|
@ -82,6 +90,11 @@ const QString Notice::name() const
|
|||
return QStringLiteral("Notice");
|
||||
}
|
||||
|
||||
QString Notice::translationPath() const
|
||||
{
|
||||
return QStringLiteral("/usr/share/ukui-notification/notification-ukcc-plugin/translations/%1.ts");
|
||||
}
|
||||
|
||||
bool Notice::isShowOnHomePage() const
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
int pluginTypes() Q_DECL_OVERRIDE;
|
||||
QWidget * pluginUi() Q_DECL_OVERRIDE;
|
||||
const QString name() const Q_DECL_OVERRIDE;
|
||||
QString translationPath() const;
|
||||
bool isShowOnHomePage() const Q_DECL_OVERRIDE;
|
||||
QIcon icon() const Q_DECL_OVERRIDE;
|
||||
bool isEnable() const Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="bo_CN" sourcelanguage="en">
|
||||
<context>
|
||||
<name>Notice</name>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="35"/>
|
||||
<source>Notice</source>
|
||||
<translation>བརྡ་ཐོ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="126"/>
|
||||
<source>NotFaze Mode</source>
|
||||
<translation>མི་དམངས་ཀྱི་དཔེ་དབྱིབས་མིན་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="128"/>
|
||||
<source>(Notification banners, prompts will be hidden, and notification sounds will be muted)</source>
|
||||
<translation>(བརྡ་ཐོ་གཏོང་བའི་འཕྲེད་འགེལ་སྦྱར་ཡིག་དང་། བརྡ་གཏོང་ཡི་གེ་སྦས་སྐུང་བྱས་ནས་བརྡ་ཁྱབ་ཀྱི་སྒྲ་གྲགས་ཡོང་། )</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="202"/>
|
||||
<source>Automatically turn on</source>
|
||||
<translation>རང་འགུལ་གྱིས་ཁ་ཕྱེ་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="227"/>
|
||||
<source>to</source>
|
||||
<translation>དེ་ལྟར་བྱས་ན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="252"/>
|
||||
<source>Automatically turn on when multiple screens are connected</source>
|
||||
<translation>བརྙན་ཤེལ་མང་པོ་སྦྲེལ་མཐུད་བྱེད་སྐབས་རང་འགུལ་གྱིས་ཁ་ཕྱེ་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="257"/>
|
||||
<source>Automatically open in full screen mode</source>
|
||||
<translation>བརྙན་ཤེལ་ཧྲིལ་པོའི་རྣམ་པའི་ཐོག་ནས་རང་འགུལ་གྱིས་སྒོ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="262"/>
|
||||
<source>Allow automatic alarm reminders in Do Not Disturb mode</source>
|
||||
<translation>རང་འགུལ་གྱིས་ཉེན་བརྡ་གཏོང་བའི་དྲན་སྐུལ་བྱེད་སྟངས་ལ་སུན་པོ་བཟོ་མི་རུང་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="292"/>
|
||||
<source>Notice Settings</source>
|
||||
<translation>བརྡ་ཐོའི་སྒྲིག་བཀོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="294"/>
|
||||
<source>Get notifications from the app</source>
|
||||
<translation>ཉེར་སྤྱོད་གོ་རིམ་ཁྲོད་ནས་བརྡ་ཐོ་གཏོང་དགོས།</translation>
|
||||
<extra-contents_path>/notice/Get notifications from the app</extra-contents_path>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NoticeMenu</name>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="86"/>
|
||||
<source>Beep sound when notified</source>
|
||||
<translation>བརྡ་ཐོ་གཏོང་སྐབས་སྐད་ཅོར་རྒྱག་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="92"/>
|
||||
<source>Show message on screenlock</source>
|
||||
<translation>བརྙན་ཤེལ་སྟེང་ནས་ཆ་འཕྲིན་མངོན་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="98"/>
|
||||
<source>Show noticfication on screenlock</source>
|
||||
<translation>བརྙན་ཤེལ་སྟེང་ནས་དོ་སྣང་བྱེད་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="102"/>
|
||||
<source>Notification Style</source>
|
||||
<translation>བརྡ་ཐོ་གཏོང་སྟངས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="110"/>
|
||||
<source>Banner: Appears in the upper right corner of the screen, and disappears automatically</source>
|
||||
<translation>འཕྲེད་འགེལ་ཡི་གེ། བརྙན་ཤེལ་གྱི་གཡས་ཟུར་དུ་མངོན་པ་མ་ཟད། རང་འགུལ་གྱིས་མེད་པར་གྱུར་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="115"/>
|
||||
<source>Tip:It will be kept on the screen until it is closed</source>
|
||||
<translation>རྩེ་མོ། འཆར་ངོས་སུ་ཉར་ཚགས་བྱས་ནས་སྒོ་མ་བརྒྱབ་གོང་ལ་ཉར་ཚགས་བྱེད་དགོས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="120"/>
|
||||
<source>None:Notifications will not be displayed on the screen, but will go to the notification center</source>
|
||||
<translation>གཅིག་ཀྱང་མ་ལུས་པར་འཆར་ངོས་སུ་བརྡ་ཐོ་མི་མངོན་པར་བརྡ་ཁྱབ་ལྟེ་གནས་སུ་འགྲོ་རྒྱུ་རེད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
|
@ -0,0 +1,96 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en" sourcelanguage="en">
|
||||
<context>
|
||||
<name>Notice</name>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="35"/>
|
||||
<source>Notice</source>
|
||||
<translation>Notice</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="126"/>
|
||||
<source>NotFaze Mode</source>
|
||||
<translation>NotFaze Mode</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="128"/>
|
||||
<source>(Notification banners, prompts will be hidden, and notification sounds will be muted)</source>
|
||||
<translation>(Notification banners, prompts will be hidden, and notification sounds will be muted)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="202"/>
|
||||
<source>Automatically turn on</source>
|
||||
<translation>Automatically turn on</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="227"/>
|
||||
<source>to</source>
|
||||
<translation>to</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="252"/>
|
||||
<source>Automatically turn on when multiple screens are connected</source>
|
||||
<translation>Automatically turn on when multiple screens are connected</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="257"/>
|
||||
<source>Automatically open in full screen mode</source>
|
||||
<translation>Automatically open in full screen mode</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="262"/>
|
||||
<source>Allow automatic alarm reminders in Do Not Disturb mode</source>
|
||||
<translation>Allow automatic alarm reminders in Do Not Disturb mode</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="292"/>
|
||||
<source>Notice Settings</source>
|
||||
<translation>Notice Settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="294"/>
|
||||
<source>Get notifications from the app</source>
|
||||
<translation>Get notifications from the app</translation>
|
||||
<extra-contents_path>/notice/Get notifications from the app</extra-contents_path>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NoticeMenu</name>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="86"/>
|
||||
<source>Beep sound when notified</source>
|
||||
<translation>Beep sound when notified</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="92"/>
|
||||
<source>Show message on screenlock</source>
|
||||
<translation>Show message on screenlock</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="98"/>
|
||||
<source>Show noticfication on screenlock</source>
|
||||
<translation>Show noticfication on screenlock</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="102"/>
|
||||
<source>Notification Style</source>
|
||||
<translation>Notification Style</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="110"/>
|
||||
<source>Banner: Appears in the upper right corner of the screen, and disappears automatically</source>
|
||||
<translation>Banner: Appears in the upper right corner of the screen, and disappears automatically</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="115"/>
|
||||
<source>Tip:It will be kept on the screen until it is closed</source>
|
||||
<translation>Tip:It will be kept on the screen until it is closed</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="120"/>
|
||||
<source>None:Notifications will not be displayed on the screen, but will go to the notification center</source>
|
||||
<translation>None:Notifications will not be displayed on the screen, but will go to the notification center</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
|
@ -0,0 +1,96 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="zh_CN" sourcelanguage="en">
|
||||
<context>
|
||||
<name>Notice</name>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="35"/>
|
||||
<source>Notice</source>
|
||||
<translation>通知</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="126"/>
|
||||
<source>NotFaze Mode</source>
|
||||
<translation>勿扰模式</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="128"/>
|
||||
<source>(Notification banners, prompts will be hidden, and notification sounds will be muted)</source>
|
||||
<translation>(通知横幅、提示将会隐藏,通知声音将会静音)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="202"/>
|
||||
<source>Automatically turn on</source>
|
||||
<translation>自动开启</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="227"/>
|
||||
<source>to</source>
|
||||
<translation>至</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="252"/>
|
||||
<source>Automatically turn on when multiple screens are connected</source>
|
||||
<translation>多屏连接时自动开启</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="257"/>
|
||||
<source>Automatically open in full screen mode</source>
|
||||
<translation>全屏模式下自动开启</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="262"/>
|
||||
<source>Allow automatic alarm reminders in Do Not Disturb mode</source>
|
||||
<translation>勿扰模式下允许闹钟提示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="292"/>
|
||||
<source>Notice Settings</source>
|
||||
<translation>通知</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../notification-ukcc-plugin.cpp" line="294"/>
|
||||
<source>Get notifications from the app</source>
|
||||
<translation>获取来自应用的通知</translation>
|
||||
<extra-contents_path>/notice/Get notifications from the app</extra-contents_path>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NoticeMenu</name>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="86"/>
|
||||
<source>Beep sound when notified</source>
|
||||
<translation>通知时提示声音</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="92"/>
|
||||
<source>Show message on screenlock</source>
|
||||
<translation>在锁屏界面显示消息内容</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="98"/>
|
||||
<source>Show noticfication on screenlock</source>
|
||||
<translation>在锁屏界面显示通知</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="102"/>
|
||||
<source>Notification Style</source>
|
||||
<translation>通知样式</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="110"/>
|
||||
<source>Banner: Appears in the upper right corner of the screen, and disappears automatically</source>
|
||||
<translation>横幅:显示在屏幕右上角,会自动消失</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="115"/>
|
||||
<source>Tip:It will be kept on the screen until it is closed</source>
|
||||
<translation>提示:会保留在屏幕上,直到被关闭</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../noticemenu.cpp" line="120"/>
|
||||
<source>None:Notifications will not be displayed on the screen, but will go to the notification center</source>
|
||||
<translation>无:通知不会显示在屏幕上,但会进入通知中心</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
Loading…
Reference in New Issue