From 11e13015eec5f960151c5d6291dadd24c71a5cd9 Mon Sep 17 00:00:00 2001 From: re2zero Date: Fri, 19 Dec 2025 17:05:53 +0800 Subject: [PATCH] build: refactor translation and improve Qt Linguist tools integration - Add new FindQtLinguistTools.cmake module to properly locate lupdate/lrelease - Move translation files from src root to src/translations directory - Update CMakeLists.txt to use recursive search for .ts files in translations/ - Refactor custom target commands to support multiple languages dynamically - Remove hardcoded translation file paths and replace with dynamic globbing - Fix Qt6 compatibility issues in translation file paths - Improve build system robustness for internationalization Log: refactor translation --- CMakeLists.txt | 1 + cmake/FindQtLinguistTools.cmake | 45 + example/CMakeLists.txt | 51 +- example/{ => translations}/example_en_US.ts | 1316 +++++++++---------- example/{ => translations}/example_zh_CN.ts | 1316 +++++++++---------- src/.cmake/QmlPlugin.cmake | 145 +- src/CMakeLists.txt | 48 +- src/fluentui_en_US.ts | 377 ------ src/fluentui_zh_CN.ts | 377 ------ src/translations/fluentui_en_US.ts | 377 ++++++ src/translations/fluentui_zh_CN.ts | 377 ++++++ 11 files changed, 2263 insertions(+), 2167 deletions(-) create mode 100644 cmake/FindQtLinguistTools.cmake rename example/{ => translations}/example_en_US.ts (64%) rename example/{ => translations}/example_zh_CN.ts (69%) delete mode 100644 src/fluentui_en_US.ts delete mode 100644 src/fluentui_zh_CN.ts create mode 100644 src/translations/fluentui_en_US.ts create mode 100644 src/translations/fluentui_zh_CN.ts diff --git a/CMakeLists.txt b/CMakeLists.txt index b75736fb..f1acfca7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ option(FLUENTUI_BUILD_STATIC_LIB "Build static library." OFF) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core) +message("-- >>> Found Qt version: ${QT_VERSION_MAJOR} (${QT_VERSION})") add_subdirectory(src) diff --git a/cmake/FindQtLinguistTools.cmake b/cmake/FindQtLinguistTools.cmake new file mode 100644 index 00000000..ff345921 --- /dev/null +++ b/cmake/FindQtLinguistTools.cmake @@ -0,0 +1,45 @@ +# FindQtLinguistTools.cmake - 查找Qt Linguist工具 (lupdate, lrelease) + +if (NOT QT_LRELEASE OR NOT QT_LUPDATE) + find_package(Qt${QT_VERSION_MAJOR}LinguistTools QUIET) + + if (NOT Qt${QT_VERSION_MAJOR}_LRELEASE_EXECUTABLE) + if (UNIX) + find_program(QT_LUPDATE NAMES lupdate PATHS + "/lib/qt${QT_VERSION_MAJOR}/bin" NO_DEFAULT_PATH) + find_program(QT_LRELEASE NAMES lrelease PATHS + "/lib/qt${QT_VERSION_MAJOR}/bin" NO_DEFAULT_PATH) + endif() + if (NOT QT_LUPDATE) + find_program(QT_LUPDATE NAMES lupdate lupdate-qt${QT_VERSION_MAJOR}) + message(STATUS "Found lupdate in sys path = ${QT_LUPDATE}") + endif() + if (NOT QT_LRELEASE) + find_program(QT_LRELEASE NAMES lrelease lrelease-qt${QT_VERSION_MAJOR}) + message(STATUS "Found lrelease in sys path = ${QT_LRELEASE}") + endif() + else() + if(WIN32 AND QT_VERSION_MAJOR LESS "6") + # Qt5在windows Qt5::lupdate 存在无效 + find_program(QT_LUPDATE NAMES lupdate lupdate-qt${QT_VERSION_MAJOR}) + find_program(QT_LRELEASE NAMES lrelease lrelease-qt${QT_VERSION_MAJOR}) + else() + set(QT_LUPDATE "${Qt${QT_VERSION_MAJOR}_LUPDATE_EXECUTABLE}") + set(QT_LRELEASE "${Qt${QT_VERSION_MAJOR}_LRELEASE_EXECUTABLE}") + endif() + endif() + + message("Find and set QT_LRELEASE = ${QT_LRELEASE}") +else() + # 如果找到, 直接使用 + message("Use found QT_LUPDATE = ${QT_LUPDATE}, QT_LRELEASE = ${QT_LRELEASE}") +endif() + +# 检查是否找到必要的工具 +if(NOT QT_LUPDATE) + message(WARNING "Could not find lupdate tool") +endif() + +if(NOT QT_LRELEASE) + message(WARNING "Could not find lrelease tool") +endif() \ No newline at end of file diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 9d4218ec..3ebed7b5 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -27,18 +27,47 @@ endif () find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick Svg Network Widgets) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network Widgets) -#添加国际化脚本 -find_program(QT_LUPDATE NAMES lupdate lupdate-qt6) -find_program(QT_LRELEASE NAMES lrelease lrelease-qt6) -file(GLOB TS_FILE_PATHS ${CMAKE_CURRENT_LIST_DIR}/ *.ts) +# 查找Qt Linguist工具 +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQtLinguistTools.cmake) + +# 获取 translations 目录下的所有 .ts 文件 +file(GLOB_RECURSE TS_FILES "${CMAKE_CURRENT_LIST_DIR}/translations/*.ts") + +# 构建命令列表 +set(UPDATE_TRANSLATION_COMMANDS) +set(LRELEASE_COMMANDS) +set(QM_FILES) + +foreach(TSFIL ${TS_FILES}) + get_filename_component(FIL_WE ${TSFIL} NAME_WE) + set(QMFIL ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.qm) + + # 添加 lupdate 命令 + list(APPEND UPDATE_TRANSLATION_COMMANDS COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${TSFIL} WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) + + # 添加 lrelease 命令 + list(APPEND LRELEASE_COMMANDS COMMAND ${QT_LRELEASE} ${TSFIL} -qm ${QMFIL}) + + # 记录生成的 qm 文件 + list(APPEND QM_FILES ${QMFIL}) +endforeach() + +# 构建复制命令 +set(COPY_COMMANDS COMMAND ${CMAKE_COMMAND} -E make_directory ${APPLICATION_DIR_PATH}/i18n) + +if(QM_FILES) + list(APPEND COPY_COMMANDS COMMAND ${CMAKE_COMMAND} -E copy) + foreach(QMFIL ${QM_FILES}) + list(APPEND COPY_COMMANDS ${QMFIL}) + endforeach() + list(APPEND COPY_COMMANDS ${APPLICATION_DIR_PATH}/i18n) +endif() + add_custom_target(Script-UpdateTranslations - COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${PROJECT_NAME}_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${PROJECT_NAME}_zh_CN.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - COMMAND ${QT_LRELEASE} ${PROJECT_NAME}_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - COMMAND ${QT_LRELEASE} ${PROJECT_NAME}_zh_CN.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - COMMAND ${CMAKE_COMMAND} -E make_directory ${APPLICATION_DIR_PATH}/i18n - COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_NAME}_en_US.qm ${PROJECT_NAME}_zh_CN.qm ${APPLICATION_DIR_PATH}/i18n - SOURCES ${TS_FILE_PATHS} + ${UPDATE_TRANSLATION_COMMANDS} + ${LRELEASE_COMMANDS} + ${COPY_COMMANDS} + DEPENDS ${TS_FILES} ) ##生成版本信息头文件 diff --git a/example/example_en_US.ts b/example/translations/example_en_US.ts similarity index 64% rename from example/example_en_US.ts rename to example/translations/example_en_US.ts index 91d6afb5..3a3d4a10 100644 --- a/example/example_en_US.ts +++ b/example/translations/example_en_US.ts @@ -4,47 +4,47 @@ App - + Quit - + Test1 - + Test2 - + Test3 - + Test4 - + Test5 - + Test6 - + Test7 - + Test8 @@ -52,12 +52,12 @@ CodeExpander - + Source - + The Copy is Successful @@ -65,22 +65,22 @@ CrashWindow - + Friendly Reminder - + We apologize for the inconvenience caused by an unexpected error - + Report Logs - + Restart Program @@ -88,33 +88,33 @@ FluentInitializrWindow - - + + FluentUI Initializr - + Name - + Create In - + Browse - + Cancel - + Create @@ -122,7 +122,7 @@ HotkeyWindow - + Hotkey @@ -130,12 +130,12 @@ HotloadWindow - + Hot Loader - + Drag in a qml file @@ -143,22 +143,22 @@ InitializrHelper - + The name cannot be empty - + The creation path cannot be empty - + The path does not exist - + %1 folder already exists @@ -166,17 +166,17 @@ ItemsFooter - + About - + Settings - + FluentUI Pro @@ -184,428 +184,428 @@ ItemsOriginal - + Home - + PaneItemExpander Disabled - + Basic Input - + Buttons - + A control that responds to user input and raisesa Click event. - + Text - + Image - + Slider - + A control that lets the user select from a rangeof values by moving a Thumb control along atrack. - + CheckBox - + A control that a user can select or clear. - + RadioButton - + ToggleSwitch - + PaneItem Disabled - + GroupBox - + Form - + TextBox - + TimePicker - + DatePicker - + CalendarPicker - + ColorPicker - + ShortcutPicker - + Surface - + InfoBar - + An inline message to display app-wide statuschange information. - + Progress - + RatingControl - + Badge - + Rectangle - + Clip - + Carousel - + Expander - + Watermark - + BubbleBox - + Layout - + StaggeredLayout - + SplitLayout - + StatusLayout - + Popus - + Dialog - + ComboBox - + Tooltip - + Menu - + Sheet - + Navigation - + Pivot - + Presents information from different sources in a tabbed view. - + BreadcrumbBar - + TabView - + A control that displays a collection of tabs thatcan be used to display several documents. - + TreeView - + TableView TreeView2 - + The TableView control provides a flexible way to display a collection of data in rows and columns - + Pagination - + MultiWindow - + FlipView - + Presents a collection of items that the user canflip through, one item at a time. - + ParallaxView - + Theming - + Acrylic - + Theme - + Typography - + Icons - + Chart - + Bar Chart - + Line Chart - + Pie Chart - + Polar Area Chart - + Bubble Chart - + Scatter Chart - + Radar Chart - + Other - + OpenGL - + QCustomPlot - + QCustomPlot2 - + QRCode - + Tour - + Timeline - + Pinyin - + CountTimer - + Captcha - + Network - + Remote Loader - + Hot Loader - + Test Crash @@ -613,23 +613,23 @@ LoginWindow - - + + Login - + Please enter the account - + Please enter your password - + Please feel free to enter a password @@ -637,104 +637,104 @@ MainWindow - - + + Quit - + Are you sure you want to exit the program? - + Minimize - + Friendly Reminder - + FluentUI is hidden from the tray, click on the tray to activate the window again - - + + Cancel - + Open in Separate Window - + Click Time - + Search - + Finish - + Next - + Previous - + Dark Mode - + Here you can switch to night mode. - + Hide Easter eggs - + Try a few more clicks!! - + Upgrade Tips - + FluentUI is currently up to date - + -- The current app version - + Now go and download the new version? @@ -743,17 +743,17 @@ Updated content: - + OK - + The current version is already the latest - + The network is abnormal @@ -761,12 +761,12 @@ Updated content: SingleInstanceWindow - + SingleInstance - + I'm a SingleInstance window, and if I exist, I'll destroy the previous window and create a new one @@ -774,12 +774,12 @@ Updated content: SingleTaskWindow - + SingleTask - + I'm a SingleTask mode window, and if I exist, I activate the window @@ -787,67 +787,67 @@ Updated content: StandardWindow - + File - + New... - + Open... - + Save - + Save As... - + Quit - + Edit - + Cut - + Copy - + Paste - + Help - + About - + I'm a Standard mode window, and every time I create a new window @@ -855,23 +855,23 @@ Updated content: T_Acrylic - - + + Acrylic - + tintColor: - + tintOpacity: - + blurRadius: @@ -879,12 +879,12 @@ Updated content: T_Badge - + Badge - + It usually appears in the upper right corner of the notification icon or avatar to display the number of messages that need to be processed @@ -892,7 +892,7 @@ Updated content: T_BarChart - + Bar Chart @@ -900,23 +900,23 @@ Updated content: T_BreadcrumbBar - + BreadcurmbBar - + Item_%1 Item_'%1' - + Reset sample - + Item_ @@ -924,48 +924,48 @@ Updated content: T_BubbleBox - - + + BubbleBox - + bubblebox offset: - + traingle offset: - + direction: - + top - + right - + bottom - + left - + Standard Button @@ -973,7 +973,7 @@ Updated content: T_BubbleChart - + Bubble Chart @@ -981,160 +981,160 @@ Updated content: T_Buttons - + Buttons - + Support the Tab key to switch focus, and the Space key to perform click events - + Text Button - - - - - - - - + + + + + + + + Disabled - + Standard Button - + Click StandardButton - + Filled Button - + Click FilledButton - + Toggle Button - + Progress Button - + Loading Button - - + + Loading - + Normal - + Click IconButton - + IconOnly - + Button.IconOnly - + TextOnly - + Button.TextOnly - + TextBesideIcon - + Button.TextBesideIcon - + TextUnderIcon - + Button.TextUnderIcon - + DropDownButton - + Menu_1 - + Menu_2 - + Menu_3 - + Menu_4 - + Radio Button_1 - + Radio Button_2 - + Radio Button_3 @@ -1142,7 +1142,7 @@ Updated content: T_CalendarPicker - + CalendarPicker @@ -1150,37 +1150,37 @@ Updated content: T_Captcha - + Captcha - + Refresh - + Ignore Case - + Please enter a verification code - + verify - + The verification code is correct - + Error validation, please re-enter @@ -1188,57 +1188,57 @@ Updated content: T_Carousel - + Carousel - + Carousel map, support infinite carousel, infinite swipe, and components implemented with ListView - + Play orientation: - + Horizontal - + Vertical - + Indicator position: - + top - + right - + bottom - + left - + Auto play @@ -1246,53 +1246,53 @@ Updated content: T_CheckBox - + CheckBox - + A 2-state CheckBox - + Right - + Left - - + + Disabled - + A 3-state CheckBox - + Three State - + Using a 3-state CheckBox - + Select all - + Option %1 @@ -1300,12 +1300,12 @@ Updated content: T_Clip - + Clip - + Use with images (this component will have no effect under software rendering) @@ -1313,12 +1313,12 @@ Updated content: T_ColorPicker - + ColorPicker - + Click to Select a Color - > @@ -1326,51 +1326,51 @@ Updated content: T_ComboBox - + ComboBox - + editable=false - - - - + + + + Banana - - - - + + + + Apple - - - - + + + + Coconut - + disabled=true - + editable=true - + FluComboBox{ editable: true model: ListModel { @@ -1390,22 +1390,22 @@ Updated content: T_CountTimer - + CountTimer - + Countdown milliseconds: %1 - + Countdown seconds: %1 - + Countup seconds: %1 @@ -1413,7 +1413,7 @@ Updated content: T_CustomPlot - + QCustomPlot @@ -1421,7 +1421,7 @@ Updated content: T_CustomPlot2 - + QCustomPlot2 @@ -1429,18 +1429,18 @@ Updated content: T_DatePicker - + DatePicker TimePicker - + showYear=true - + showYear=false @@ -1448,98 +1448,98 @@ Updated content: T_Dialog - + Dialog - + Show Double Button Dialog - - - + + + Friendly Reminder - - + + Are you sure you want to opt out? - - + + Cancel - - - + + + Click the Cancel Button - - - - + + + + OK - - - + + + Click the OK Button - + Show Triple Button Dialog - + Minimize - + Click Minimize - + Custom Content Dialog - + Custom Content Dialog2 - + Data is loading, please wait... - + Unload - + Test the InfoBar level on top of the Popup - + Line Chart @@ -1547,22 +1547,22 @@ Updated content: T_Expander - + Expander - + Open a radio box - + Open a sliding text box - + Permit me to observe: the late emperor was taken from us before he could finish his life`s work, the restoration of Han. Today, the empire is still divided in three, and our very survival is threatened. Yet still the officials at court and the soldiers throughout the realm remain loyal to you, your majesty. Because they remember the late emperor, all of them, and they wish to repay his kindness in service to you. This is the moment to extend your divine influence, to honour the memory of the late Emperor and strengthen the morale of your officers. It is not time to listen to bad advice, or close your ears to the suggestions of loyal men. The court and the administration are as one. Both must be judged by one standard. Those who are loyal and good must get what they deserve, but so must the evil-doers who break the law. This will demonstrate the justice of your rule. There cannot be one law for the court and another for the administration. Counselors and attendants like Guo Youzhi, Fei Yi, and Dong Yun are all reliable men, loyal of purpose and pure in motive. The late Emperor selected them for office so that they would serve you after his death.These are the men who should be consulted on all palace affairs. Xiang Chong has proved himself a fine general in battle, and the late Emperor believed in him. That is why the assembly has recommended him for overall command. It will keep the troops happy if he is consulted on all military matters. @@ -1574,22 +1574,22 @@ My only desire is to be permitted to drive out the traitors and restore the Han. - + Check for Updates - + This is a ToggleButton in the header - + This is a StandardButton in the content - + Click StandardButton @@ -1597,17 +1597,17 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_FlipView - + FlipView - + Horizontal FlipView - + Vertical FlipView @@ -1615,41 +1615,41 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_GroupBox - + GroupBox - + CheckBox Group - - + + E-mail - - + + Calendar - - + + Contacts - + RadioButton Group RadioButton Group111111111111111111111111 - + Disabled @@ -1657,32 +1657,32 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Home - + FluentUI GitHub - + The latest FluentUI controls and styles for your applications. - + FluentUI Pro - + The latest FluentUI Pro controls and styles for your applications. - + FluentUI Initializr - + FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options. @@ -1690,22 +1690,22 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Icons - + Icons - + Please enter a keyword - + Disabled - + You Copied @@ -1713,12 +1713,12 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Image - + Image - + The image failed to load, please reload @@ -1726,112 +1726,112 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_InfoBar - + InfoBar - + Info - - + + This is an InfoBar in the Info Style - + Warning - + This is an InfoBar in the Warning Style - + Error - + This is an InfoBar in the Error Style - + Success - + This is an InfoBar in the Success Style - + InfoBar that needs to be turned off manually - + Manual shutdown is supported - + Manually close the info message box - - - + + + close '%1' - - - + + + show '%1' - - - + + + This is an '%1' - - + + info1 - - + + info2 - - + + info3 - + clear all info - + Loading @@ -1839,7 +1839,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_LineChart - + Line Chart @@ -1847,114 +1847,114 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Menu - - + + Menu - - + + File - - + + New... - - + + Open... - - + + Save - - + + Quit - - + + Search - - - + + + Disable - + Check - - + + Save As... - - + + Doc - - + + PDF - + Show Menu Popup - + MenuBar - + Edit - + Cut - + Copy - + Paste - + Help - + About @@ -1962,46 +1962,46 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_MultiWindow - + MultiWindow - + <font color='red'>Standard</font> mode window,a new window is created every time - - - - - + + + + + Create Window - + <font color='red'>SingleTask</font> mode window,If a window exists, this activates the window - + <font color='red'>SingleInstance</font> mode window,If the window exists, destroy the window and create a new window - + Create the window without carrying any parameters - + Create a window with the parameter username: zhuzichu - + Login Window Returned Password - > @@ -2009,7 +2009,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Network - + Network @@ -2017,7 +2017,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_OpenGL - + OpenGL @@ -2025,7 +2025,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Pagination - + Pagination @@ -2033,32 +2033,32 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_ParallaxView - + ParallaxView - + Background size mode: - + Auto - + Cover - + Fixed - + Speed: @@ -2066,7 +2066,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_PieChart - + Pie Chart @@ -2074,28 +2074,28 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Pinyin - + Pinyin - + [pinyin-pro document](https://pinyin-pro.cn/guide/compare.html) - - + + Input Chinese or Pinyin - + Matching time: %1 - + Matching with cache @@ -2103,47 +2103,47 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Pivot - + Pivot - + All - + All emails go here. - + Unread - + Unread emails go here. - + Flagged - + Flagged emails go here. - + Urgent - + Urgent emails go here. @@ -2151,7 +2151,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_PolarAreaChart - + Polar Area Chart @@ -2159,7 +2159,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Progress - + Progress @@ -2167,32 +2167,32 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_QRCode - + QRCode - + text: - + color: - + bgColor: - + margins: - + size: @@ -2200,7 +2200,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_RadarChart - + Radar Chart @@ -2208,42 +2208,42 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_RadioButton - + RadioButton - + Right - + Left - - - + + + Disabled - - + + Radio Button_1 - - + + Radio Button_2 - - + + Radio Button_3 @@ -2251,7 +2251,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_RatingControl - + RatingControl @@ -2259,7 +2259,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Rectangle - + Rectangle @@ -2267,7 +2267,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_ScatterChart - + Scatter Chart @@ -2275,97 +2275,97 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Settings - + Settings - + Current Version - + Check for Updates - + Use System AppBar - + Fits AppBar Windows - + Friendly Reminder - + This action requires a restart of the program to take effect, is it restarted? - + Cancel - + OK - + Dark Mode - + System - + Light - + Dark - + Navigation View Display Mode - + Open - + Compact - + Minimal - + Auto - + Language @@ -2373,39 +2373,39 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Sheet - + Sheet - + Title - + Some contents... Some contents... Some contents... - + top - + right - + bottom - + left @@ -2413,7 +2413,7 @@ Some contents... T_ShortcutPicker - + ShortcutPicker @@ -2421,7 +2421,7 @@ Some contents... T_Slider - + Slider @@ -2429,38 +2429,38 @@ Some contents... T_SplitLayout - + SplitLayout - + orientation: - - + + Horizontal - + Vertical - + Page 1 - + Page 2 - + Page 3 @@ -2468,7 +2468,7 @@ Some contents... T_StaggeredLayout - + StaggeredLayout @@ -2476,28 +2476,28 @@ Some contents... T_StatusLayout - + StatusLayout - - + + Loading - + Empty - + Error - + Success @@ -2505,54 +2505,54 @@ Some contents... T_TabView - + TabView - + Document - + Tab Width Behavior: - - + + Equal - + SizeToContent - + Compact - + Tab Close Button Visibility: - - + + Always - + Never - + OnHover @@ -2560,113 +2560,113 @@ Some contents... T_TableView - + TableView - + Modify the column name - + Cancel - + OK - + Search - - + + Name - + Delete - + Edit - + Select All - + Age - + Clear All - + Delete Selection - + Add a row of Data - + Insert a Row - + Focus not acquired: Please click any item in the form as the target for insertion! - + Avatar - + Address - + Nickname - + Long String - + Options - + <Previous - + Next> @@ -2674,17 +2674,17 @@ Some contents... T_Text - + Text - + This is a text that can be copied - + Disabled @@ -2692,41 +2692,41 @@ Some contents... T_TextBox - + TextBox - + Single-line Input Box - - - - - + + + + + Disabled - + Please enter your password - + Multi-line Input Box - + AutoSuggestBox - + Show suggest when pressed @@ -2734,37 +2734,37 @@ Some contents... T_Theme - + Theme - + Theme colors - + Customize the Theme Color - + Dark Mode - + Native Text - + Open Animation - + Open Blur Window Rounded Window @@ -2775,23 +2775,23 @@ Some contents... - - + + dwm-blur - + window tintOpacity - + window blurRadius - + window effect @@ -2799,53 +2799,53 @@ Some contents... T_TimePicker - + TimePicker - + hourFormat=FluTimePickerType.H - - + + AM - - + + PM - - + + Hour - - + + Minute - - + + Cancel - - + + OK - + hourFormat=FluTimePickerType.HH @@ -2853,38 +2853,38 @@ Some contents... T_Timeline - + Timeline - + Append - + clear - + mode: - + Left - + Right - - + + Alternate @@ -2892,22 +2892,22 @@ Some contents... T_ToggleSwitch - + ToggleSwitch - + Right - + Left - + Disabled @@ -2915,38 +2915,38 @@ Some contents... T_Tooltip - + Tooltip - + Hover over Tultip and it pops up - + Text properties of FluIconButton support the Tooltip pop-up window by default - - + + Delete - + Click IconButton - + Add a Tooltip pop-up to a Button - + Click Button @@ -2954,66 +2954,66 @@ Some contents... T_Tour - - + + Upload File - - + + Put your files here. - - - - + + + + Save - - + + Save your changes. - - + + Other Actions - - + + Click to see other actions. - + Begin Tour - + Begin Tour with custom indicator - - + + Upload - + More - + Tour @@ -3021,62 +3021,62 @@ Some contents... T_TreeView - + TreeView - + cellHeight: - + depthPadding: - + showLine - + checkable - + all expand - + all collapse - + print selection model - + Title - + Name - + Avatar - + Address @@ -3084,42 +3084,42 @@ Some contents... T_Typography - + Typography - + Display - + Title Large - + Title - + Subtitle - + Body Strong - + Body - + Caption @@ -3127,47 +3127,47 @@ Some contents... T_Watermark - + Watermark - + text: - + textSize: - + gapX: - + gapY: - + offsetX: - + offsetY: - + rotate: - + textColor: diff --git a/example/example_zh_CN.ts b/example/translations/example_zh_CN.ts similarity index 69% rename from example/example_zh_CN.ts rename to example/translations/example_zh_CN.ts index 63eff10f..8ad4aa7a 100644 --- a/example/example_zh_CN.ts +++ b/example/translations/example_zh_CN.ts @@ -4,47 +4,47 @@ App - + Quit 退出 - + Test1 测试1 - + Test2 测试2 - + Test3 测试3 - + Test4 测试4 - + Test5 测试5 - + Test6 测试6 - + Test7 测试7 - + Test8 测试8 @@ -52,12 +52,12 @@ CodeExpander - + Source 源码 - + The Copy is Successful 复制成功 @@ -65,22 +65,22 @@ CrashWindow - + Friendly Reminder 友情提示 - + We apologize for the inconvenience caused by an unexpected error 对于意外错误给您带来的不便,我们深表歉意 - + Report Logs 上报日志 - + Restart Program 重启程序 @@ -88,33 +88,33 @@ FluentInitializrWindow - - + + FluentUI Initializr FluentUI脚手架 - + Name 名称 - + Create In 创建路径 - + Browse 浏览 - + Cancel 取消 - + Create 创建 @@ -122,7 +122,7 @@ HotkeyWindow - + Hotkey 热键 @@ -130,12 +130,12 @@ HotloadWindow - + Hot Loader 热加载 - + Drag in a qml file 拖入qml文件 @@ -143,22 +143,22 @@ InitializrHelper - + The name cannot be empty 名称不能为空 - + The creation path cannot be empty 创建路径不能为空 - + The path does not exist 路径不存在 - + %1 folder already exists %1 文件夹已经存在 @@ -166,17 +166,17 @@ ItemsFooter - + About 关于 - + Settings 设置 - + FluentUI Pro @@ -184,423 +184,423 @@ ItemsOriginal - + Home 首页 - + PaneItemExpander Disabled PaneItemExpander 已禁用 - + Basic Input 基本输入 - + Buttons 按钮 - + A control that responds to user input and raisesa Click event. 响应用户输入并引发 Click 事件的控件。 - + Text 文本 - + Image 图像 - + Slider 滑块 - + A control that lets the user select from a rangeof values by moving a Thumb control along atrack. 一个控件,允许用户通过沿轨道移动 Thumb 控件从一系列值中进行选择。 - + CheckBox 复选框 - + A control that a user can select or clear. 用户可以选择或清除的控件。 - + RadioButton 单选按钮 - + ToggleSwitch 切换开关 - + PaneItem Disabled PaneItem 已禁用 - + GroupBox 分组容器 - + Form 表单 - + TextBox 文本框 - + TimePicker 时间选择器 - + DatePicker 日期选择器 - + CalendarPicker 日历选择器 - + ColorPicker 颜色选择器 - + ShortcutPicker 快捷键选择器 - + Surface 表面 - + InfoBar 信息栏 - + An inline message to display app-wide statuschange information. 用于显示应用范围状态更改信息的内联消息。 - + Progress 进度条 - + RatingControl 评级控制 - + Badge 徽章 - + Rectangle 矩形 - + Clip 裁剪 - + Carousel 轮播图 - + Expander 展开 - + Watermark 水印 - + BubbleBox 气泡框 - + Layout 布局 - + StaggeredLayout 瀑布流布局 - + SplitLayout 拆分布局 - + StatusLayout 状态布局 - + Popus 弹窗 - + Dialog 弹窗 - + ComboBox 组合框 - + Tooltip 工具提示 - + Menu 菜单 - + Sheet 抽屉 - + Navigation 导航 - + Pivot 轴转 - + Presents information from different sources in a tabbed view. 在选项卡式视图中显示来自不同源的信息。 - + BreadcrumbBar 面包屑 - + TabView 选项卡 - + A control that displays a collection of tabs thatcan be used to display several documents. 一个控件,用于显示可用于显示多个文档的选项卡集合。 - + TreeView - + TableView TreeView2 表格 - + The TableView control provides a flexible way to display a collection of data in rows and columns TableView 控件提供了一种以行和列形式显示数据集合的灵活方法 - + Pagination 分页 - + MultiWindow 多窗口 - + FlipView 翻转视图 - + Presents a collection of items that the user canflip through, one item at a time. 显示用户可以翻阅的项集合,一次翻阅一个项。 - + ParallaxView 视差视图 - + Theming 主题 - + Acrylic 亚克力 - + Theme 主题 - + Typography 字体 - + Icons 图标 - + Chart 图表 - + Bar Chart 条形图 - + Line Chart 线型图 - + Pie Chart 饼图 - + Polar Area Chart 极坐标区域图 - + Bubble Chart 气泡图 - + Scatter Chart 散点图 - + Radar Chart 雷达图 - + Other 其他 - + OpenGL - + QCustomPlot - + QCustomPlot2 - + QRCode 二维码 - + Tour 漫游式引导 - + Timeline 时间轴 - + Pinyin 拼音 - + CountTimer 计时器 - + Captcha 验证码 - + Network 网络 - + Remote Loader 远程加载 - + Hot Loader 热加载 @@ -609,7 +609,7 @@ 3D - + Test Crash 测试崩溃 @@ -617,23 +617,23 @@ LoginWindow - - + + Login 登录 - + Please enter the account 请输入账号 - + Please enter your password 请输入密码 - + Please feel free to enter a password 请随意输入一个密码 @@ -641,104 +641,104 @@ MainWindow - + Dark Mode 夜间模式 - - + + Quit 退出 - + Are you sure you want to exit the program? 您确定要退出程序吗 - + Minimize 最小化 - + Friendly Reminder 友情提示 - + FluentUI is hidden from the tray, click on the tray to activate the window again FluentUI 在托盘中处于隐藏状态,单击托盘以再次激活窗口 - - + + Cancel 取消 - + Open in Separate Window 在独立窗口中打开 - + Click Time 点击次数 - + Search 搜索 - + Finish 完成 - + Next 下一步 - + Previous 上一步 - + Here you can switch to night mode. 在这里,您可以切换到夜间模式。 - + Hide Easter eggs 隐藏彩蛋 - + Try a few more clicks!! 再试几下!! - + Upgrade Tips 升级提示 - + FluentUI is currently up to date FluentUI 目前最新版本 - + -- The current app version -- 当前应用版本 - + Now go and download the new version? @@ -751,17 +751,17 @@ Updated content: - + OK 确定 - + The current version is already the latest 当前版本已经是最新版本 - + The network is abnormal 网络异常 @@ -769,12 +769,12 @@ Updated content: SingleInstanceWindow - + SingleInstance - + I'm a SingleInstance window, and if I exist, I'll destroy the previous window and create a new one 我是一个SingleInstance模式的窗口,如果我存在,我会销毁之前的窗口,并创建一个新窗口 @@ -782,12 +782,12 @@ Updated content: SingleTaskWindow - + SingleTask - + I'm a SingleTask mode window, and if I exist, I activate the window 我是一个SingleTask模式的窗口,如果我存在,我就激活窗口 @@ -795,67 +795,67 @@ Updated content: StandardWindow - + File 文件 - + New... 新建... - + Open... 打开... - + Save 保存 - + Save As... 另存为... - + Quit 退出 - + Edit 编辑 - + Cut 剪切 - + Copy 复制 - + Paste 粘贴 - + Help 帮助 - + About 关于 - + I'm a Standard mode window, and every time I create a new window 我是一个Standard模式的窗口,每次我都会创建一个新的窗口 @@ -863,23 +863,23 @@ Updated content: T_Acrylic - - + + Acrylic 亚克力 - + tintColor: 前景色: - + tintOpacity: 透明度: - + blurRadius: 模糊半径: @@ -906,12 +906,12 @@ Updated content: T_Badge - + Badge 徽章 - + It usually appears in the upper right corner of the notification icon or avatar to display the number of messages that need to be processed 一般出现在通知图标或头像的右上角,用于显示需要处理的消息条数 @@ -919,7 +919,7 @@ Updated content: T_BarChart - + Bar Chart 条形图 @@ -927,22 +927,22 @@ Updated content: T_BreadcrumbBar - + BreadcurmbBar 面包屑 - + Item_%1 项目_%1 - + Reset sample 重置 - + Item_ @@ -950,48 +950,48 @@ Updated content: T_BubbleBox - - + + BubbleBox 气泡框 - + bubblebox offset: 气泡框偏移: - + traingle offset: 三角形偏移: - + direction: 方向: - + top - + right - + bottom - + left - + Standard Button 标准按钮 @@ -999,7 +999,7 @@ Updated content: T_BubbleChart - + Bubble Chart 气泡图 @@ -1007,160 +1007,160 @@ Updated content: T_Buttons - + Buttons 按钮 - + Support the Tab key to switch focus, and the Space key to perform click events 支持Tab键切换焦点,空格键执行点击事件 - + Text Button 文本按钮 - - - - - - - - + + + + + + + + Disabled 禁用 - + Standard Button 标准按钮 - + Click StandardButton 点击标准按钮 - + Filled Button 填充按钮 - + Click FilledButton 点击填充按钮 - + Toggle Button 开关按钮 - + Progress Button 进度按钮 - + Loading Button 加载按钮 - - + + Loading 正在加载 - + Normal 开启加载 - + Click IconButton 点击图标按钮 - + IconOnly 仅图标 - + Button.IconOnly - + TextOnly 仅文字 - + Button.TextOnly - + TextBesideIcon 文字加图标 - + Button.TextBesideIcon - + TextUnderIcon 文字位于图标下方 - + Button.TextUnderIcon - + DropDownButton 下拉按钮 - + Menu_1 菜单_1 - + Menu_2 菜单_2 - + Menu_3 菜单_3 - + Menu_4 菜单_4 - + Radio Button_1 单选按钮_1 - + Radio Button_2 单选按钮_1 - + Radio Button_3 单选按钮_3 @@ -1168,7 +1168,7 @@ Updated content: T_CalendarPicker - + CalendarPicker 日历选择器 @@ -1176,37 +1176,37 @@ Updated content: T_Captcha - + Captcha 验证码 - + Refresh 刷新 - + Ignore Case 忽略大小写 - + Please enter a verification code 请输入验证码 - + verify 验证 - + The verification code is correct 验证成功 - + Error validation, please re-enter 错误验证,请重新输入 @@ -1214,57 +1214,57 @@ Updated content: T_Carousel - + Carousel 轮播图 - + Carousel map, support infinite carousel, infinite swipe, and components implemented with ListView 轮播图,支持无限轮播,无限滑动,用ListView实现的组件 - + Play orientation: 轮播方向: - + Horizontal 水平 - + Vertical 垂直 - + Indicator position: 指示器位置: - + top - + right - + bottom - + left - + Auto play 自动轮播 @@ -1272,53 +1272,53 @@ Updated content: T_CheckBox - + CheckBox 复选框 - + A 2-state CheckBox 两状态复选框 - + Right - + Left - - + + Disabled 禁用 - + A 3-state CheckBox 三状态复选框 - + Three State 三状态 - + Using a 3-state CheckBox 使用三状态复选框 - + Select all 选中全部 - + Option %1 选项 %1 @@ -1326,12 +1326,12 @@ Updated content: T_Clip - + Clip 裁剪 - + Use with images (this component will have no effect under software rendering) 配合图片使用(software渲染下该组件将没有效果) @@ -1339,12 +1339,12 @@ Updated content: T_ColorPicker - + ColorPicker 颜色选择器 - + Click to Select a Color - > 点击选中颜色 - > @@ -1384,51 +1384,51 @@ Updated content: T_ComboBox - + ComboBox 组合框 - + editable=false 可编辑=false - - - - + + + + Banana 香蕉 - - - - + + + + Apple 苹果 - - - - + + + + Coconut 椰子 - + disabled=true 不使能=true - + editable=true 可编辑=true - + FluComboBox{ editable: true model: ListModel { @@ -1460,22 +1460,22 @@ Updated content: T_CountTimer - + CountTimer 计时器 - + Countdown milliseconds: %1 毫秒倒计时:%1 - + Countdown seconds: %1 秒倒计时:%1 - + Countup seconds: %1 秒正计时:%1 @@ -1515,7 +1515,7 @@ Updated content: 登录窗口返回过来的密码 - > - + QCustomPlot @@ -1523,7 +1523,7 @@ Updated content: T_CustomPlot2 - + QCustomPlot2 @@ -1531,12 +1531,12 @@ Updated content: T_DatePicker - + DatePicker 日期选择器 - + showYear=true @@ -1561,7 +1561,7 @@ Updated content: 确定 - + showYear=false @@ -1569,98 +1569,98 @@ Updated content: T_Dialog - + Dialog 弹窗 - + Show Double Button Dialog 显示双按钮对话框 - - - + + + Friendly Reminder 友情提示 - - + + Are you sure you want to opt out? 您确定要退出吗? - - + + Cancel 取消 - - - + + + Click the Cancel Button 单击取消按钮 - - - - + + + + OK 确定 - - - + + + Click the OK Button 单击确定按钮 - + Show Triple Button Dialog 显示三个按钮对话框 - + Minimize 最小化 - + Click Minimize 单击最小化 - + Custom Content Dialog 自定义对话框内容 - + Custom Content Dialog2 自定义对话框内容2 - + Data is loading, please wait... 正在加载,请稍等... - + Unload 取消加载 - + Test the InfoBar level on top of the Popup 测试InfoBar层级在Popup之上 - + Line Chart 线型图 @@ -1668,22 +1668,22 @@ Updated content: T_Expander - + Expander 展开 - + Open a radio box 打开一个单选框 - + Open a sliding text box 打开一个滑动文本框 - + Permit me to observe: the late emperor was taken from us before he could finish his life`s work, the restoration of Han. Today, the empire is still divided in three, and our very survival is threatened. Yet still the officials at court and the soldiers throughout the realm remain loyal to you, your majesty. Because they remember the late emperor, all of them, and they wish to repay his kindness in service to you. This is the moment to extend your divine influence, to honour the memory of the late Emperor and strengthen the morale of your officers. It is not time to listen to bad advice, or close your ears to the suggestions of loyal men. The court and the administration are as one. Both must be judged by one standard. Those who are loyal and good must get what they deserve, but so must the evil-doers who break the law. This will demonstrate the justice of your rule. There cannot be one law for the court and another for the administration. Counselors and attendants like Guo Youzhi, Fei Yi, and Dong Yun are all reliable men, loyal of purpose and pure in motive. The late Emperor selected them for office so that they would serve you after his death.These are the men who should be consulted on all palace affairs. Xiang Chong has proved himself a fine general in battle, and the late Emperor believed in him. That is why the assembly has recommended him for overall command. It will keep the troops happy if he is consulted on all military matters. @@ -1703,22 +1703,22 @@ My only desire is to be permitted to drive out the traitors and restore the Han. 先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也。宫中府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科及为忠善者,宜付有司论其刑赏,以昭陛下平明之理,不宜偏私,使内外异法也。侍中、侍郎郭攸之、费祎、董允等,此皆良实,志虑忠纯,是以先帝简拔以遗陛下。愚以为宫中之事,事无大小,悉以咨之,然后施行,必能裨补阙漏,有所广益。将军向宠,性行淑均,晓畅军事,试用于昔日,先帝称之曰能,是以众议举宠为督。愚以为营中之事,悉以咨之,必能使行阵和睦,优劣得所。亲贤臣,远小人,此先汉所以兴隆也;亲小人,远贤臣,此后汉所以倾颓也。先帝在时,每与臣论此事,未尝不叹息痛恨于桓、灵也。侍中、尚书、长史、参军,此悉贞良死节之臣,愿陛下亲之信之,则汉室之隆,可计日而待也。臣本布衣,躬耕于南阳,苟全性命于乱世,不求闻达于诸侯。先帝不以臣卑鄙,猥自枉屈,三顾臣于草庐之中,咨臣以当世之事,由是感激,遂许先帝以驱驰。后值倾覆,受任于败军之际,奉命于危难之间,尔来二十有一年矣。先帝知臣谨慎,故临崩寄臣以大事也。受命以来,夙夜忧叹,恐托付不效,以伤先帝之明;故五月渡泸,深入不毛。今南方已定,兵甲已足,当奖率三军,北定中原,庶竭驽钝,攘除奸凶,兴复汉室,还于旧都。此臣所以报先帝而忠陛下之职分也。至于斟酌损益,进尽忠言,则攸之、祎、允之任也。愿陛下托臣以讨贼兴复之效,不效,则治臣之罪,以告先帝之灵。若无兴德之言,则责攸之、祎、允等之慢,以彰其咎;陛下亦宜自谋,以咨诹善道,察纳雅言,深追先帝遗诏。臣不胜受恩感激。今当远离,临表涕零,不知所言。 - + Check for Updates 检查更新 - + This is a ToggleButton in the header 这是一个位于头部的开关按钮 - + This is a StandardButton in the content 这是一个位于内容的标准按钮 - + Click StandardButton 点击标准按钮 @@ -1726,17 +1726,17 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_FlipView - + FlipView 翻转视图 - + Horizontal FlipView 水平方向的翻转视图 - + Vertical FlipView 垂直方向的翻转视图 @@ -1744,41 +1744,41 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_GroupBox - + GroupBox 分组容器 - + CheckBox Group 复选框分组 - - + + E-mail 邮箱 - - + + Calendar 日历 - - + + Contacts 联系人 - + RadioButton Group RadioButton Group111111111111111111111111 单选框分组 - + Disabled 禁用 @@ -1786,32 +1786,32 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Home - + FluentUI GitHub FluentUI GitHub - + The latest FluentUI controls and styles for your applications. 最新的 FluentUI 控件和样式 - + FluentUI Pro - + The latest FluentUI Pro controls and styles for your applications. 最新的 FluentUI 控件和样式 - + FluentUI Initializr FluentUI脚手架 - + FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options. FluentUI 脚手架是一个快速创建项目工具,可帮助您创建和自定义具有各种选项的 Fluent UI 项目 @@ -1819,17 +1819,17 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Icons - + Icons 图标 - + Please enter a keyword 请输入关键字 - + Disabled 禁用 @@ -1838,7 +1838,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. 搜索 - + You Copied 您复制 @@ -1846,7 +1846,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Image - + Image 图像 @@ -1855,7 +1855,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. 重新加载 - + The image failed to load, please reload 图片加载失败,请重新加载 @@ -1863,112 +1863,112 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_InfoBar - + InfoBar 信息栏 - + Info 信息 - - + + This is an InfoBar in the Info Style 这是一个Info样式的信息栏 - + Warning 警告 - + This is an InfoBar in the Warning Style 这是一个Warning样式的信息栏 - + Error 错误 - + This is an InfoBar in the Error Style 这是一个Error样式的信息栏 - + Success 成功 - + This is an InfoBar in the Success Style 这是一个Success样式的信息栏 - + InfoBar that needs to be turned off manually 需要手动关闭的信息栏 - + Manual shutdown is supported 支持手动关闭 - + Manually close the info message box 手动关闭信息栏 - - - + + + close '%1' 关闭 '%1' - - - + + + show '%1' 显示 '%1' - - - + + + This is an '%1' 这是 '%1' - - + + info1 信息1 - - + + info2 信息2 - - + + info3 信息3 - + clear all info 清除全部信息栏 - + Loading 正在加载 @@ -1980,7 +1980,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_LineChart - + Line Chart 线型图 @@ -1988,114 +1988,114 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Menu - - + + Menu 菜单 - - + + File 文件 - - + + New... 新建... - - + + Open... 打开... - - + + Save 保存 - - + + Quit 退出 - - + + Search 搜索 - - - + + + Disable 不可操作 - + Check 复选 - - + + Save As... 另存为... - - + + Doc DOC - - + + PDF PDF - + Show Menu Popup 打开菜单弹框 - + MenuBar 菜单栏 - + Edit 编辑 - + Cut 剪切 - + Copy 复制 - + Paste 粘贴 - + Help 帮助 - + About 关于 @@ -2103,46 +2103,46 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_MultiWindow - + MultiWindow 多窗口 - + <font color='red'>Standard</font> mode window,a new window is created every time <font color='red'>Standard</font> 模式窗口,每次都会创建新窗口 - - - - - + + + + + Create Window 创建窗口 - + <font color='red'>SingleTask</font> mode window,If a window exists, this activates the window <font color='red'>SingleTask</font> 模式窗口,如果窗口存在,这激活该窗口 - + <font color='red'>SingleInstance</font> mode window,If the window exists, destroy the window and create a new window <font color='red'>SingleInstance</font> 模式窗口,如果窗口存在,则销毁窗口,然后新建窗口 - + Create the window without carrying any parameters 创建一个窗口,不携带任何参数 - + Create a window with the parameter username: zhuzichu 创建一个窗口,并携带参数用户名:zhuzichu - + Login Window Returned Password - > 登录窗口返回过来的密码 - > @@ -2150,7 +2150,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Network - + Network 网络 @@ -2158,7 +2158,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_OpenGL - + OpenGL @@ -2166,7 +2166,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Pagination - + Pagination 分页 @@ -2182,32 +2182,32 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_ParallaxView - + ParallaxView 视差视图 - + Background size mode: 背景尺寸模式: - + Auto 自适应 - + Cover 完全覆盖 - + Fixed 固定 - + Speed: 视差滚动速度: @@ -2215,7 +2215,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_PieChart - + Pie Chart Doughnut and Pie Chart 饼图 @@ -2224,28 +2224,28 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Pinyin - + Pinyin 拼音 - + [pinyin-pro document](https://pinyin-pro.cn/guide/compare.html) [pinyin-pro文档](https://pinyin-pro.cn/guide/compare.html) - - + + Input Chinese or Pinyin 输入汉字或拼音 - + Matching time: %1 匹配耗时: %1 - + Matching with cache 带缓存匹配 @@ -2253,47 +2253,47 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Pivot - + Pivot 轴转 - + All 所有 - + All emails go here. 所有电子邮件都在这里 - + Unread 未读 - + Unread emails go here. 未读电子邮件都在这里 - + Flagged 标记 - + Flagged emails go here. 标记电子邮件都在这里 - + Urgent 紧急 - + Urgent emails go here. 紧急电子邮件都在这里 @@ -2301,7 +2301,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_PolarAreaChart - + Polar Area Chart PolarArea Chart 极坐标区域图 @@ -2310,7 +2310,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Progress - + Progress 进度条 @@ -2318,32 +2318,32 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_QRCode - + QRCode 二维码 - + text: 文本: - + color: 前景色: - + bgColor: 背景色: - + margins: 边距: - + size: 尺寸: @@ -2351,7 +2351,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_RadarChart - + Radar Chart 雷达图 @@ -2359,42 +2359,42 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_RadioButton - + RadioButton 单选按钮 - + Right - + Left - - - + + + Disabled 禁用 - - + + Radio Button_1 单选按钮_1 - - + + Radio Button_2 单选按钮_1 - - + + Radio Button_3 单选按钮_3 @@ -2402,7 +2402,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_RatingControl - + RatingControl 评级控制 @@ -2410,7 +2410,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Rectangle - + Rectangle 矩形 @@ -2418,7 +2418,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_ScatterChart - + Scatter Chart 散点图 @@ -2426,97 +2426,97 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Settings - + Settings 设置 - + Current Version 当前版本 - + Check for Updates 检查更新 - + Use System AppBar 使用系统应用栏 - + Fits AppBar Windows 沉浸式应用栏 - + Friendly Reminder 友情提示 - + This action requires a restart of the program to take effect, is it restarted? 此操作需要重启程序才能生效,是否重新启动? - + Cancel 取消 - + OK 确定 - + Dark Mode 夜间模式 - + System 跟随系统 - + Light 浅色 - + Dark 深色 - + Navigation View Display Mode 导航视图 - + Open 开放 - + Compact 紧凑 - + Minimal 极简 - + Auto 自动 - + Language 语言 @@ -2524,17 +2524,17 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Sheet - + Sheet 抽屉 - + Title 标题 - + Some contents... Some contents... Some contents... @@ -2543,22 +2543,22 @@ Some contents... 一些内容... - + top - + right - + bottom - + left @@ -2566,7 +2566,7 @@ Some contents... T_ShortcutPicker - + ShortcutPicker 快捷键选择器 @@ -2598,7 +2598,7 @@ Some contents... T_Slider - + Slider 滑块 @@ -2606,38 +2606,38 @@ Some contents... T_SplitLayout - + SplitLayout 拆分布局 - + orientation: 方向: - - + + Horizontal 水平 - + Vertical 垂直 - + Page 1 页面 1 - + Page 2 页面 2 - + Page 3 页面 3 @@ -2645,7 +2645,7 @@ Some contents... T_StaggeredLayout - + StaggeredLayout 瀑布流布局 @@ -2653,23 +2653,23 @@ Some contents... T_StatusLayout - + StatusLayout 状态布局 - - + + Loading 正在加载 - + Error 错误 - + Success 成功 @@ -2678,7 +2678,7 @@ Some contents... 正在加载... - + Empty 空空如也 @@ -2694,54 +2694,54 @@ Some contents... T_TabView - + TabView 选项卡 - + Document 文档 - + Tab Width Behavior: 选项卡宽度: - - + + Equal 相同宽度 - + SizeToContent 由内容 - + Compact 紧凑 - + Tab Close Button Visibility: 选项卡关闭按钮可见性: - - + + Always 可见 - + Never 不可见 - + OnHover 鼠标悬浮显示 @@ -2749,113 +2749,113 @@ Some contents... T_TableView - + TableView 表格 - + Modify the column name 修改列名 - + Cancel 取消 - + OK 确定 - + Search 搜索 - - + + Name 名称 - + Delete 删除 - + Edit 编辑 - + Select All 全选 - + Age 年龄 - + Clear All 清除所有 - + Insert a Row 插入一行 - + Focus not acquired: Please click any item in the form as the target for insertion! 焦点未获取:请点击表格中的任意一项,作为插入的靶点! - + Avatar 头像 - + Address 地址 - + Nickname 昵称 - + Long String 长字符串 - + Options 操作 - + <Previous <上一页 - + Next> 下一页> - + Delete Selection 删除选中 - + Add a row of Data 添加一行数据 @@ -2863,17 +2863,17 @@ Some contents... T_Text - + Text 文本 - + This is a text that can be copied 这是一个可以复制的文本 - + Disabled 禁用 @@ -2881,41 +2881,41 @@ Some contents... T_TextBox - + TextBox 文本框 - + Single-line Input Box 单行输入框 - - - - - + + + + + Disabled 禁用 - + Please enter your password 请输入您的密码 - + Multi-line Input Box 多行输入框 - + AutoSuggestBox 自动建议框 - + Show suggest when pressed 按下时显示建议 @@ -2923,37 +2923,37 @@ Some contents... T_Theme - + Theme 主题 - + Theme colors 主题颜色 - + Customize the Theme Color 自定义主题颜色 - + Dark Mode 夜间模式 - + Native Text Native文本 - + Open Animation 开启动画 - + Open Blur Window Rounded Window 亚克力背景 @@ -2964,23 +2964,23 @@ Some contents... - - + + dwm-blur 毛玻璃模糊 - + window tintOpacity 背景透明度 - + window blurRadius 背景模糊度 - + window effect 窗口效果 @@ -2988,53 +2988,53 @@ Some contents... T_TimePicker - + TimePicker 时间选择器 - + hourFormat=FluTimePickerType.H - - + + AM 上午 - - + + PM 下午 - - + + Hour - - + + Minute - - + + Cancel 取消 - - + + OK 确定 - + hourFormat=FluTimePickerType.HH @@ -3042,38 +3042,38 @@ Some contents... T_Timeline - + Timeline 时间轴 - + Append 追加 - + clear 清空 - + mode: 模式: - + Left - + Right - - + + Alternate 交替 @@ -3081,22 +3081,22 @@ Some contents... T_ToggleSwitch - + ToggleSwitch 切换开关 - + Right - + Left - + Disabled 禁用 @@ -3104,38 +3104,38 @@ Some contents... T_Tooltip - + Tooltip 工具提示 - + Hover over Tultip and it pops up 鼠标悬停不动,弹出Tooltip - + Text properties of FluIconButton support the Tooltip pop-up window by default FluIconButton的text属性自带Tooltip效果 - - + + Delete 删除 - + Click IconButton 点击图标按钮 - + Add a Tooltip pop-up to a Button 给一个Button添加Tooltip效果 - + Click Button 点击按钮 @@ -3155,66 +3155,66 @@ Some contents... 上一步 - - + + Upload File 上传文件 - - + + Put your files here. 把你的文件放在这里 - - - - + + + + Save 保存 - - + + Save your changes. 保存更改 - - + + Other Actions 其他操作 - - + + Click to see other actions. 点击查看其他操作 - + Begin Tour 开始导览 - + Begin Tour with custom indicator 以自定义指示器开始导览 - - + + Upload 上传 - + More 更多 - + Tour 漫游式引导 @@ -3222,7 +3222,7 @@ Some contents... T_TreeView - + TreeView @@ -3235,57 +3235,57 @@ Some contents... 共计选中%1条数据 - + Title 标题 - + Address 地址 - + Avatar 头像 - + cellHeight: 单元格高度 - + depthPadding: 填充深度 - + showLine 显示竖线 - + checkable 可勾选 - + all expand 全部展开 - + all collapse 全部折叠 - + print selection model 打印选择项的模型 - + Name 名称 @@ -3293,42 +3293,42 @@ Some contents... T_Typography - + Typography 字体 - + Display 显示 - + Title Large 大标题 - + Title 标题 - + Subtitle 副标题 - + Body Strong 多内容 - + Body 内容 - + Caption 标题 @@ -3336,47 +3336,47 @@ Some contents... T_Watermark - + Watermark 水印 - + text: 文本: - + textSize: 文字大小: - + gapX: 水平间距: - + gapY: 垂直间距: - + offsetX: 水平偏移: - + offsetY: 垂直偏移: - + rotate: 旋转角度: - + textColor: 水印颜色: diff --git a/src/.cmake/QmlPlugin.cmake b/src/.cmake/QmlPlugin.cmake index b7193718..db0c7d5a 100644 --- a/src/.cmake/QmlPlugin.cmake +++ b/src/.cmake/QmlPlugin.cmake @@ -17,6 +17,7 @@ function(FindQtInstallQml) ) set(QT_INSTALL_QML ${PROC_RESULT} PARENT_SCOPE) endfunction() + function(add_qmlplugin TARGET) set(options NO_AUTORCC NO_AUTOMOC) set(oneValueArgs URI VERSION BINARY_DIR QMLDIR LIBTYPE) @@ -32,97 +33,97 @@ function(add_qmlplugin TARGET) add_library(${TARGET} ${QMLPLUGIN_LIBTYPE} ${QMLPLUGIN_SOURCES} ) -set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib) -if(QMLPLUGIN_NO_AUTORCC) - set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF) -else() - set_target_properties(${TARGET} PROPERTIES AUTOMOC ON) -endif() -if(QMLPLUGIN_NO_AUTOMOC) - set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF) -else() - set_target_properties(${TARGET} PROPERTIES AUTOMOC ON) -endif() -if (${QMLPLUGIN_LIBTYPE} MATCHES "SHARED") - FindQmlPluginDump() - FindQtInstallQml() - if(QMLPLUGIN_BINARY_DIR) - set(MAKE_QMLPLUGINDIR_COMMAND ${CMAKE_COMMAND} -E make_directory ${QMLPLUGIN_BINARY_DIR}) + set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib) + if(QMLPLUGIN_NO_AUTORCC) + set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF) + else() + set_target_properties(${TARGET} PROPERTIES AUTOMOC ON) endif() - set(COPY_QMLDIR_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/qmldir $/${QMLPLUGIN_URI}/qmldir) - set(INSTALL_QMLDIR_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/qmldir ${QMLPLUGIN_BINARY_DIR}/qmldir) - set(COPY_QMLTYPES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/plugins.qmltypes $/${QMLPLUGIN_URI}/plugins.qmltypes) - set(INSTALL_QMLTYPES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/plugins.qmltypes ${QMLPLUGIN_BINARY_DIR}/plugins.qmltypes) - set(COPY_LIBRARY_COMMAND ${CMAKE_COMMAND} -E copy $/$ $/${QMLPLUGIN_URI}) - set(INSTALL_LIBRARY_COMMAND ${CMAKE_COMMAND} -E copy $/$ ${QMLPLUGIN_BINARY_DIR}) - if(QMLPLUGIN_QMLDIR) - set(COPY_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR} $/${QMLPLUGIN_URI}) + if(QMLPLUGIN_NO_AUTOMOC) + set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF) else() - set(COPY_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${QMLPLUGIN_QMLFILES} $/${QMLPLUGIN_URI}) + set_target_properties(${TARGET} PROPERTIES AUTOMOC ON) endif() - set(INSTALL_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR} ${QMLPLUGIN_BINARY_DIR}) - if(QMLPLUGIN_BINARY_DIR) + if (${QMLPLUGIN_LIBTYPE} MATCHES "SHARED") + FindQmlPluginDump() + FindQtInstallQml() + if(QMLPLUGIN_BINARY_DIR) + set(MAKE_QMLPLUGINDIR_COMMAND ${CMAKE_COMMAND} -E make_directory ${QMLPLUGIN_BINARY_DIR}) + endif() + set(COPY_QMLDIR_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/qmldir $/${QMLPLUGIN_URI}/qmldir) + set(INSTALL_QMLDIR_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/qmldir ${QMLPLUGIN_BINARY_DIR}/qmldir) + set(COPY_QMLTYPES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/plugins.qmltypes $/${QMLPLUGIN_URI}/plugins.qmltypes) + set(INSTALL_QMLTYPES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/plugins.qmltypes ${QMLPLUGIN_BINARY_DIR}/plugins.qmltypes) + set(COPY_LIBRARY_COMMAND ${CMAKE_COMMAND} -E copy $/$ $/${QMLPLUGIN_URI}) + set(INSTALL_LIBRARY_COMMAND ${CMAKE_COMMAND} -E copy $/$ ${QMLPLUGIN_BINARY_DIR}) + if(QMLPLUGIN_QMLDIR) + set(COPY_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR} $/${QMLPLUGIN_URI}) + else() + set(COPY_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${QMLPLUGIN_QMLFILES} $/${QMLPLUGIN_URI}) + endif() + set(INSTALL_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR} ${QMLPLUGIN_BINARY_DIR}) + if(QMLPLUGIN_BINARY_DIR) + add_custom_command( + TARGET ${TARGET} + POST_BUILD + COMMAND ${MAKE_QMLPLUGINDIR_COMMAND} + COMMAND ${COPY_QMLDIR_COMMAND} + COMMENT "Copying qmldir to binary directory" + ) + else() add_custom_command( TARGET ${TARGET} POST_BUILD - COMMAND ${MAKE_QMLPLUGINDIR_COMMAND} COMMAND ${COPY_QMLDIR_COMMAND} COMMENT "Copying qmldir to binary directory" ) -else() - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${COPY_QMLDIR_COMMAND} - COMMENT "Copying qmldir to binary directory" - ) -endif() -if(QMLPLUGIN_BINARY_DIR) + endif() + if(QMLPLUGIN_BINARY_DIR) + add_custom_command( + TARGET ${TARGET} + POST_BUILD + COMMAND ${MAKE_QMLPLUGINDIR_COMMAND} + COMMAND ${COPY_QMLTYPES_COMMAND} + COMMENT "Copying qmltypes to binary directory" + ) + else() + add_custom_command( + TARGET ${TARGET} + POST_BUILD + COMMAND ${COPY_QMLTYPES_COMMAND} + COMMENT "Copying qmltypes to binary directory" + ) + endif() add_custom_command( TARGET ${TARGET} POST_BUILD - COMMAND ${MAKE_QMLPLUGINDIR_COMMAND} - COMMAND ${COPY_QMLTYPES_COMMAND} - COMMENT "Copying qmltypes to binary directory" + COMMAND ${COPY_LIBRARY_COMMAND} + COMMENT "Copying Lib to binary plugin directory" ) -else() + if(QMLPLUGIN_QMLFILES) + add_custom_command( + TARGET ${TARGET} + POST_BUILD + COMMAND ${COPY_QMLFILES_COMMAND} + COMMENT "Copying QML files to binary directory" + ) + endif() add_custom_command( TARGET ${TARGET} POST_BUILD - COMMAND ${COPY_QMLTYPES_COMMAND} - COMMENT "Copying qmltypes to binary directory" + COMMAND ${GENERATE_QMLTYPES_COMMAND} + COMMENT "Generating plugin.qmltypes" ) -endif() -add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${COPY_LIBRARY_COMMAND} - COMMENT "Copying Lib to binary plugin directory" -) -if(QMLPLUGIN_QMLFILES) + string(REPLACE "." "/" QMLPLUGIN_INSTALL_URI ${QMLPLUGIN_URI}) add_custom_command( TARGET ${TARGET} POST_BUILD - COMMAND ${COPY_QMLFILES_COMMAND} - COMMENT "Copying QML files to binary directory" + COMMAND ${INSTALL_QMLTYPES_COMMAND} + COMMAND ${INSTALL_QMLDIR_COMMAND} + COMMAND ${INSTALL_LIBRARY_COMMAND} + COMMAND ${INSTALL_QMLFILES_COMMAND} + COMMAND ${INSTALL_QMLTYPES_COMMAND} + COMMENT "Install library and aditional files" ) -endif() -add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${GENERATE_QMLTYPES_COMMAND} - COMMENT "Generating plugin.qmltypes" -) -string(REPLACE "." "/" QMLPLUGIN_INSTALL_URI ${QMLPLUGIN_URI}) -add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${INSTALL_QMLTYPES_COMMAND} - COMMAND ${INSTALL_QMLDIR_COMMAND} - COMMAND ${INSTALL_LIBRARY_COMMAND} - COMMAND ${INSTALL_QMLFILES_COMMAND} - COMMAND ${INSTALL_QMLTYPES_COMMAND} - COMMENT "Install library and aditional files" -) -endif() + endif() endfunction() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c8b3e50c..79530a01 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,7 +30,6 @@ endif () option(FLUENTUI_BUILD_STATIC_LIB "Build static library." OFF) #导入Qt相关依赖包 -find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Quick Qml Widgets PrintSupport) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick Widgets PrintSupport) set(QT_SDK_DIR "${Qt${QT_VERSION_MAJOR}_DIR}/../../..") @@ -42,20 +41,41 @@ if (NOT FLUENTUI_QML_PLUGIN_DIRECTORY) set(FLUENTUI_QML_PLUGIN_DIRECTORY ${QT_SDK_DIR}/qml/FluentUI) endif () -#国际化 -find_program(QT_LUPDATE NAMES lupdate) -find_program(QT_LRELEASE NAMES lrelease) -if (NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/fluentui_en_US.qm) - execute_process(COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts fluentui_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) - execute_process(COMMAND ${QT_LRELEASE} fluentui_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) -endif () -if (NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/fluentui_zh_CN.qm) - execute_process(COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts fluentui_zh_CN.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) - execute_process(COMMAND ${QT_LRELEASE} fluentui_zh_CN.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) -endif () +# 查找Qt Linguist工具 +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQtLinguistTools.cmake) + +# 获取 translations 目录下的所有 .ts 文件 +file(GLOB_RECURSE TS_FILES "${CMAKE_CURRENT_LIST_DIR}/translations/*.ts") + +# 构建命令列表 +set(UPDATE_TRANSLATION_COMMANDS) +set(LRELEASE_COMMANDS) +set(QM_FILES) + +foreach(TSFIL ${TS_FILES}) + get_filename_component(FIL_WE ${TSFIL} NAME_WE) + set(QMFIL ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.qm) + + # 添加 lupdate 命令 + list(APPEND UPDATE_TRANSLATION_COMMANDS COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${TSFIL} WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) -file(GLOB QM_FILE_PATHS ${CMAKE_CURRENT_LIST_DIR}/ *.qm) -file(COPY ${QM_FILE_PATHS} DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/Qt${QT_VERSION_MAJOR}/imports/FluentUI/i18n") + # 添加 lrelease 命令 + list(APPEND LRELEASE_COMMANDS COMMAND ${QT_LRELEASE} ${TSFIL} -qm ${QMFIL}) + + # 记录生成的 qm 文件 + list(APPEND QM_FILES ${QMFIL}) +endforeach() + +# 执行翻译更新和编译 +if(TS_FILES) + execute_process(${UPDATE_TRANSLATION_COMMANDS}) + execute_process(${LRELEASE_COMMANDS}) +endif() + +# 复制qm文件到目标目录 +if(QM_FILES) + file(COPY ${QM_FILES} DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/Qt${QT_VERSION_MAJOR}/imports/FluentUI/i18n") +endif() #遍历所有Cpp文件 file(GLOB_RECURSE CPP_FILES *.cpp *.h *.cxx) diff --git a/src/fluentui_en_US.ts b/src/fluentui_en_US.ts deleted file mode 100644 index 5a6d023d..00000000 --- a/src/fluentui_en_US.ts +++ /dev/null @@ -1,377 +0,0 @@ - - - - - FluAppBar - - - - Dark - - - - - - Light - - - - - - Minimize - - - - - - Restore - - - - - - Maximize - - - - - - Close - - - - - - Sticky on Top - - - - - - Sticky on Top cancelled - - - - - FluAutoSuggestBox - - - - No results found - - - - - FluCalendarPicker - - - - Pick a date - - - - - FluColorPicker - - - - Cancel - - - - - - OK - - - - - - Color Picker - - - - - - Edit Color - - - - - - Red - - - - - - Green - - - - - - Blue - - - - - - Opacity - - - - - FluContentDialog - - - - Close - - - - - - Cancel - - - - - - OK - - - - - FluDatePicker - - - - Year - - - - - - Month - - - - - - Day - - - - - - Cancel - - - - - - OK - - - - - FluImage - - - - Reload - - - - - FluPagination - - - - <Previous - - - - - - Next> - - - - - FluShortcutPicker - - - - Activate the Shortcut - - - - - - Press the key combination to change the shortcut - - - - - - Save - - - - - - Cancel - - - - - - Reset - - - - - - Conflict - - - - - FluStatusLayout - - - - Loading... - - - - - - Empty - - - - - - Error - - - - - - Reload - - - - - FluTextBoxMenu - - - - Cut - - - - - - Copy - - - - - - Paste - - - - - - Select All - - - - - FluTimePicker - - - - AM - - - - - - PM - - - - - - Hour - - - - - - Minute - - - - - - Cancel - - - - - - OK - - - - - FluTour - - - - Finish - - - - - - Next - - - - - - Previous - - - - - FluWindow - - - - Loading... - - - - - QHotkey - - - Failed to register %1. Error: %2 - - - - - Failed to unregister %1. Error: %2 - - - - diff --git a/src/fluentui_zh_CN.ts b/src/fluentui_zh_CN.ts deleted file mode 100644 index ee275b8f..00000000 --- a/src/fluentui_zh_CN.ts +++ /dev/null @@ -1,377 +0,0 @@ - - - - - FluAppBar - - - - Dark - 深色 - - - - - Light - 浅色 - - - - - Minimize - 最小化 - - - - - Restore - 还原 - - - - - Maximize - 最大化 - - - - - Close - 关闭 - - - - - Sticky on Top - 置顶 - - - - - Sticky on Top cancelled - 取消置顶 - - - - FluAutoSuggestBox - - - - No results found - 未找到结果 - - - - FluCalendarPicker - - - - Pick a date - 选择日期 - - - - FluColorPicker - - - - Cancel - 取消 - - - - - OK - 确定 - - - - - Color Picker - 颜色选择器 - - - - - Edit Color - 编辑颜色 - - - - - Red - 红色 - - - - - Green - 绿色 - - - - - Blue - 蓝色 - - - - - Opacity - 透明度 - - - - FluContentDialog - - - - Close - 关闭 - - - - - Cancel - 取消 - - - - - OK - 确定 - - - - FluDatePicker - - - - Year - - - - - - Month - - - - - - Day - - - - - - Cancel - 取消 - - - - - OK - 确定 - - - - FluImage - - - - Reload - 重新加载 - - - - FluPagination - - - - <Previous - <上一页 - - - - - Next> - 下一页> - - - - FluShortcutPicker - - - - Activate the Shortcut - 激活快捷键 - - - - - Press the key combination to change the shortcut - 按下组合键以更改此快捷键 - - - - - Save - 保存 - - - - - Cancel - 取消 - - - - - Reset - 重置 - - - - - Conflict - 冲突 - - - - FluStatusLayout - - - - Loading... - 加载中... - - - - - Empty - 空空如也 - - - - - Error - 似乎出了点问题 - - - - - Reload - 重新加载 - - - - FluTextBoxMenu - - - - Cut - 剪切 - - - - - Copy - 复制 - - - - - Paste - 粘贴 - - - - - Select All - 全选 - - - - FluTimePicker - - - - AM - 上午 - - - - - PM - 下午 - - - - - Hour - - - - - - Minute - - - - - - Cancel - 取消 - - - - - OK - 确定 - - - - FluTour - - - - Finish - 结束导览 - - - - - Next - 下一步 - - - - - Previous - 上一步 - - - - FluWindow - - - - Loading... - 加载中... - - - - QHotkey - - - Failed to register %1. Error: %2 - 注册热键 %1 失败。错误:%2 - - - - Failed to unregister %1. Error: %2 - 注销热键 %1 失败。错误:%2 - - - diff --git a/src/translations/fluentui_en_US.ts b/src/translations/fluentui_en_US.ts new file mode 100644 index 00000000..25882057 --- /dev/null +++ b/src/translations/fluentui_en_US.ts @@ -0,0 +1,377 @@ + + + + + FluAppBar + + + + Dark + + + + + + Light + + + + + + Minimize + + + + + + Restore + + + + + + Maximize + + + + + + Close + + + + + + Sticky on Top + + + + + + Sticky on Top cancelled + + + + + FluAutoSuggestBox + + + + No results found + + + + + FluCalendarPicker + + + + Pick a date + + + + + FluColorPicker + + + + Cancel + + + + + + OK + + + + + + Color Picker + + + + + + Edit Color + + + + + + Red + + + + + + Green + + + + + + Blue + + + + + + Opacity + + + + + FluContentDialog + + + + Close + + + + + + Cancel + + + + + + OK + + + + + FluDatePicker + + + + Year + + + + + + Month + + + + + + Day + + + + + + Cancel + + + + + + OK + + + + + FluImage + + + + Reload + + + + + FluPagination + + + + <Previous + + + + + + Next> + + + + + FluShortcutPicker + + + + Activate the Shortcut + + + + + + Press the key combination to change the shortcut + + + + + + Save + + + + + + Cancel + + + + + + Reset + + + + + + Conflict + + + + + FluStatusLayout + + + + Loading... + + + + + + Empty + + + + + + Error + + + + + + Reload + + + + + FluTextBoxMenu + + + + Cut + + + + + + Copy + + + + + + Paste + + + + + + Select All + + + + + FluTimePicker + + + + AM + + + + + + PM + + + + + + Hour + + + + + + Minute + + + + + + Cancel + + + + + + OK + + + + + FluTour + + + + Finish + + + + + + Next + + + + + + Previous + + + + + FluWindow + + + + Loading... + + + + + QHotkey + + + Failed to register %1. Error: %2 + + + + + Failed to unregister %1. Error: %2 + + + + diff --git a/src/translations/fluentui_zh_CN.ts b/src/translations/fluentui_zh_CN.ts new file mode 100644 index 00000000..bfc8da0c --- /dev/null +++ b/src/translations/fluentui_zh_CN.ts @@ -0,0 +1,377 @@ + + + + + FluAppBar + + + + Dark + 深色 + + + + + Light + 浅色 + + + + + Minimize + 最小化 + + + + + Restore + 还原 + + + + + Maximize + 最大化 + + + + + Close + 关闭 + + + + + Sticky on Top + 置顶 + + + + + Sticky on Top cancelled + 取消置顶 + + + + FluAutoSuggestBox + + + + No results found + 未找到结果 + + + + FluCalendarPicker + + + + Pick a date + 选择日期 + + + + FluColorPicker + + + + Cancel + 取消 + + + + + OK + 确定 + + + + + Color Picker + 颜色选择器 + + + + + Edit Color + 编辑颜色 + + + + + Red + 红色 + + + + + Green + 绿色 + + + + + Blue + 蓝色 + + + + + Opacity + 透明度 + + + + FluContentDialog + + + + Close + 关闭 + + + + + Cancel + 取消 + + + + + OK + 确定 + + + + FluDatePicker + + + + Year + + + + + + Month + + + + + + Day + + + + + + Cancel + 取消 + + + + + OK + 确定 + + + + FluImage + + + + Reload + 重新加载 + + + + FluPagination + + + + <Previous + <上一页 + + + + + Next> + 下一页> + + + + FluShortcutPicker + + + + Activate the Shortcut + 激活快捷键 + + + + + Press the key combination to change the shortcut + 按下组合键以更改此快捷键 + + + + + Save + 保存 + + + + + Cancel + 取消 + + + + + Reset + 重置 + + + + + Conflict + 冲突 + + + + FluStatusLayout + + + + Loading... + 加载中... + + + + + Empty + 空空如也 + + + + + Error + 似乎出了点问题 + + + + + Reload + 重新加载 + + + + FluTextBoxMenu + + + + Cut + 剪切 + + + + + Copy + 复制 + + + + + Paste + 粘贴 + + + + + Select All + 全选 + + + + FluTimePicker + + + + AM + 上午 + + + + + PM + 下午 + + + + + Hour + + + + + + Minute + + + + + + Cancel + 取消 + + + + + OK + 确定 + + + + FluTour + + + + Finish + 结束导览 + + + + + Next + 下一步 + + + + + Previous + 上一步 + + + + FluWindow + + + + Loading... + 加载中... + + + + QHotkey + + + Failed to register %1. Error: %2 + 注册热键 %1 失败。错误:%2 + + + + Failed to unregister %1. Error: %2 + 注销热键 %1 失败。错误:%2 + + +