fix: add some chinese translation in example

add some chinese translation in example
This commit is contained in:
zhanghongyuan
2025-02-13 09:32:01 +08:00
parent 09e0430293
commit 113810879d
16 changed files with 893 additions and 125 deletions

View File

@ -12,7 +12,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"tintColor:"
text: qsTr("tintColor:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
@ -22,7 +22,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"tintOpacity:"
text: qsTr("tintOpacity:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -33,7 +33,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"blurRadius:"
text: qsTr("blurRadius:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -69,7 +69,7 @@ FluScrollablePage{
y:(image.height-height)/2
FluText {
anchors.centerIn: parent
text: "Acrylic"
text: qsTr("Acrylic")
color: "#FFFFFF"
font: FluTextStyle.Subtitle
}

View File

@ -12,7 +12,7 @@ FluScrollablePage{
Component.onCompleted: {
var items = []
for(var i=0;i<10;i++){
items.push({title:"Item_"+(i+1)})
items.push({title: qsTr("Item_%1").arg(i+1)})
}
breadcrumb_1.items = items
breadcrumb_2.items = items
@ -51,7 +51,7 @@ FluScrollablePage{
onClicked:{
var items = []
for(var i=0;i<10;i++){
items.push({title:"Item_"+(i+1)})
items.push({title: qsTr("Item_")+(i+1)})
}
breadcrumb_2.items = items
}

View File

@ -45,7 +45,7 @@ FluScrollablePage{
Layout.preferredWidth: 240
}
FluButton{
text:"verify"
text: qsTr("verify")
onClicked: {
var success = captcha.verify(text_box.text)
if(success){

View File

@ -17,15 +17,15 @@ FluScrollablePage{
spacing: 5
anchors.verticalCenter: parent.verticalCenter
FluText{
text: "editable=false"
text: qsTr("editable=false")
x:10
}
FluComboBox {
model: ListModel {
id: model_1
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement { text: qsTr("Banana") }
ListElement { text: qsTr("Apple") }
ListElement { text: qsTr("Coconut") }
}
}
}
@ -40,16 +40,16 @@ FluScrollablePage{
spacing: 5
anchors.verticalCenter: parent.verticalCenter
FluText{
text: "disabled=true"
text: qsTr("disabled=true")
x:10
}
FluComboBox {
disabled: true
model: ListModel {
id: model_2
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement { text: qsTr("Banana") }
ListElement { text: qsTr("Apple") }
ListElement { text: qsTr("Coconut") }
}
}
}
@ -64,16 +64,16 @@ FluScrollablePage{
spacing: 5
anchors.verticalCenter: parent.verticalCenter
FluText{
text: "editable=true"
text: qsTr("editable=true")
x:5
}
FluComboBox {
editable: true
model: ListModel {
id: model_3
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement { text: qsTr("Banana") }
ListElement { text: qsTr("Apple") }
ListElement { text: qsTr("Coconut") }
}
onAccepted: {
if (find(editText) === -1)
@ -85,19 +85,21 @@ FluScrollablePage{
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluComboBox{
code:qsTr('FluComboBox{
editable: true
model: ListModel {
id: model
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement { text: "%1" }
ListElement { text: "%2" }
ListElement { text: "%3" }
}
onAccepted: {
if (find(editText) === -1)
model.append({text: editText})
}
}'
}').arg(qsTr("Banana"))
.arg(qsTr("Apple"))
.arg(qsTr("Coconut"))
}
}

View File

@ -36,13 +36,13 @@ FluScrollablePage{
}
}
FluButton{
text:"Error"
text: qsTr("Error")
onClicked: {
showError(qsTr("This is an InfoBar in the Error Style"))
}
}
FluButton{
text:"Success"
text: qsTr("Success")
onClicked: {
showSuccess(qsTr("This is an InfoBar in the Success Style"))
}
@ -61,34 +61,34 @@ FluScrollablePage{
Row{
spacing: 5
FluButton{
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info1")
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info1"))
onClicked: {
if(info1) {
info1.close()
return
}
info1 = showInfo(qsTr("This is an '%1'").arg("info1"), 0)
info1 = showInfo(qsTr("This is an '%1'").arg(qsTr("info1")), 0)
info1.close()
}
}
FluButton{
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info2")
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info2"))
onClicked: {
if(info2) {
info2.close()
return
}
info2 = showInfo(qsTr("This is an '%1'").arg("info2"), 0)
info2 = showInfo(qsTr("This is an '%1'").arg(qsTr("info2")), 0)
}
}
FluButton{
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info3")
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info3"))
onClicked: {
if(info3) {
info3.close()
return
}
info3 = showInfo(qsTr("This is an '%1'").arg("info3"), 0)
info3 = showInfo(qsTr("This is an '%1'").arg(qsTr("info3")), 0)
}
}
FluButton{
@ -100,7 +100,7 @@ FluScrollablePage{
}
FluButton{
text:"Loading"
text: qsTr("Loading")
onClicked: {
showLoading()
}

View File

@ -24,7 +24,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 20
FluText{
text:"text:"
text: qsTr("text:")
Layout.alignment: Qt.AlignVCenter
}
FluTextBox{
@ -38,7 +38,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 10
FluText{
text:"color:"
text: qsTr("color:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
@ -51,7 +51,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 10
FluText{
text:"bgColor:"
text: qsTr("bgColor:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
@ -63,7 +63,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"margins:"
text: qsTr("margins:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -77,7 +77,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"size:"
text: qsTr("size:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{

View File

@ -15,21 +15,21 @@ FluContentPage{
top: parent.top
}
FluText{
text:"orientation:"
text: qsTr("orientation:")
}
FluDropDownButton{
id:btn_orientation
Layout.preferredWidth: 120
text:"Horizontal"
text: qsTr("Horizontal")
FluMenuItem{
text:"Horizontal"
text: qsTr("Horizontal")
onClicked: {
btn_orientation.text = text
split_layout.orientation = Qt.Horizontal
}
}
FluMenuItem{
text:"Vertical"
text: qsTr("Vertical")
onClicked: {
btn_orientation.text = text
split_layout.orientation = Qt.Vertical
@ -54,7 +54,7 @@ FluContentPage{
SplitView.maximumWidth: 400
SplitView.maximumHeight: 400
FluText {
text: "Page 1"
text: qsTr("Page 1")
anchors.centerIn: parent
}
}
@ -66,7 +66,7 @@ FluContentPage{
SplitView.fillWidth: true
SplitView.fillHeight: true
FluText {
text: "Page 2"
text: qsTr("Page 2")
anchors.centerIn: parent
}
}
@ -75,7 +75,7 @@ FluContentPage{
implicitWidth: 200
implicitHeight: 200
FluText {
text: "Page 3"
text: qsTr("Page 3")
anchors.centerIn: parent
}
}

View File

@ -19,30 +19,30 @@ FluScrollablePage{
FluDropDownButton{
id:btn_status_mode
Layout.preferredWidth: 140
text:"Loading"
text: qsTr("Loading")
FluMenuItem{
text:"Loading"
text: qsTr("Loading")
onClicked: {
btn_status_mode.text = text
status_view.statusMode = FluStatusLayoutType.Loading
}
}
FluMenuItem{
text:"Empty"
text: qsTr("Empty")
onClicked: {
btn_status_mode.text = text
status_view.statusMode = FluStatusLayoutType.Empty
}
}
FluMenuItem{
text:"Error"
text: qsTr("Error")
onClicked: {
btn_status_mode.text = text
status_view.statusMode = FluStatusLayoutType.Error
}
}
FluMenuItem{
text:"Success"
text: qsTr("Success")
onClicked: {
btn_status_mode.text = text
status_view.statusMode = FluStatusLayoutType.Success

View File

@ -35,52 +35,58 @@ FluScrollablePage{
padding: 10
RowLayout{
spacing: 14
FluCopyableText{
text: qsTr("Tab Width Behavior:")
}
FluDropDownButton{
id:btn_tab_width_behavior
Layout.preferredWidth: 140
text:"Equal"
text: qsTr("Equal")
FluMenuItem{
text:"Equal"
text: qsTr("Equal")
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabViewType.Equal
}
}
FluMenuItem{
text:"SizeToContent"
text: qsTr("SizeToContent")
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabViewType.SizeToContent
}
}
FluMenuItem{
text:"Compact"
text: qsTr("Compact")
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabViewType.Compact
}
}
}
FluCopyableText{
text: qsTr("Tab Close Button Visibility:")
}
FluDropDownButton{
id:btn_close_button_visibility
text:"Always"
text: qsTr("Always")
Layout.preferredWidth: 120
FluMenuItem{
text:"Never"
text: qsTr("Never")
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabViewType.Never
}
}
FluMenuItem{
text:"Always"
text: qsTr("Always")
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabViewType.Always
}
}
FluMenuItem{
text:"OnHover"
text: qsTr("OnHover")
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabViewType.OnHover

View File

@ -154,12 +154,12 @@ FluScrollablePage{
}
}
FluText{
visible: FluTheme.blurBehindWindowEnabled || window.effect === "dwm-blur"
visible: FluTheme.blurBehindWindowEnabled || window.effect === qsTr("dwm-blur")
text: qsTr("window tintOpacity")
Layout.topMargin: 20
}
FluSlider{
visible: FluTheme.blurBehindWindowEnabled || window.effect === "dwm-blur"
visible: FluTheme.blurBehindWindowEnabled || window.effect === qsTr("dwm-blur")
Layout.topMargin: 5
to:1
stepSize:0.1

View File

@ -127,28 +127,28 @@ FluScrollablePage{
RowLayout{
Layout.topMargin: 10
FluText{
text:"mode:"
text: qsTr("mode:")
}
FluDropDownButton{
id: btn_mode
Layout.preferredWidth: 100
text: "Alternate"
text: qsTr("Alternate")
FluMenuItem{
text: "Left"
text: qsTr("Left")
onClicked: {
btn_mode.text = text
time_line.mode = FluTimelineType.Left
}
}
FluMenuItem{
text: "Right"
text: qsTr("Right")
onClicked: {
btn_mode.text = text
time_line.mode = FluTimelineType.Right
}
}
FluMenuItem{
text: "Alternate"
text: qsTr("Alternate")
onClicked: {
btn_mode.text = text
time_line.mode = FluTimelineType.Alternate

View File

@ -9,7 +9,6 @@ FluContentPage {
title: qsTr("TreeView")
function treeData(){
const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"]
function getRandomName(){
@ -90,7 +89,7 @@ FluContentPage {
RowLayout{
spacing: 10
FluText{
text: "cellHeight:"
text: qsTr("cellHeight:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -103,7 +102,7 @@ FluContentPage {
RowLayout{
spacing: 10
FluText{
text: "depthPadding:"
text: qsTr("depthPadding:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -119,12 +118,12 @@ FluContentPage {
anchors.verticalCenter: parent.verticalCenter
FluToggleSwitch{
id: switch_showline
text:"showLine"
text: qsTr("showLine")
checked: false
}
FluToggleSwitch{
id: switch_checkable
text:"checkable"
text: qsTr("checkable")
checked: false
}
}
@ -132,20 +131,20 @@ FluContentPage {
spacing: 8
anchors.verticalCenter: parent.verticalCenter
FluButton{
text: "all expand"
text: qsTr("all expand")
onClicked: {
tree_view.allExpand()
}
}
FluButton{
text: "all collapse"
text: qsTr("all collapse")
onClicked: {
tree_view.allCollapse()
}
}
}
FluButton{
text: "print selection model"
text: qsTr("print selection model")
onClicked: {
var printData = []
var data = tree_view.selectionModel();

View File

@ -24,43 +24,43 @@ FluContentPage {
transformOrigin: Item.TopLeft
FluText{
id:text_Display
text:"Display"
text: qsTr("Display")
padding: 0
font: FluTextStyle.Display
}
FluText{
id:text_TitleLarge
text:"Title Large"
text: qsTr("Title Large")
padding: 0
font: FluTextStyle.TitleLarge
}
FluText{
id:text_Title
text:"Title"
text: qsTr("Title")
padding: 0
font: FluTextStyle.Title
}
FluText{
id:text_Subtitle
text:"Subtitle"
text: qsTr("Subtitle")
padding: 0
font: FluTextStyle.Subtitle
}
FluText{
id:text_BodyStrong
text:"Body Strong"
text: qsTr("Body Strong")
padding: 0
font: FluTextStyle.BodyStrong
}
FluText{
id:text_Body
text:"Body"
text: qsTr("Body")
padding: 0
font: FluTextStyle.Body
}
FluText{
id:text_Caption
text:"Caption"
text: qsTr("Caption")
padding: 0
font: FluTextStyle.Caption
}

View File

@ -22,7 +22,7 @@ FluContentPage{
spacing: 10
Layout.topMargin: 14
FluText{
text: "text:"
text: qsTr("text:")
Layout.alignment: Qt.AlignVCenter
}
FluTextBox{
@ -35,7 +35,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "textSize:"
text: qsTr("textSize:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -48,7 +48,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "gapX:"
text: qsTr("gapX:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -59,7 +59,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "gapY:"
text: qsTr("gapY:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -70,7 +70,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "offsetX:"
text: qsTr("offsetX:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -81,7 +81,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "offsetY:"
text: qsTr("offsetY:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -92,7 +92,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "rotate:"
text: qsTr("rotate:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -105,7 +105,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "textColor:"
text: qsTr("textColor:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{