Project: Add multilingual support.
This commit is contained in:
parent
9ccdfbdbae
commit
ca319a5b55
|
@ -1 +1 @@
|
||||||
Subproject commit eeefdd757e64fae21449d4de3706072385e66b12
|
Subproject commit fd7734e79071d0acc1286004dc53db8c9b8c5a1a
|
|
@ -31,7 +31,10 @@ endif()
|
||||||
|
|
||||||
# Find Qt package
|
# Find Qt package
|
||||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick REQUIRED)
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick LinguistTools REQUIRED)
|
||||||
|
|
||||||
|
# List all ts files to be used in the project
|
||||||
|
set(ts_files i18n/${PROJECT_NAME}_zh_CN.ts i18n/${PROJECT_NAME}_en_US.ts)
|
||||||
|
|
||||||
# Source and QML files
|
# Source and QML files
|
||||||
set(sources_files example.cpp)
|
set(sources_files example.cpp)
|
||||||
|
@ -56,6 +59,31 @@ list(APPEND source_files ${CMAKE_CURRENT_BINARY_DIR}/${__example_project_version
|
||||||
qt_add_executable(${PROJECT_NAME}
|
qt_add_executable(${PROJECT_NAME}
|
||||||
${sources_files})
|
${sources_files})
|
||||||
|
|
||||||
|
# Add i18n files
|
||||||
|
set_source_files_properties(${ts_files} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/i18n)
|
||||||
|
|
||||||
|
if(QT_VERSION VERSION_LESS 6.0)
|
||||||
|
qt5_create_translation_plus(qm_files ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files})
|
||||||
|
foreach(qm_file ${qm_files})
|
||||||
|
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" r_qm_file ${qm_file})
|
||||||
|
list(APPEND r_qm_files ${r_qm_file})
|
||||||
|
endforeach()
|
||||||
|
qt5_add_resources_plus(${PROJECT_NAME} "${PROJECT_NAME}-translations"
|
||||||
|
PREFIX "/"
|
||||||
|
FILES ${r_qm_files}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
qt6_create_translation(qm_files ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files})
|
||||||
|
foreach(qm_file ${qm_files})
|
||||||
|
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" r_qm_file ${qm_file})
|
||||||
|
list(APPEND r_qm_files ${r_qm_file})
|
||||||
|
endforeach()
|
||||||
|
qt6_add_resources(${PROJECT_NAME} "${PROJECT_NAME}-translations"
|
||||||
|
PREFIX "/"
|
||||||
|
FILES ${r_qm_files}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Windows-specific settings
|
# Windows-specific settings
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../.cmake/win_app.rc.in ${CMAKE_BINARY_DIR}/win_app.rc)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../.cmake/win_app.rc.in ${CMAKE_BINARY_DIR}/win_app.rc)
|
||||||
|
|
|
@ -0,0 +1,495 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US">
|
||||||
|
<context>
|
||||||
|
<name>RibbonMessageListViewExample</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/RibbonMessageListViewExample.qml" line="17"/>
|
||||||
|
<location filename="../qml/Qt6/components/RibbonMessageListViewExample.qml" line="17"/>
|
||||||
|
<source>Message List View Example</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/RibbonMessageListViewExample.qml" line="42"/>
|
||||||
|
<location filename="../qml/Qt6/components/RibbonMessageListViewExample.qml" line="42"/>
|
||||||
|
<source>Add Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/RibbonMessageListViewExample.qml" line="53"/>
|
||||||
|
<location filename="../qml/Qt6/components/RibbonMessageListViewExample.qml" line="53"/>
|
||||||
|
<source>Clear Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>SettingsMenuPage</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="9"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="9"/>
|
||||||
|
<source>Settings</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="21"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="21"/>
|
||||||
|
<source>Theme</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="25"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="25"/>
|
||||||
|
<source>Current Theme: </source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="59"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="59"/>
|
||||||
|
<source>Current Style: </source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="62"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="62"/>
|
||||||
|
<source>Style</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="63"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="63"/>
|
||||||
|
<source>Modern</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="63"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="63"/>
|
||||||
|
<source>Classic</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="74"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="74"/>
|
||||||
|
<source>Text Render</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="77"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="77"/>
|
||||||
|
<source>Current Text Render: </source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="95"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="95"/>
|
||||||
|
<source>TitleBar</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="98"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="98"/>
|
||||||
|
<source>Show TitleBar Icon: </source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="115"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="115"/>
|
||||||
|
<source>Language</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="119"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="119"/>
|
||||||
|
<source>Current Language: </source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>TabBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="37"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="37"/>
|
||||||
|
<source>Basic</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="41"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="41"/>
|
||||||
|
<source>Slider</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="81"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="81"/>
|
||||||
|
<source>Switch Button</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="130"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="130"/>
|
||||||
|
<source>CheckBox</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="166"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="166"/>
|
||||||
|
<source>Button</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="235"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="235"/>
|
||||||
|
<source>Push Button</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="242"/>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="259"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="242"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="259"/>
|
||||||
|
<source>No Menu</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="247"/>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="264"/>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="718"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="247"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="264"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="718"/>
|
||||||
|
<source>Menu</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="279"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="279"/>
|
||||||
|
<source>Radio Button</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="297"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="297"/>
|
||||||
|
<source>Input</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="300"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="300"/>
|
||||||
|
<source>Line Edit</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="331"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="331"/>
|
||||||
|
<source>Text Edit</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="365"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="365"/>
|
||||||
|
<source>Combo Box</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="425"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="425"/>
|
||||||
|
<source>Spin Box</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="460"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="460"/>
|
||||||
|
<source>Progress</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="474"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="474"/>
|
||||||
|
<source>ProgressBar</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="541"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="541"/>
|
||||||
|
<source>ProgressRing</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="616"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="616"/>
|
||||||
|
<source>Indicator</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="618"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="618"/>
|
||||||
|
<source>BusyRing</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="634"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="634"/>
|
||||||
|
<source>BusyBar</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="652"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="652"/>
|
||||||
|
<source>PageIndicator</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="672"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="672"/>
|
||||||
|
<source>Views</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="675"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="675"/>
|
||||||
|
<source>MessageListView</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="682"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="682"/>
|
||||||
|
<source>Open Message List View</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="692"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="692"/>
|
||||||
|
<source>Others</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="695"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="695"/>
|
||||||
|
<source>Text</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="725"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="725"/>
|
||||||
|
<source>Open Menu</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="733"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="733"/>
|
||||||
|
<source>Popup</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="743"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="743"/>
|
||||||
|
<source>Open Popup</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="748"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="748"/>
|
||||||
|
<source>Open Popup Dialog (Double Choices)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="756"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="756"/>
|
||||||
|
<source>Open Popup Dialog (Triple Choices)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="782"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="782"/>
|
||||||
|
<source>MessageBar</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="789"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="789"/>
|
||||||
|
<source>Generate One Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="796"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="796"/>
|
||||||
|
<source>Clear All Messages</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>about</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/about.qml" line="11"/>
|
||||||
|
<location filename="../qml/Qt6/about.qml" line="11"/>
|
||||||
|
<source>About</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>example</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="12"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="12"/>
|
||||||
|
<source>RibbonUI APP</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="69"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="70"/>
|
||||||
|
<source>Tab Bar</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="70"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="71"/>
|
||||||
|
<source>A tab bar for window, let user choose the controllers.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="78"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="79"/>
|
||||||
|
<source>Tab Bar Buttons</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="79"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="80"/>
|
||||||
|
<source>Tool buttons at the top of tab bar.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="83"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="84"/>
|
||||||
|
<source>Sliders</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="84"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="85"/>
|
||||||
|
<source>Vertical/Horizental sliders with/without buttons.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="98"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="99"/>
|
||||||
|
<source>Switch Buttons</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="99"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="100"/>
|
||||||
|
<source>Switch buttons with/without background color or grabber text.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="105"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="106"/>
|
||||||
|
<source>CheckBoxs</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="106"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="107"/>
|
||||||
|
<source>CheckBoxs with colorful background or with/without label text.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="110"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="111"/>
|
||||||
|
<source>Buttons</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="111"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="112"/>
|
||||||
|
<source>Buttons with/without background or label text.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="117"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="118"/>
|
||||||
|
<source>Push Buttons</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="118"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="119"/>
|
||||||
|
<source>Push buttons with/without sub menu.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="122"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="123"/>
|
||||||
|
<source>Line Edits</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="123"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="124"/>
|
||||||
|
<source>Line edits with/without icon.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="137"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="138"/>
|
||||||
|
<source>Bottom Bar</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="138"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="139"/>
|
||||||
|
<source>A bottom bar for window.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="286"/>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="402"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="288"/>
|
||||||
|
<source>About</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="297"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="299"/>
|
||||||
|
<source>Tour</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="331"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="333"/>
|
||||||
|
<source>Test Item 2</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="332"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="334"/>
|
||||||
|
<source>Test Item 3</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="374"/>
|
||||||
|
<source>Home</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="381"/>
|
||||||
|
<source>File</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="388"/>
|
||||||
|
<source>Search</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="395"/>
|
||||||
|
<source>Account</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="409"/>
|
||||||
|
<source>Settings</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
|
@ -0,0 +1,495 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="zh_CN">
|
||||||
|
<context>
|
||||||
|
<name>RibbonMessageListViewExample</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/RibbonMessageListViewExample.qml" line="17"/>
|
||||||
|
<location filename="../qml/Qt6/components/RibbonMessageListViewExample.qml" line="17"/>
|
||||||
|
<source>Message List View Example</source>
|
||||||
|
<translation>Message List View 示例</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/RibbonMessageListViewExample.qml" line="42"/>
|
||||||
|
<location filename="../qml/Qt6/components/RibbonMessageListViewExample.qml" line="42"/>
|
||||||
|
<source>Add Message</source>
|
||||||
|
<translation>添加信息</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/RibbonMessageListViewExample.qml" line="53"/>
|
||||||
|
<location filename="../qml/Qt6/components/RibbonMessageListViewExample.qml" line="53"/>
|
||||||
|
<source>Clear Message</source>
|
||||||
|
<translation>清除信息</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>SettingsMenuPage</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="9"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="9"/>
|
||||||
|
<source>Settings</source>
|
||||||
|
<translation>设置</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="21"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="21"/>
|
||||||
|
<source>Theme</source>
|
||||||
|
<translation>主题</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="25"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="25"/>
|
||||||
|
<source>Current Theme: </source>
|
||||||
|
<translation>当前主题: </translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="59"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="59"/>
|
||||||
|
<source>Current Style: </source>
|
||||||
|
<translation>当前风格: </translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="62"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="62"/>
|
||||||
|
<source>Style</source>
|
||||||
|
<translation>风格</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="63"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="63"/>
|
||||||
|
<source>Modern</source>
|
||||||
|
<translation>现代化</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="63"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="63"/>
|
||||||
|
<source>Classic</source>
|
||||||
|
<translation>经典</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="74"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="74"/>
|
||||||
|
<source>Text Render</source>
|
||||||
|
<translation>文本渲染器</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="77"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="77"/>
|
||||||
|
<source>Current Text Render: </source>
|
||||||
|
<translation>当前文本渲染器: </translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="95"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="95"/>
|
||||||
|
<source>TitleBar</source>
|
||||||
|
<translation>标题栏</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="98"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="98"/>
|
||||||
|
<source>Show TitleBar Icon: </source>
|
||||||
|
<translation>显示标题栏图标: </translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="115"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="115"/>
|
||||||
|
<source>Language</source>
|
||||||
|
<translation>语言</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="119"/>
|
||||||
|
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="119"/>
|
||||||
|
<source>Current Language: </source>
|
||||||
|
<translation>当前语言: </translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>TabBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="37"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="37"/>
|
||||||
|
<source>Basic</source>
|
||||||
|
<translation>基本</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="41"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="41"/>
|
||||||
|
<source>Slider</source>
|
||||||
|
<translation>滑动条</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="81"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="81"/>
|
||||||
|
<source>Switch Button</source>
|
||||||
|
<translation>开关</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="130"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="130"/>
|
||||||
|
<source>CheckBox</source>
|
||||||
|
<translation>复选框</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="166"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="166"/>
|
||||||
|
<source>Button</source>
|
||||||
|
<translation>按钮</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="235"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="235"/>
|
||||||
|
<source>Push Button</source>
|
||||||
|
<translation>按压按钮</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="242"/>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="259"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="242"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="259"/>
|
||||||
|
<source>No Menu</source>
|
||||||
|
<translation>无菜单</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="247"/>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="264"/>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="718"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="247"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="264"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="718"/>
|
||||||
|
<source>Menu</source>
|
||||||
|
<translation>菜单</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="279"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="279"/>
|
||||||
|
<source>Radio Button</source>
|
||||||
|
<translation>单选按钮</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="297"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="297"/>
|
||||||
|
<source>Input</source>
|
||||||
|
<translation>输入</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="300"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="300"/>
|
||||||
|
<source>Line Edit</source>
|
||||||
|
<translation>行编辑</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="331"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="331"/>
|
||||||
|
<source>Text Edit</source>
|
||||||
|
<translation>文本编辑</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="365"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="365"/>
|
||||||
|
<source>Combo Box</source>
|
||||||
|
<translation>组合框</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="425"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="425"/>
|
||||||
|
<source>Spin Box</source>
|
||||||
|
<translation>调整框</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="460"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="460"/>
|
||||||
|
<source>Progress</source>
|
||||||
|
<translation>进度</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="474"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="474"/>
|
||||||
|
<source>ProgressBar</source>
|
||||||
|
<translation>进度条</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="541"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="541"/>
|
||||||
|
<source>ProgressRing</source>
|
||||||
|
<translation>进度环</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="616"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="616"/>
|
||||||
|
<source>Indicator</source>
|
||||||
|
<translation>指示器</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="618"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="618"/>
|
||||||
|
<source>BusyRing</source>
|
||||||
|
<translation>加载环</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="634"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="634"/>
|
||||||
|
<source>BusyBar</source>
|
||||||
|
<translation>加载条</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="652"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="652"/>
|
||||||
|
<source>PageIndicator</source>
|
||||||
|
<translation>页面指示器</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="672"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="672"/>
|
||||||
|
<source>Views</source>
|
||||||
|
<translation>视图</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="675"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="675"/>
|
||||||
|
<source>MessageListView</source>
|
||||||
|
<translation>消息列表视图</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="682"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="682"/>
|
||||||
|
<source>Open Message List View</source>
|
||||||
|
<translation>打开消息列表视图</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="692"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="692"/>
|
||||||
|
<source>Others</source>
|
||||||
|
<translation>其他</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="695"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="695"/>
|
||||||
|
<source>Text</source>
|
||||||
|
<translation>文本</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="725"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="725"/>
|
||||||
|
<source>Open Menu</source>
|
||||||
|
<translation>打开菜单</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="733"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="733"/>
|
||||||
|
<source>Popup</source>
|
||||||
|
<translation>弹出窗口</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="743"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="743"/>
|
||||||
|
<source>Open Popup</source>
|
||||||
|
<translation>打开弹出窗口</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="748"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="748"/>
|
||||||
|
<source>Open Popup Dialog (Double Choices)</source>
|
||||||
|
<translation>打开弹出窗口(双选择)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="756"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="756"/>
|
||||||
|
<source>Open Popup Dialog (Triple Choices)</source>
|
||||||
|
<translation>打开弹出窗口(三选择)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="782"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="782"/>
|
||||||
|
<source>MessageBar</source>
|
||||||
|
<translation>信息栏</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="789"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="789"/>
|
||||||
|
<source>Generate One Message</source>
|
||||||
|
<translation>生成一条信息</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/components/TabBar.qml" line="796"/>
|
||||||
|
<location filename="../qml/Qt6/components/TabBar.qml" line="796"/>
|
||||||
|
<source>Clear All Messages</source>
|
||||||
|
<translation>清除所有信息</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>about</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/about.qml" line="11"/>
|
||||||
|
<location filename="../qml/Qt6/about.qml" line="11"/>
|
||||||
|
<source>About</source>
|
||||||
|
<translation>关于</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>example</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="12"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="12"/>
|
||||||
|
<source>RibbonUI APP</source>
|
||||||
|
<translation>RibbonUI 应用</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="69"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="70"/>
|
||||||
|
<source>Tab Bar</source>
|
||||||
|
<translation>标签栏</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="70"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="71"/>
|
||||||
|
<source>A tab bar for window, let user choose the controllers.</source>
|
||||||
|
<translation>一个让用户选择工具使用的标签栏。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="78"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="79"/>
|
||||||
|
<source>Tab Bar Buttons</source>
|
||||||
|
<translation>标签栏按钮</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="79"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="80"/>
|
||||||
|
<source>Tool buttons at the top of tab bar.</source>
|
||||||
|
<translation>在标签栏顶端的工具按钮。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="83"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="84"/>
|
||||||
|
<source>Sliders</source>
|
||||||
|
<translation>滑动条</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="84"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="85"/>
|
||||||
|
<source>Vertical/Horizental sliders with/without buttons.</source>
|
||||||
|
<translation>含/不含按钮的垂直/水平滑动条。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="98"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="99"/>
|
||||||
|
<source>Switch Buttons</source>
|
||||||
|
<translation>开关</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="99"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="100"/>
|
||||||
|
<source>Switch buttons with/without background color or grabber text.</source>
|
||||||
|
<translation>有/没有背景颜色或者抓握指示器文本的开关。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="105"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="106"/>
|
||||||
|
<source>CheckBoxs</source>
|
||||||
|
<translation>复选框</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="106"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="107"/>
|
||||||
|
<source>CheckBoxs with colorful background or with/without label text.</source>
|
||||||
|
<translation>具有多彩背景色彩或标签文本的复选框。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="110"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="111"/>
|
||||||
|
<source>Buttons</source>
|
||||||
|
<translation>按钮</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="111"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="112"/>
|
||||||
|
<source>Buttons with/without background or label text.</source>
|
||||||
|
<translation>具有/不具有背景或标签文本的按钮。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="117"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="118"/>
|
||||||
|
<source>Push Buttons</source>
|
||||||
|
<translation>下压按钮</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="118"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="119"/>
|
||||||
|
<source>Push buttons with/without sub menu.</source>
|
||||||
|
<translation>有/没有带菜单的下压按钮。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="122"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="123"/>
|
||||||
|
<source>Line Edits</source>
|
||||||
|
<translation>行编辑</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="123"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="124"/>
|
||||||
|
<source>Line edits with/without icon.</source>
|
||||||
|
<translation>带/不带图标的行编辑器。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="137"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="138"/>
|
||||||
|
<source>Bottom Bar</source>
|
||||||
|
<translation>底层工具栏</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="138"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="139"/>
|
||||||
|
<source>A bottom bar for window.</source>
|
||||||
|
<translation>窗口的底层工具栏。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="286"/>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="402"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="288"/>
|
||||||
|
<source>About</source>
|
||||||
|
<translation>关于</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="297"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="299"/>
|
||||||
|
<source>Tour</source>
|
||||||
|
<translation>导览</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="331"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="333"/>
|
||||||
|
<source>Test Item 2</source>
|
||||||
|
<translation>测试项目 1</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="332"/>
|
||||||
|
<location filename="../qml/Qt6/example.qml" line="334"/>
|
||||||
|
<source>Test Item 3</source>
|
||||||
|
<translation>测试项目 1</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="374"/>
|
||||||
|
<source>Home</source>
|
||||||
|
<translation>主页</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="381"/>
|
||||||
|
<source>File</source>
|
||||||
|
<translation>文件</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="388"/>
|
||||||
|
<source>Search</source>
|
||||||
|
<translation>搜索</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="395"/>
|
||||||
|
<source>Account</source>
|
||||||
|
<translation>账户</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/example.qml" line="409"/>
|
||||||
|
<source>Settings</source>
|
||||||
|
<translation>设置</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
|
@ -12,6 +12,7 @@ RibbonWindow {
|
||||||
title: qsTr("RibbonUI APP")
|
title: qsTr("RibbonUI APP")
|
||||||
comfirmedQuit: true
|
comfirmedQuit: true
|
||||||
property bool modernStyle: RibbonTheme.modernStyle
|
property bool modernStyle: RibbonTheme.modernStyle
|
||||||
|
|
||||||
RibbonMessageBarGroup{
|
RibbonMessageBarGroup{
|
||||||
id: msg_bar
|
id: msg_bar
|
||||||
implicitWidth: windowItems.width
|
implicitWidth: windowItems.width
|
||||||
|
@ -142,7 +143,10 @@ RibbonWindow {
|
||||||
blurEnabled: true
|
blurEnabled: true
|
||||||
targetRect: Qt.rect(windowItems.x + x, windowItems.y + y, width, height)
|
targetRect: Qt.rect(windowItems.x + x, windowItems.y + y, width, height)
|
||||||
}
|
}
|
||||||
Component.onCompleted: tour.open()
|
Component.onCompleted: {
|
||||||
|
RibbonUI.autoLoadLanguage = true
|
||||||
|
tour.open()
|
||||||
|
}
|
||||||
|
|
||||||
TabBar{
|
TabBar{
|
||||||
id: tab_bar
|
id: tab_bar
|
||||||
|
@ -157,6 +161,7 @@ RibbonWindow {
|
||||||
pageWidth: (page_slider.value / 100.0) * width
|
pageWidth: (page_slider.value / 100.0) * width
|
||||||
spacing: 0
|
spacing: 0
|
||||||
isMainView: true
|
isMainView: true
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.topMargin: 30
|
Layout.topMargin: 30
|
||||||
|
@ -368,42 +373,42 @@ RibbonWindow {
|
||||||
blurTarget: root.windowItems
|
blurTarget: root.windowItems
|
||||||
radius: borderRadius
|
radius: borderRadius
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "Home"
|
menuText: qsTr("Home")
|
||||||
menuIcon: RibbonIcons.Home
|
menuIcon: RibbonIcons.Home
|
||||||
type: RibbonBackStageView.MenuItemLocation.Head
|
type: RibbonBackStageView.MenuItemLocation.Head
|
||||||
sourceComponent: t_content
|
sourceComponent: t_content
|
||||||
sourceArgs:{'pageName':"Home"}
|
sourceArgs:{'pageName':"Home"}
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "File"
|
menuText: qsTr("File")
|
||||||
menuIcon: RibbonIcons.Document
|
menuIcon: RibbonIcons.Document
|
||||||
type: RibbonBackStageView.MenuItemLocation.Head
|
type: RibbonBackStageView.MenuItemLocation.Head
|
||||||
sourceComponent: t_content
|
sourceComponent: t_content
|
||||||
sourceArgs:{'pageName':"File"}
|
sourceArgs:{'pageName':"File"}
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "Search"
|
menuText: qsTr("Search")
|
||||||
menuIcon: RibbonIcons.Search
|
menuIcon: RibbonIcons.Search
|
||||||
type: RibbonBackStageView.MenuItemLocation.Body
|
type: RibbonBackStageView.MenuItemLocation.Body
|
||||||
sourceComponent: t_content
|
sourceComponent: t_content
|
||||||
sourceArgs:{'pageName':"Search"}
|
sourceArgs:{'pageName':"Search"}
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "Account"
|
menuText: qsTr("Account")
|
||||||
menuIcon: RibbonIcons.PersonAccounts
|
menuIcon: RibbonIcons.PersonAccounts
|
||||||
type: RibbonBackStageView.MenuItemLocation.Tail
|
type: RibbonBackStageView.MenuItemLocation.Tail
|
||||||
clickOnly: true
|
clickOnly: true
|
||||||
clickFunc: ()=>console.log("Menu Account clicked")
|
clickFunc: ()=>console.log("Menu Account clicked")
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "About"
|
menuText: qsTr("About")
|
||||||
menuIcon: RibbonIcons.Info
|
menuIcon: RibbonIcons.Info
|
||||||
type: RibbonBackStageView.MenuItemLocation.Tail
|
type: RibbonBackStageView.MenuItemLocation.Tail
|
||||||
clickOnly: true
|
clickOnly: true
|
||||||
clickFunc: ()=>root.showWindow(Qt.resolvedUrl("about.qml"))
|
clickFunc: ()=>root.showWindow(Qt.resolvedUrl("about.qml"))
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "Settings"
|
menuText: qsTr("Settings")
|
||||||
menuIcon: RibbonIcons.Settings
|
menuIcon: RibbonIcons.Settings
|
||||||
type: RibbonBackStageView.MenuItemLocation.Tail
|
type: RibbonBackStageView.MenuItemLocation.Tail
|
||||||
sourceUrl: Qt.resolvedUrl("pages/SettingsMenuPage.qml")
|
sourceUrl: Qt.resolvedUrl("pages/SettingsMenuPage.qml")
|
||||||
|
|
|
@ -108,5 +108,43 @@ RibbonBackStagePage{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RibbonBackStageGroup{
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
Layout.preferredHeight: lang_combo.height + 40
|
||||||
|
Layout.fillWidth: true
|
||||||
|
groupName: qsTr("Language")
|
||||||
|
ColumnLayout{
|
||||||
|
RowLayout{
|
||||||
|
RibbonText{
|
||||||
|
text: qsTr("Current Language: ")
|
||||||
|
}
|
||||||
|
RibbonComboBox{
|
||||||
|
id: lang_combo
|
||||||
|
model: ListModel {
|
||||||
|
id: model_lang
|
||||||
|
}
|
||||||
|
iconSource: RibbonIcons.LocalLanguage
|
||||||
|
Component.onCompleted: update_state()
|
||||||
|
onActivated: {
|
||||||
|
RibbonLocalization.currentLanguage = currentText
|
||||||
|
}
|
||||||
|
Connections{
|
||||||
|
target: RibbonLocalization
|
||||||
|
function onCurrentLanguageChanged(){
|
||||||
|
lang_combo.update_state()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function update_state(){
|
||||||
|
model_lang.clear()
|
||||||
|
let langs = RibbonLocalization.languageList()
|
||||||
|
for(let i = 0; i < langs.length; i++){
|
||||||
|
model_lang.append({text:langs[i]})
|
||||||
|
}
|
||||||
|
currentIndex = find(RibbonLocalization.currentLanguage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ RibbonWindow {
|
||||||
title: qsTr("RibbonUI APP")
|
title: qsTr("RibbonUI APP")
|
||||||
comfirmedQuit: true
|
comfirmedQuit: true
|
||||||
property bool modernStyle: RibbonTheme.modernStyle
|
property bool modernStyle: RibbonTheme.modernStyle
|
||||||
|
|
||||||
RibbonMessageBarGroup{
|
RibbonMessageBarGroup{
|
||||||
id: msg_bar
|
id: msg_bar
|
||||||
implicitWidth: windowItems.width
|
implicitWidth: windowItems.width
|
||||||
|
@ -142,7 +143,10 @@ RibbonWindow {
|
||||||
blurEnabled: true
|
blurEnabled: true
|
||||||
targetRect: Qt.rect(windowItems.x + x, windowItems.y + y, width, height)
|
targetRect: Qt.rect(windowItems.x + x, windowItems.y + y, width, height)
|
||||||
}
|
}
|
||||||
Component.onCompleted: tour.open()
|
Component.onCompleted: {
|
||||||
|
RibbonUI.autoLoadLanguage = true
|
||||||
|
tour.open()
|
||||||
|
}
|
||||||
|
|
||||||
TabBar{
|
TabBar{
|
||||||
id: tab_bar
|
id: tab_bar
|
||||||
|
@ -369,42 +373,42 @@ RibbonWindow {
|
||||||
blurTarget: root.windowItems
|
blurTarget: root.windowItems
|
||||||
radius: borderRadius
|
radius: borderRadius
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "Home"
|
menuText: qsTr("Home")
|
||||||
menuIcon: RibbonIcons.Home
|
menuIcon: RibbonIcons.Home
|
||||||
type: RibbonBackStageView.MenuItemLocation.Head
|
type: RibbonBackStageView.MenuItemLocation.Head
|
||||||
sourceComponent: t_content
|
sourceComponent: t_content
|
||||||
sourceArgs:{'pageName':"Home"}
|
sourceArgs:{'pageName':"Home"}
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "File"
|
menuText: qsTr("File")
|
||||||
menuIcon: RibbonIcons.Document
|
menuIcon: RibbonIcons.Document
|
||||||
type: RibbonBackStageView.MenuItemLocation.Head
|
type: RibbonBackStageView.MenuItemLocation.Head
|
||||||
sourceComponent: t_content
|
sourceComponent: t_content
|
||||||
sourceArgs:{'pageName':"File"}
|
sourceArgs:{'pageName':"File"}
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "Search"
|
menuText: qsTr("Search")
|
||||||
menuIcon: RibbonIcons.Search
|
menuIcon: RibbonIcons.Search
|
||||||
type: RibbonBackStageView.MenuItemLocation.Body
|
type: RibbonBackStageView.MenuItemLocation.Body
|
||||||
sourceComponent: t_content
|
sourceComponent: t_content
|
||||||
sourceArgs:{'pageName':"Search"}
|
sourceArgs:{'pageName':"Search"}
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "Account"
|
menuText: qsTr("Account")
|
||||||
menuIcon: RibbonIcons.PersonAccounts
|
menuIcon: RibbonIcons.PersonAccounts
|
||||||
type: RibbonBackStageView.MenuItemLocation.Tail
|
type: RibbonBackStageView.MenuItemLocation.Tail
|
||||||
clickOnly: true
|
clickOnly: true
|
||||||
clickFunc: ()=>console.log("Menu Account clicked")
|
clickFunc: ()=>console.log("Menu Account clicked")
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "About"
|
menuText: qsTr("About")
|
||||||
menuIcon: RibbonIcons.Info
|
menuIcon: RibbonIcons.Info
|
||||||
type: RibbonBackStageView.MenuItemLocation.Tail
|
type: RibbonBackStageView.MenuItemLocation.Tail
|
||||||
clickOnly: true
|
clickOnly: true
|
||||||
clickFunc: ()=>root.showWindow(Qt.resolvedUrl("about.qml"))
|
clickFunc: ()=>root.showWindow(Qt.resolvedUrl("about.qml"))
|
||||||
}
|
}
|
||||||
RibbonBackStageMenuItem{
|
RibbonBackStageMenuItem{
|
||||||
menuText: "Settings"
|
menuText: qsTr("Settings")
|
||||||
menuIcon: RibbonIcons.Settings
|
menuIcon: RibbonIcons.Settings
|
||||||
type: RibbonBackStageView.MenuItemLocation.Tail
|
type: RibbonBackStageView.MenuItemLocation.Tail
|
||||||
sourceUrl: Qt.resolvedUrl("pages/SettingsMenuPage.qml")
|
sourceUrl: Qt.resolvedUrl("pages/SettingsMenuPage.qml")
|
||||||
|
|
|
@ -108,5 +108,43 @@ RibbonBackStagePage{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RibbonBackStageGroup{
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
Layout.preferredHeight: lang_combo.height + 40
|
||||||
|
Layout.fillWidth: true
|
||||||
|
groupName: qsTr("Language")
|
||||||
|
ColumnLayout{
|
||||||
|
RowLayout{
|
||||||
|
RibbonText{
|
||||||
|
text: qsTr("Current Language: ")
|
||||||
|
}
|
||||||
|
RibbonComboBox{
|
||||||
|
id: lang_combo
|
||||||
|
model: ListModel {
|
||||||
|
id: model_lang
|
||||||
|
}
|
||||||
|
iconSource: RibbonIcons.LocalLanguage
|
||||||
|
Component.onCompleted: update_state()
|
||||||
|
onActivated: {
|
||||||
|
RibbonLocalization.currentLanguage = currentText
|
||||||
|
}
|
||||||
|
Connections{
|
||||||
|
target: RibbonLocalization
|
||||||
|
function onCurrentLanguageChanged(){
|
||||||
|
lang_combo.update_state()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function update_state(){
|
||||||
|
model_lang.clear()
|
||||||
|
let langs = RibbonLocalization.languageList()
|
||||||
|
for(let i = 0; i < langs.length; i++){
|
||||||
|
model_lang.append({text:langs[i]})
|
||||||
|
}
|
||||||
|
currentIndex = find(RibbonLocalization.currentLanguage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ endif()
|
||||||
|
|
||||||
# Find Qt package
|
# Find Qt package
|
||||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick Qml REQUIRED)
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick Qml LinguistTools REQUIRED)
|
||||||
|
|
||||||
# Determine library type and plugin target name based on build type
|
# Determine library type and plugin target name based on build type
|
||||||
if (RIBBONUI_BUILD_STATIC_LIB)
|
if (RIBBONUI_BUILD_STATIC_LIB)
|
||||||
|
@ -30,6 +30,9 @@ else()
|
||||||
set(PLUGIN_TARGET_NAME ${PROJECT_NAME})
|
set(PLUGIN_TARGET_NAME ${PROJECT_NAME})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# List all ts files to be used in the project
|
||||||
|
set(ts_files i18n/${PROJECT_NAME}_zh_CN.ts i18n/${PROJECT_NAME}_en_US.ts)
|
||||||
|
|
||||||
# List of QML files to be included in the project
|
# List of QML files to be included in the project
|
||||||
set(qml_files
|
set(qml_files
|
||||||
RibbonTabBar.qml RibbonTabButton.qml RibbonView.qml
|
RibbonTabBar.qml RibbonTabButton.qml RibbonView.qml
|
||||||
|
@ -58,8 +61,11 @@ list(TRANSFORM qml_files PREPEND ${qml_prefix})
|
||||||
|
|
||||||
# List of source files to be included in the project
|
# List of source files to be included in the project
|
||||||
set (source_files
|
set (source_files
|
||||||
ribbonui.cpp ribbonui.h definitions.h ribbontheme.h ribbontheme.cpp
|
include/ribbonui.h source/ribbonui.cpp
|
||||||
platformsupport.h)
|
include/definitions.h
|
||||||
|
include/ribbontheme.h source/ribbontheme.cpp
|
||||||
|
include/platformsupport.h
|
||||||
|
include/ribbonlocalization.h source/ribbonlocalization.cpp)
|
||||||
|
|
||||||
# Configure version header
|
# Configure version header
|
||||||
set(__ribbonui_project_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
set(__ribbonui_project_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||||
|
@ -70,7 +76,7 @@ list(APPEND source_files ${CMAKE_CURRENT_BINARY_DIR}/${__ribbonui_project_name_l
|
||||||
|
|
||||||
# Add platform-specific source files for Apple
|
# Add platform-specific source files for Apple
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
list(APPEND source_files platformsupport.mm)
|
list(APPEND source_files source/platformsupport.mm)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set properties for QML files
|
# Set properties for QML files
|
||||||
|
@ -89,6 +95,31 @@ endif()
|
||||||
# Define the RibbonUI library
|
# Define the RibbonUI library
|
||||||
qt_add_library(${PROJECT_NAME} ${LIB_TYPE})
|
qt_add_library(${PROJECT_NAME} ${LIB_TYPE})
|
||||||
|
|
||||||
|
# Add i18n files
|
||||||
|
set_source_files_properties(${ts_files} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/i18n)
|
||||||
|
|
||||||
|
if(QT_VERSION VERSION_LESS 6.0)
|
||||||
|
qt5_create_translation_plus(qm_files ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files})
|
||||||
|
foreach(qm_file ${qm_files})
|
||||||
|
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" r_qm_file ${qm_file})
|
||||||
|
list(APPEND r_qm_files ${r_qm_file})
|
||||||
|
endforeach()
|
||||||
|
qt5_add_resources_plus(${PROJECT_NAME} "${PROJECT_NAME}-translations"
|
||||||
|
PREFIX "/"
|
||||||
|
FILES ${r_qm_files}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
qt6_create_translation(qm_files ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files})
|
||||||
|
foreach(qm_file ${qm_files})
|
||||||
|
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" r_qm_file ${qm_file})
|
||||||
|
list(APPEND r_qm_files ${r_qm_file})
|
||||||
|
endforeach()
|
||||||
|
qt6_add_resources(${PROJECT_NAME} "${PROJECT_NAME}-translations"
|
||||||
|
PREFIX "/"
|
||||||
|
FILES ${r_qm_files}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Define the QML module for the library
|
# Define the QML module for the library
|
||||||
qt_add_qml_module(${PROJECT_NAME}
|
qt_add_qml_module(${PROJECT_NAME}
|
||||||
PLUGIN_TARGET ${PLUGIN_TARGET_NAME}
|
PLUGIN_TARGET ${PLUGIN_TARGET_NAME}
|
||||||
|
@ -130,7 +161,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
|
||||||
|
|
||||||
# Include directories
|
# Include directories
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||||
${PROJECT_SOURCE_DIR}
|
${PROJECT_SOURCE_DIR}/include
|
||||||
${PROJECT_SOURCE_DIR}/3rdparty/qwindowkit/include
|
${PROJECT_SOURCE_DIR}/3rdparty/qwindowkit/include
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,376 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US">
|
||||||
|
<context>
|
||||||
|
<name>RibbonBackStageGroup</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageGroup.qml" line="6"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageGroup.qml" line="8"/>
|
||||||
|
<source>Title</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonBackStagePage</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStagePage.qml" line="6"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStagePage.qml" line="8"/>
|
||||||
|
<source>Name</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonBackStageView</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="22"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="22"/>
|
||||||
|
<source>Back</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="482"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="476"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="493"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="487"/>
|
||||||
|
<source>Minimize</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="504"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="498"/>
|
||||||
|
<source>Restore</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="504"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="498"/>
|
||||||
|
<source>Maximize</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonLineEdit</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonLineEdit.qml" line="19"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonLineEdit.qml" line="19"/>
|
||||||
|
<source>Please input:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonLineEdit.qml" line="84"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonLineEdit.qml" line="84"/>
|
||||||
|
<source>Clear</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonMessageBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="30"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="30"/>
|
||||||
|
<source>Link</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="31"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="31"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="32"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="32"/>
|
||||||
|
<source>See More</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="33"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="33"/>
|
||||||
|
<source>ActionA</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="34"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="34"/>
|
||||||
|
<source>ActionB</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="39"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="39"/>
|
||||||
|
<source>ActionA Clicked</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="40"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="40"/>
|
||||||
|
<source>ActionB Clicked</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonMessageBarGroup</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBarGroup.qml" line="180"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBarGroup.qml" line="180"/>
|
||||||
|
<source>Clear All</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBarGroup.qml" line="194"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBarGroup.qml" line="194"/>
|
||||||
|
<source>Show all messages</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBarGroup.qml" line="194"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBarGroup.qml" line="194"/>
|
||||||
|
<source>Hide all messages</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonPageIndicator</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonPageIndicator.qml" line="93"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonPageIndicator.qml" line="93"/>
|
||||||
|
<source>Previous</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonPageIndicator.qml" line="152"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonPageIndicator.qml" line="152"/>
|
||||||
|
<source>Next</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonProgressBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonProgressBar.qml" line="28"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonProgressBar.qml" line="28"/>
|
||||||
|
<source>Loading</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonSwitchButton</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonSwitchButton.qml" line="16"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonSwitchButton.qml" line="16"/>
|
||||||
|
<source>Open</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonSwitchButton.qml" line="16"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonSwitchButton.qml" line="16"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTabBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabBar.qml" line="118"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabBar.qml" line="118"/>
|
||||||
|
<source>Settings</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabBar.qml" line="210"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabBar.qml" line="210"/>
|
||||||
|
<source>Show</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabBar.qml" line="210"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabBar.qml" line="210"/>
|
||||||
|
<source>Hide</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabBar.qml" line="302"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabBar.qml" line="301"/>
|
||||||
|
<source>RibbonTabBar: Error loading component:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTabGroup</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabGroup.qml" line="88"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="87"/>
|
||||||
|
<source>Open </source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabGroup.qml" line="88"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="87"/>
|
||||||
|
<source>'s external</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTextBoxMenu</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextBoxMenu.qml" line="20"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextBoxMenu.qml" line="19"/>
|
||||||
|
<source>Cut</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextBoxMenu.qml" line="27"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextBoxMenu.qml" line="26"/>
|
||||||
|
<source>Copy</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextBoxMenu.qml" line="34"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextBoxMenu.qml" line="33"/>
|
||||||
|
<source>Paste</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextBoxMenu.qml" line="41"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextBoxMenu.qml" line="40"/>
|
||||||
|
<source>Select All</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTextEdit</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextEdit.qml" line="39"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextEdit.qml" line="39"/>
|
||||||
|
<source>Please input:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextEdit.qml" line="108"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextEdit.qml" line="108"/>
|
||||||
|
<source>Clear</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTitleBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="151"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="151"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="164"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="164"/>
|
||||||
|
<source>Minimize</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="177"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="177"/>
|
||||||
|
<source>Restore</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="177"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="177"/>
|
||||||
|
<source>Maximize</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="187"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="187"/>
|
||||||
|
<source>Style</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="188"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="188"/>
|
||||||
|
<source>Modern</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="188"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="188"/>
|
||||||
|
<source>Classic</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="204"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="204"/>
|
||||||
|
<source>Dark Mode</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="225"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="225"/>
|
||||||
|
<source>Stay on Top</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTour</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTour.qml" line="111"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTour.qml" line="112"/>
|
||||||
|
<source>Don't auto pop up</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTour.qml" line="115"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTour.qml" line="116"/>
|
||||||
|
<source>Previous</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTour.qml" line="127"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTour.qml" line="128"/>
|
||||||
|
<source>Finish</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTour.qml" line="127"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTour.qml" line="128"/>
|
||||||
|
<source>Next</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonWindow</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="148"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="149"/>
|
||||||
|
<source>Quit</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="149"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="150"/>
|
||||||
|
<source>Minimize</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="150"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="151"/>
|
||||||
|
<source>Cancel</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="151"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="152"/>
|
||||||
|
<source>Do you want to close this window?</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="152"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="153"/>
|
||||||
|
<source>Please note</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
|
@ -0,0 +1,377 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="zh_CN">
|
||||||
|
<context>
|
||||||
|
<name>RibbonBackStageGroup</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageGroup.qml" line="6"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageGroup.qml" line="8"/>
|
||||||
|
<source>Title</source>
|
||||||
|
<translation>标题</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonBackStagePage</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStagePage.qml" line="6"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStagePage.qml" line="8"/>
|
||||||
|
<source>Name</source>
|
||||||
|
<translation>页面名称</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonBackStageView</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="22"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="22"/>
|
||||||
|
<source>Back</source>
|
||||||
|
<translation>返回</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="482"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="476"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation>关闭</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="493"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="487"/>
|
||||||
|
<source>Minimize</source>
|
||||||
|
<translation>最小化</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="504"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="498"/>
|
||||||
|
<source>Restore</source>
|
||||||
|
<translation>还原</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="504"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="498"/>
|
||||||
|
<source>Maximize</source>
|
||||||
|
<translation>最大化</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonLineEdit</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonLineEdit.qml" line="19"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonLineEdit.qml" line="19"/>
|
||||||
|
<source>Please input:</source>
|
||||||
|
<translation>请输入:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonLineEdit.qml" line="84"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonLineEdit.qml" line="84"/>
|
||||||
|
<source>Clear</source>
|
||||||
|
<translation>清除</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonMessageBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="30"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="30"/>
|
||||||
|
<source>Link</source>
|
||||||
|
<translation>外部链接</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="31"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="31"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation>关闭</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="32"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="32"/>
|
||||||
|
<source>See More</source>
|
||||||
|
<translation>查看更多</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="33"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="33"/>
|
||||||
|
<source>ActionA</source>
|
||||||
|
<translation>按钮A</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="34"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="34"/>
|
||||||
|
<source>ActionB</source>
|
||||||
|
<translation>按钮B</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="39"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="39"/>
|
||||||
|
<source>ActionA Clicked</source>
|
||||||
|
<translation>按钮A被点击</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBar.qml" line="40"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBar.qml" line="40"/>
|
||||||
|
<source>ActionB Clicked</source>
|
||||||
|
<translation>按钮B被点击</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonMessageBarGroup</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBarGroup.qml" line="180"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBarGroup.qml" line="180"/>
|
||||||
|
<source>Clear All</source>
|
||||||
|
<translation>清除全部</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBarGroup.qml" line="194"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBarGroup.qml" line="194"/>
|
||||||
|
<source>Show all messages</source>
|
||||||
|
<translation>显示全部消息</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonMessageBarGroup.qml" line="194"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonMessageBarGroup.qml" line="194"/>
|
||||||
|
<source>Hide all messages</source>
|
||||||
|
<translation>隐藏全部消息</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonPageIndicator</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonPageIndicator.qml" line="93"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonPageIndicator.qml" line="93"/>
|
||||||
|
<source>Previous</source>
|
||||||
|
<translation>上一个</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonPageIndicator.qml" line="152"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonPageIndicator.qml" line="152"/>
|
||||||
|
<source>Next</source>
|
||||||
|
<translation>下一个</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonProgressBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonProgressBar.qml" line="28"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonProgressBar.qml" line="28"/>
|
||||||
|
<source>Loading</source>
|
||||||
|
<translation>加载中</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonSwitchButton</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonSwitchButton.qml" line="16"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonSwitchButton.qml" line="16"/>
|
||||||
|
<source>Open</source>
|
||||||
|
<translation>打开</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonSwitchButton.qml" line="16"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonSwitchButton.qml" line="16"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation>关闭</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTabBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabBar.qml" line="118"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabBar.qml" line="118"/>
|
||||||
|
<source>Settings</source>
|
||||||
|
<translation>设置</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabBar.qml" line="210"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabBar.qml" line="210"/>
|
||||||
|
<source>Show</source>
|
||||||
|
<translation>显示</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabBar.qml" line="210"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabBar.qml" line="210"/>
|
||||||
|
<source>Hide</source>
|
||||||
|
<translation>隐藏</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabBar.qml" line="302"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabBar.qml" line="301"/>
|
||||||
|
<source>RibbonTabBar: Error loading component:</source>
|
||||||
|
<translation>RibbonTabBar:加载组件失败:</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTabGroup</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabGroup.qml" line="88"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="87"/>
|
||||||
|
<source>Open </source>
|
||||||
|
<translation>打开 </translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTabGroup.qml" line="88"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="87"/>
|
||||||
|
<source>'s external</source>
|
||||||
|
<translation>的外部链接</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTextBoxMenu</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextBoxMenu.qml" line="20"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextBoxMenu.qml" line="19"/>
|
||||||
|
<source>Cut</source>
|
||||||
|
<translation>剪切</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextBoxMenu.qml" line="27"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextBoxMenu.qml" line="26"/>
|
||||||
|
<source>Copy</source>
|
||||||
|
<translation>拷贝</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextBoxMenu.qml" line="34"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextBoxMenu.qml" line="33"/>
|
||||||
|
<source>Paste</source>
|
||||||
|
<translation>粘贴</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextBoxMenu.qml" line="41"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextBoxMenu.qml" line="40"/>
|
||||||
|
<source>Select All</source>
|
||||||
|
<translatorcomment>全选</translatorcomment>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTextEdit</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextEdit.qml" line="39"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextEdit.qml" line="39"/>
|
||||||
|
<source>Please input:</source>
|
||||||
|
<translation>请输入:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTextEdit.qml" line="108"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTextEdit.qml" line="108"/>
|
||||||
|
<source>Clear</source>
|
||||||
|
<translation>清除</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTitleBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="151"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="151"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation>关闭</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="164"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="164"/>
|
||||||
|
<source>Minimize</source>
|
||||||
|
<translation>最小化</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="177"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="177"/>
|
||||||
|
<source>Restore</source>
|
||||||
|
<translation>还原</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="177"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="177"/>
|
||||||
|
<source>Maximize</source>
|
||||||
|
<translation>最大化</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="187"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="187"/>
|
||||||
|
<source>Style</source>
|
||||||
|
<translation>风格</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="188"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="188"/>
|
||||||
|
<source>Modern</source>
|
||||||
|
<translation>现代化</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="188"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="188"/>
|
||||||
|
<source>Classic</source>
|
||||||
|
<translation>经典</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="204"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="204"/>
|
||||||
|
<source>Dark Mode</source>
|
||||||
|
<translation>暗色模式</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTitleBar.qml" line="225"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTitleBar.qml" line="225"/>
|
||||||
|
<source>Stay on Top</source>
|
||||||
|
<translation>总是显示在顶层</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonTour</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTour.qml" line="111"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTour.qml" line="112"/>
|
||||||
|
<source>Don't auto pop up</source>
|
||||||
|
<translation>不要自动弹出</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTour.qml" line="115"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTour.qml" line="116"/>
|
||||||
|
<source>Previous</source>
|
||||||
|
<translation>上一个</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTour.qml" line="127"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTour.qml" line="128"/>
|
||||||
|
<source>Finish</source>
|
||||||
|
<translation>完成</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonTour.qml" line="127"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonTour.qml" line="128"/>
|
||||||
|
<source>Next</source>
|
||||||
|
<translation>下一个</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RibbonWindow</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="148"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="149"/>
|
||||||
|
<source>Quit</source>
|
||||||
|
<translation>退出</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="149"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="150"/>
|
||||||
|
<source>Minimize</source>
|
||||||
|
<translation>最小化</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="150"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="151"/>
|
||||||
|
<source>Cancel</source>
|
||||||
|
<translation>取消</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="151"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="152"/>
|
||||||
|
<source>Do you want to close this window?</source>
|
||||||
|
<translation>需要关闭窗口吗?</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../qml/Qt5/RibbonWindow.qml" line="152"/>
|
||||||
|
<location filename="../qml/Qt6/RibbonWindow.qml" line="153"/>
|
||||||
|
<source>Please note</source>
|
||||||
|
<translation>请注意</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
|
@ -2355,8 +2355,8 @@ enum class RibbonIcons_Filled{
|
||||||
Q_ENUM_NS(RibbonIcons_Filled)
|
Q_ENUM_NS(RibbonIcons_Filled)
|
||||||
QML_NAMED_ELEMENT(RibbonIcons_Filled)
|
QML_NAMED_ELEMENT(RibbonIcons_Filled)
|
||||||
#if (QT_VERSION > QT_VERSION_CHECK(6, 3, 0))
|
#if (QT_VERSION > QT_VERSION_CHECK(6, 3, 0))
|
||||||
Q_CLASSINFO("QML.Creatable", "false")
|
Q_CLASSINFO("QML.Creatable", "false")
|
||||||
Q_CLASSINFO("QML.UncreatableReason", "This type is right-valued only.")
|
Q_CLASSINFO("QML.UncreatableReason", "This type is right-valued only.")
|
||||||
#elif (QT_VERSION <= QT_VERSION_CHECK(6, 3, 0))
|
#elif (QT_VERSION <= QT_VERSION_CHECK(6, 3, 0))
|
||||||
QML_UNCREATABLE("This type is right-valued only.")
|
QML_UNCREATABLE("This type is right-valued only.")
|
||||||
#endif
|
#endif
|
||||||
|
@ -4718,30 +4718,30 @@ QML_UNCREATABLE("This type is right-valued only.")
|
||||||
|
|
||||||
#define Q_PROPERTY_RW(TYPE, M) \
|
#define Q_PROPERTY_RW(TYPE, M) \
|
||||||
Q_PROPERTY(TYPE M MEMBER _##M NOTIFY M##Changed FINAL) \
|
Q_PROPERTY(TYPE M MEMBER _##M NOTIFY M##Changed FINAL) \
|
||||||
public: \
|
public: \
|
||||||
Q_SIGNAL void M##Changed(); \
|
Q_SIGNAL void M##Changed(); \
|
||||||
void M(TYPE in_##M) \
|
void M(TYPE in_##M) \
|
||||||
{ \
|
{ \
|
||||||
_##M = in_##M; \
|
_##M = in_##M; \
|
||||||
Q_EMIT M##Changed(); \
|
Q_EMIT M##Changed(); \
|
||||||
} \
|
} \
|
||||||
TYPE M() \
|
TYPE M() \
|
||||||
{ \
|
{ \
|
||||||
return _##M; \
|
return _##M; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
private: \
|
private: \
|
||||||
TYPE _##M;
|
TYPE _##M;
|
||||||
|
|
||||||
#define Q_PROPERTY_R(TYPE, M) \
|
#define Q_PROPERTY_R(TYPE, M) \
|
||||||
Q_PROPERTY(TYPE M READ M NOTIFY M##Changed FINAL) \
|
Q_PROPERTY(TYPE M READ M NOTIFY M##Changed FINAL) \
|
||||||
public: \
|
public: \
|
||||||
Q_SIGNAL void M##Changed(); \
|
Q_SIGNAL void M##Changed(); \
|
||||||
TYPE M() \
|
TYPE M() \
|
||||||
{ \
|
{ \
|
||||||
return _##M; \
|
return _##M; \
|
||||||
} \
|
} \
|
||||||
private: \
|
private: \
|
||||||
TYPE _##M;
|
TYPE _##M;
|
||||||
|
|
||||||
namespace RibbonPopupDialogType {
|
namespace RibbonPopupDialogType {
|
|
@ -0,0 +1,46 @@
|
||||||
|
#ifndef RIBBONLOCALIZATION_H
|
||||||
|
#define RIBBONLOCALIZATION_H
|
||||||
|
|
||||||
|
#include <QQuickItem>
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
|
class RibbonLocalization : public QQuickItem
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
QML_ELEMENT
|
||||||
|
QML_SINGLETON
|
||||||
|
QML_NAMED_ELEMENT(RibbonLocalization)
|
||||||
|
Q_PROPERTY(QString currentLanguage READ currentLanguage WRITE setCurrentLanguage NOTIFY currentLanguageChanged FINAL)
|
||||||
|
public:
|
||||||
|
typedef QPair<QString, QString> LangItem; // example: <"zh_CN", "qrc://i18n/xxx_zh_CN.qm">
|
||||||
|
typedef QMap<QString, QSharedPointer<QTranslator>> Translator; // example: <"main", mainTranslator>
|
||||||
|
typedef QMap<LangItem, QString> ModuleTranslator; // example: <zhItem, "main">
|
||||||
|
static RibbonLocalization* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
|
||||||
|
static RibbonLocalization* instance();
|
||||||
|
Q_INVOKABLE bool registerLanguage(QString langName, QString path, QString moduleName);
|
||||||
|
Q_INVOKABLE bool removeLanguage(QString langName, QString path);
|
||||||
|
Q_INVOKABLE void bindEngine();
|
||||||
|
Q_INVOKABLE QList<QString> languageList();
|
||||||
|
QString currentLanguage();
|
||||||
|
bool setCurrentLanguage(QString langName);
|
||||||
|
// Use if you need to directly save/load language from config files
|
||||||
|
Q_INVOKABLE virtual void loadCurrentLanguage(){};
|
||||||
|
virtual bool saveCurrentLanguage(const QString &language){return false;};
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
public:
|
||||||
|
#else
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY_MOVE(RibbonLocalization)
|
||||||
|
#endif
|
||||||
|
RibbonLocalization();
|
||||||
|
~RibbonLocalization();
|
||||||
|
private:
|
||||||
|
ModuleTranslator moduleLangList;
|
||||||
|
Translator transList;
|
||||||
|
QString _currentLang;
|
||||||
|
signals:
|
||||||
|
void currentLanguageChanged();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // RIBBONLOCALIZATION_H
|
|
@ -11,7 +11,7 @@ class RibbonTheme : public QQuickItem
|
||||||
QML_SINGLETON
|
QML_SINGLETON
|
||||||
QML_NAMED_ELEMENT(RibbonTheme)
|
QML_NAMED_ELEMENT(RibbonTheme)
|
||||||
|
|
||||||
Q_PROPERTY(bool isDarkMode READ isDarkMode() NOTIFY isDarkModeChanged FINAL)
|
Q_PROPERTY(bool isDarkMode READ isDarkMode NOTIFY isDarkModeChanged FINAL)
|
||||||
Q_PROPERTY_RW(RibbonThemeType::ThemeMode,themeMode)
|
Q_PROPERTY_RW(RibbonThemeType::ThemeMode,themeMode)
|
||||||
Q_PROPERTY_RW(bool,modernStyle)
|
Q_PROPERTY_RW(bool,modernStyle)
|
||||||
Q_PROPERTY_RW(bool,nativeText)
|
Q_PROPERTY_RW(bool,nativeText)
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include "definitions.h"
|
#include "definitions.h"
|
||||||
|
#include "ribbonlocalization.h"
|
||||||
|
|
||||||
class RibbonUI : public QQuickItem
|
class RibbonUI : public QQuickItem
|
||||||
{
|
{
|
||||||
|
@ -14,11 +15,16 @@ class RibbonUI : public QQuickItem
|
||||||
Q_PROPERTY_R(int, qtVersion)
|
Q_PROPERTY_R(int, qtVersion)
|
||||||
Q_PROPERTY_R(int, isWin11)
|
Q_PROPERTY_R(int, isWin11)
|
||||||
Q_PROPERTY_RW(QVariantMap, windowsSet)
|
Q_PROPERTY_RW(QVariantMap, windowsSet)
|
||||||
|
Q_PROPERTY(bool autoLoadLanguage READ autoLoadLanguage WRITE setAutoLoadLanguage NOTIFY autoLoadLanguageChanged FINAL)
|
||||||
public:
|
public:
|
||||||
static RibbonUI* instance();
|
static RibbonUI* instance();
|
||||||
static RibbonUI* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
|
static RibbonUI* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
|
||||||
RIBBONUI_API static void init();
|
RIBBONUI_API static void init();
|
||||||
RIBBONUI_API static void registerTypes(const char *uri);
|
RIBBONUI_API static void registerTypes(const char *uri);
|
||||||
|
RIBBONUI_API Q_INVOKABLE void setTranslator(RibbonLocalization *translator = RibbonLocalization::instance());
|
||||||
|
Q_INVOKABLE void initTranslator();
|
||||||
|
bool autoLoadLanguage(){return _autoLoadLanguage;};
|
||||||
|
void setAutoLoadLanguage(bool value);
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
public:
|
public:
|
||||||
#else
|
#else
|
||||||
|
@ -26,6 +32,12 @@ private:
|
||||||
Q_DISABLE_COPY_MOVE(RibbonUI)
|
Q_DISABLE_COPY_MOVE(RibbonUI)
|
||||||
#endif
|
#endif
|
||||||
explicit RibbonUI(QQuickItem *parent = nullptr);
|
explicit RibbonUI(QQuickItem *parent = nullptr);
|
||||||
|
private:
|
||||||
|
RibbonLocalization* _translator;
|
||||||
|
bool _autoLoadLanguage = false;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void autoLoadLanguageChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RIBBONUI_H
|
#endif // RIBBONUI_H
|
|
@ -4,6 +4,7 @@ import RibbonUI 1.1
|
||||||
RibbonObject {
|
RibbonObject {
|
||||||
id: control
|
id: control
|
||||||
required property string menuText
|
required property string menuText
|
||||||
|
property int id
|
||||||
property var menuIcon
|
property var menuIcon
|
||||||
property var menuIconFilled
|
property var menuIconFilled
|
||||||
required property var type
|
required property var type
|
||||||
|
|
|
@ -44,6 +44,12 @@ Popup {
|
||||||
if(data_container.resources[index] instanceof RibbonBackStageMenuItem)
|
if(data_container.resources[index] instanceof RibbonBackStageMenuItem)
|
||||||
{
|
{
|
||||||
let item = data_container.resources[index]
|
let item = data_container.resources[index]
|
||||||
|
item.menuTextChanged.connect(function(){
|
||||||
|
item.getPropertiesReady()
|
||||||
|
pageModel[item.id] = item.properties
|
||||||
|
refreshModel()
|
||||||
|
})
|
||||||
|
item.id = pageModel.length
|
||||||
item.getPropertiesReady()
|
item.getPropertiesReady()
|
||||||
pageModel.push(item.properties)
|
pageModel.push(item.properties)
|
||||||
}
|
}
|
||||||
|
@ -555,6 +561,11 @@ Popup {
|
||||||
body_menu_list.model.append(item)
|
body_menu_list.model.append(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
menu_bg.currentMenu = 0
|
||||||
|
head_menu_list.currentIndex = 0
|
||||||
|
body_menu_list.currentIndex = 0
|
||||||
|
tail_menu_list.currentIndex = 0
|
||||||
|
content_view.currentIndex = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function alphaTohex(color, alpha)
|
function alphaTohex(color, alpha)
|
||||||
|
|
|
@ -225,7 +225,8 @@ Item{
|
||||||
{
|
{
|
||||||
let item = stack.contentData[i]
|
let item = stack.contentData[i]
|
||||||
if(item instanceof RibbonTabPage){
|
if(item instanceof RibbonTabPage){
|
||||||
let btn = ribbonTabButton.createObject(bar,{text:qsTr(item.title),index:sign})
|
let btn = ribbonTabButton.createObject(bar,{text:item.title,index:sign})
|
||||||
|
item.titleChanged.connect(function(){btn.text=item.title})
|
||||||
if (sign===0)
|
if (sign===0)
|
||||||
{
|
{
|
||||||
btn.checked = true
|
btn.checked = true
|
||||||
|
|
|
@ -154,6 +154,16 @@ Popup {
|
||||||
if(data_container.resources[index] instanceof RibbonTourItem)
|
if(data_container.resources[index] instanceof RibbonTourItem)
|
||||||
{
|
{
|
||||||
let item = data_container.resources[index]
|
let item = data_container.resources[index]
|
||||||
|
item.titleChanged.connect(function(){
|
||||||
|
item.getPropertiesReady()
|
||||||
|
targetList[item.id] = item.properties
|
||||||
|
})
|
||||||
|
if(item.text){
|
||||||
|
item.textChanged.connect(function(){
|
||||||
|
targetList[item.id].text = item.text
|
||||||
|
})
|
||||||
|
}
|
||||||
|
item.id = targetList.length
|
||||||
item.getPropertiesReady()
|
item.getPropertiesReady()
|
||||||
targetList.push(item.properties)
|
targetList.push(item.properties)
|
||||||
}
|
}
|
||||||
|
@ -164,7 +174,7 @@ Popup {
|
||||||
|
|
||||||
Popup{
|
Popup{
|
||||||
id: rec
|
id: rec
|
||||||
parent: Overlay.overlay
|
parent: popup.parent
|
||||||
margins: 0
|
margins: 0
|
||||||
padding: 0
|
padding: 0
|
||||||
topInset: 0
|
topInset: 0
|
||||||
|
|
|
@ -4,6 +4,7 @@ import RibbonUI 1.1
|
||||||
RibbonObject {
|
RibbonObject {
|
||||||
id: control
|
id: control
|
||||||
required property string title
|
required property string title
|
||||||
|
property int id
|
||||||
property string text
|
property string text
|
||||||
property var target
|
property var target
|
||||||
property var enterFunc
|
property var enterFunc
|
||||||
|
|
|
@ -73,6 +73,8 @@ Window {
|
||||||
{
|
{
|
||||||
windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.isDarkMode ? "dark" : "light" : "none")
|
windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.isDarkMode ? "dark" : "light" : "none")
|
||||||
}
|
}
|
||||||
|
RibbonLocalization.bindEngine();
|
||||||
|
RibbonUI.setTranslator(RibbonLocalization)
|
||||||
}
|
}
|
||||||
Item{
|
Item{
|
||||||
id: windowItems
|
id: windowItems
|
||||||
|
|
|
@ -4,6 +4,7 @@ import RibbonUI
|
||||||
RibbonObject {
|
RibbonObject {
|
||||||
id: control
|
id: control
|
||||||
required property string menuText
|
required property string menuText
|
||||||
|
property int id
|
||||||
property var menuIcon
|
property var menuIcon
|
||||||
property var menuIconFilled
|
property var menuIconFilled
|
||||||
required property var type
|
required property var type
|
||||||
|
|
|
@ -44,6 +44,12 @@ Popup {
|
||||||
if(data_container.resources[index] instanceof RibbonBackStageMenuItem)
|
if(data_container.resources[index] instanceof RibbonBackStageMenuItem)
|
||||||
{
|
{
|
||||||
let item = data_container.resources[index]
|
let item = data_container.resources[index]
|
||||||
|
item.menuTextChanged.connect(function(){
|
||||||
|
item.getPropertiesReady()
|
||||||
|
pageModel[item.id] = item.properties
|
||||||
|
refreshModel()
|
||||||
|
})
|
||||||
|
item.id = pageModel.length
|
||||||
item.getPropertiesReady()
|
item.getPropertiesReady()
|
||||||
pageModel.push(item.properties)
|
pageModel.push(item.properties)
|
||||||
}
|
}
|
||||||
|
@ -555,5 +561,10 @@ Popup {
|
||||||
body_menu_list.model.append(item)
|
body_menu_list.model.append(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
menu_bg.currentMenu = 0
|
||||||
|
head_menu_list.currentIndex = 0
|
||||||
|
body_menu_list.currentIndex = 0
|
||||||
|
tail_menu_list.currentIndex = 0
|
||||||
|
content_view.currentIndex = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,8 @@ Item{
|
||||||
{
|
{
|
||||||
let item = stack.contentData[i]
|
let item = stack.contentData[i]
|
||||||
if(item instanceof RibbonTabPage){
|
if(item instanceof RibbonTabPage){
|
||||||
let btn = ribbonTabButton.createObject(bar,{text:qsTr(item.title),index:sign})
|
let btn = ribbonTabButton.createObject(bar,{text:item.title,index:sign})
|
||||||
|
item.titleChanged.connect(function(){btn.text=item.title})
|
||||||
if (sign===0)
|
if (sign===0)
|
||||||
{
|
{
|
||||||
btn.checked = true
|
btn.checked = true
|
||||||
|
|
|
@ -57,7 +57,7 @@ Popup {
|
||||||
radius: 7
|
radius: 7
|
||||||
maskOpacity: blurEnabled ? 0.9 : 1
|
maskOpacity: blurEnabled ? 0.9 : 1
|
||||||
maskBorderColor: RibbonTheme.modernStyle ?
|
maskBorderColor: RibbonTheme.modernStyle ?
|
||||||
RibbonTheme.isDarkMode ? "#7A7A7A" : "#2C59B7" :
|
RibbonTheme.isDarkMode ? "#7A7A7A" : "#2C59B7" :
|
||||||
RibbonTheme.isDarkMode ? "#5C5D5D" : "#B5B4B5"
|
RibbonTheme.isDarkMode ? "#5C5D5D" : "#B5B4B5"
|
||||||
maskBorderWidth: 1
|
maskBorderWidth: 1
|
||||||
}
|
}
|
||||||
|
@ -155,6 +155,16 @@ Popup {
|
||||||
if(data_container.resources[index] instanceof RibbonTourItem)
|
if(data_container.resources[index] instanceof RibbonTourItem)
|
||||||
{
|
{
|
||||||
let item = data_container.resources[index]
|
let item = data_container.resources[index]
|
||||||
|
item.titleChanged.connect(function(){
|
||||||
|
item.getPropertiesReady()
|
||||||
|
targetList[item.id] = item.properties
|
||||||
|
})
|
||||||
|
if(item.text){
|
||||||
|
item.textChanged.connect(function(){
|
||||||
|
targetList[item.id].text = item.text
|
||||||
|
})
|
||||||
|
}
|
||||||
|
item.id = targetList.length
|
||||||
item.getPropertiesReady()
|
item.getPropertiesReady()
|
||||||
targetList.push(item.properties)
|
targetList.push(item.properties)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import RibbonUI
|
||||||
RibbonObject {
|
RibbonObject {
|
||||||
id: control
|
id: control
|
||||||
required property string title
|
required property string title
|
||||||
|
property int id
|
||||||
property string text
|
property string text
|
||||||
property var target
|
property var target
|
||||||
property var enterFunc
|
property var enterFunc
|
||||||
|
|
|
@ -73,6 +73,8 @@ Window {
|
||||||
{
|
{
|
||||||
windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.isDarkMode ? "dark" : "light" : "none")
|
windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.isDarkMode ? "dark" : "light" : "none")
|
||||||
}
|
}
|
||||||
|
RibbonLocalization.bindEngine();
|
||||||
|
RibbonUI.setTranslator(RibbonLocalization)
|
||||||
}
|
}
|
||||||
Item{
|
Item{
|
||||||
id: windowItems
|
id: windowItems
|
||||||
|
|
|
@ -0,0 +1,106 @@
|
||||||
|
#include "ribbonlocalization.h"
|
||||||
|
#include <QMutex>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QQmlApplicationEngine>
|
||||||
|
|
||||||
|
RibbonLocalization::RibbonLocalization() {
|
||||||
|
_currentLang = "en_US";
|
||||||
|
}
|
||||||
|
|
||||||
|
RibbonLocalization::~RibbonLocalization() {
|
||||||
|
for (auto item : transList)
|
||||||
|
item.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
RibbonLocalization* RibbonLocalization::instance(){
|
||||||
|
static QMutex mutex;
|
||||||
|
QMutexLocker locker(&mutex);
|
||||||
|
|
||||||
|
static RibbonLocalization *singleton = nullptr;
|
||||||
|
if (!singleton) {
|
||||||
|
singleton = new RibbonLocalization();
|
||||||
|
}
|
||||||
|
return singleton;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RibbonLocalization::registerLanguage(QString langName, QString path, QString moduleName){
|
||||||
|
LangItem temp(langName, path);
|
||||||
|
if(!moduleLangList.contains(temp)){
|
||||||
|
if(!transList.contains(moduleName)){
|
||||||
|
transList.insert(moduleName, QSharedPointer<QTranslator>(new QTranslator));
|
||||||
|
if(langName == _currentLang){
|
||||||
|
Q_UNUSED(transList[moduleName].get()->load(path));
|
||||||
|
qApp->installTranslator(transList[moduleName].get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
moduleLangList.insert(temp, moduleName);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RibbonLocalization::removeLanguage(QString langName, QString path){
|
||||||
|
LangItem temp(langName, path);
|
||||||
|
if(moduleLangList.contains(temp)){
|
||||||
|
if(langName == _currentLang){
|
||||||
|
qApp->removeTranslator(transList[moduleLangList[temp]].get());
|
||||||
|
_currentLang = "en_US";
|
||||||
|
emit currentLanguageChanged();
|
||||||
|
}
|
||||||
|
transList[moduleLangList[temp]].clear();
|
||||||
|
transList.remove(moduleLangList[temp]);
|
||||||
|
moduleLangList.remove(temp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RibbonLocalization::currentLanguage(){
|
||||||
|
return _currentLang;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RibbonLocalization::setCurrentLanguage(QString langName){
|
||||||
|
bool hasChanged = false;
|
||||||
|
QMap<QString, bool> isNeeded;
|
||||||
|
for(auto langItem : moduleLangList.keys()){
|
||||||
|
if(langItem.first == langName){
|
||||||
|
isNeeded[moduleLangList[langItem]] = true;
|
||||||
|
Q_UNUSED(transList[moduleLangList[langItem]].get()->load(langItem.second));
|
||||||
|
_currentLang = langName;
|
||||||
|
qApp->installTranslator(transList[moduleLangList[langItem]].get());;
|
||||||
|
hasChanged = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(!isNeeded[moduleLangList[langItem]]){
|
||||||
|
qApp->removeTranslator(transList[moduleLangList[langItem]].get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(hasChanged){
|
||||||
|
saveCurrentLanguage(langName);
|
||||||
|
emit currentLanguageChanged();
|
||||||
|
}
|
||||||
|
return hasChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RibbonLocalization::bindEngine(){
|
||||||
|
QQmlApplicationEngine * engine = dynamic_cast<QQmlApplicationEngine*>(qmlEngine(this));
|
||||||
|
Q_ASSERT(engine);
|
||||||
|
if (!engine)
|
||||||
|
return;
|
||||||
|
QObject::connect(this, &RibbonLocalization::currentLanguageChanged, engine, [engine]() -> void {
|
||||||
|
engine->retranslate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QString> RibbonLocalization::languageList(){
|
||||||
|
QList<QString> list;
|
||||||
|
QSet<QString> set;
|
||||||
|
for(auto langItem : moduleLangList.keys()){
|
||||||
|
set.insert(langItem.first);
|
||||||
|
}
|
||||||
|
for(auto setItem : set){
|
||||||
|
list.append(setItem);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
|
@ -4,6 +4,7 @@
|
||||||
#include <QWKQuick/qwkquickglobal.h>
|
#include <QWKQuick/qwkquickglobal.h>
|
||||||
#include <QtQuick/QQuickWindow>
|
#include <QtQuick/QQuickWindow>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
#include <QDir>
|
||||||
#include "ribbonui_version.h"
|
#include "ribbonui_version.h"
|
||||||
|
|
||||||
RibbonUI::RibbonUI(QQuickItem *parent)
|
RibbonUI::RibbonUI(QQuickItem *parent)
|
||||||
|
@ -12,6 +13,7 @@ RibbonUI::RibbonUI(QQuickItem *parent)
|
||||||
_version = RIBBONUI_VERSION;
|
_version = RIBBONUI_VERSION;
|
||||||
_qtVersion = QString(qVersion()).replace('.',"").toInt();
|
_qtVersion = QString(qVersion()).replace('.',"").toInt();
|
||||||
_isWin11 = QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 22000);
|
_isWin11 = QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 22000);
|
||||||
|
_translator = RibbonLocalization::instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonUI* RibbonUI::instance(){
|
RibbonUI* RibbonUI::instance(){
|
||||||
|
@ -45,3 +47,41 @@ void RibbonUI::registerTypes(const char *uri)
|
||||||
Q_UNUSED(uri);
|
Q_UNUSED(uri);
|
||||||
QWK::registerTypes(nullptr);
|
QWK::registerTypes(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RibbonUI::setTranslator(RibbonLocalization *translator){
|
||||||
|
_translator = translator;
|
||||||
|
initTranslator();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RibbonUI::initTranslator(){
|
||||||
|
QDir dir(":/i18n");
|
||||||
|
QStringList filters;
|
||||||
|
filters<<"*.qm";
|
||||||
|
dir.setNameFilters(filters);
|
||||||
|
QStringList matchedFiles = dir.entryList();
|
||||||
|
for(auto file : matchedFiles){
|
||||||
|
QString project, lang;
|
||||||
|
int start = 0;
|
||||||
|
int end = file.indexOf('_');
|
||||||
|
|
||||||
|
if (end > start)
|
||||||
|
project = file.mid(start, end - start);
|
||||||
|
|
||||||
|
start = file.indexOf('_') + 1;
|
||||||
|
end = file.lastIndexOf('.');
|
||||||
|
if (start > 0 && end > start)
|
||||||
|
lang = file.mid(start, end - start);
|
||||||
|
|
||||||
|
if(!lang.isEmpty() && !project.isEmpty()){
|
||||||
|
if(_autoLoadLanguage || (!_autoLoadLanguage && project == "RibbonUI")){
|
||||||
|
_translator->registerLanguage(lang, ":/i18n/" + file, project);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RibbonUI::setAutoLoadLanguage(bool value){
|
||||||
|
_autoLoadLanguage = value;
|
||||||
|
initTranslator();
|
||||||
|
}
|
Loading…
Reference in New Issue