Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: add some chinese translation in example #587

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
387 changes: 382 additions & 5 deletions example/example_en_US.ts

Large diffs are not rendered by default.

448 changes: 416 additions & 32 deletions example/example_zh_CN.ts

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions example/qml/page/T_Acrylic.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"tintColor:"
text: qsTr("tintColor:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
Expand All @@ -22,7 +22,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"tintOpacity:"
text: qsTr("tintOpacity:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
Expand All @@ -33,7 +33,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"blurRadius:"
text: qsTr("blurRadius:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
Expand Down Expand Up @@ -69,7 +69,7 @@ FluScrollablePage{
y:(image.height-height)/2
FluText {
anchors.centerIn: parent
text: "Acrylic"
text: qsTr("Acrylic")
color: "#FFFFFF"
font: FluTextStyle.Subtitle
}
Expand Down
4 changes: 2 additions & 2 deletions example/qml/page/T_BreadcrumbBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion example/qml/page/T_Captcha.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FluScrollablePage{
Layout.preferredWidth: 240
}
FluButton{
text:"verify"
text: qsTr("verify")
onClicked: {
var success = captcha.verify(text_box.text)
if(success){
Expand Down
36 changes: 19 additions & 17 deletions example/qml/page/T_ComboBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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") }
}
}
}
Expand All @@ -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") }
}
}
}
Expand All @@ -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)
Expand All @@ -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"))
}

}
18 changes: 9 additions & 9 deletions example/qml/page/T_InfoBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand All @@ -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{
Expand All @@ -100,7 +100,7 @@ FluScrollablePage{
}

FluButton{
text:"Loading"
text: qsTr("Loading")
onClicked: {
showLoading()
}
Expand Down
10 changes: 5 additions & 5 deletions example/qml/page/T_QRCode.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 20
FluText{
text:"text:"
text: qsTr("text:")
Layout.alignment: Qt.AlignVCenter
}
FluTextBox{
Expand All @@ -38,7 +38,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 10
FluText{
text:"color:"
text: qsTr("color:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
Expand All @@ -51,7 +51,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 10
FluText{
text:"bgColor:"
text: qsTr("bgColor:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
Expand All @@ -63,7 +63,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"margins:"
text: qsTr("margins:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
Expand All @@ -77,7 +77,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"size:"
text: qsTr("size:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
Expand Down
14 changes: 7 additions & 7 deletions example/qml/page/T_SplitLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -54,7 +54,7 @@ FluContentPage{
SplitView.maximumWidth: 400
SplitView.maximumHeight: 400
FluText {
text: "Page 1"
text: qsTr("Page 1")
anchors.centerIn: parent
}
}
Expand All @@ -66,7 +66,7 @@ FluContentPage{
SplitView.fillWidth: true
SplitView.fillHeight: true
FluText {
text: "Page 2"
text: qsTr("Page 2")
anchors.centerIn: parent
}
}
Expand All @@ -75,7 +75,7 @@ FluContentPage{
implicitWidth: 200
implicitHeight: 200
FluText {
text: "Page 3"
text: qsTr("Page 3")
anchors.centerIn: parent
}
}
Expand Down
10 changes: 5 additions & 5 deletions example/qml/page/T_StatusLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading