Request to Change Table Data Language English to Chinese (zh)

I am writing to request a change in the table data language from English to Chinese (Simplified - zh)
I have added all sentence in translation manager.

I have attached image for your reference


.

my data received from below format. (using named quarry (json format))
[
{
"id": 1887,
"duration": "00:05:28",
"dtreason": "Quality Issue",
"comment": "Rejected Products due to quality",
"ack_status": ":white_check_mark:"
},
{
"id": 1886,
"duration": "00:00:22",
"dtreason": "Power Failure",
"comment": "Power Outage",
"ack_status": ":white_check_mark:"
},
{
"id": 1885,
"duration": "00:00:54",
"dtreason": "Cleaning",
"comment": "Cleaning machine",
"ack_status": ":white_check_mark:"
},
{
"id": 1884,
"duration": "00:00:24",
"dtreason": "Scheduled break",
"comment": "Operator at Scheduled break",
"ack_status": ":white_check_mark:"
},
{
"id": 1883,
"duration": "00:04:48",
"dtreason": "Cleaning",
"comment": "Cleaning machine",
"ack_status": ":white_check_mark:"
},
{
"id": 1882,
"duration": "00:00:06",
"dtreason": "Quality Issue",
"comment": "Rejected Products due to quality",
"ack_status": ":white_check_mark:"
}
]

I have added all text in translation manger please suggest me how to translate.

Welcome to the forum. Please see Wiki - how to post code on this forum.

Hi. I want to translate when i selected language English (en) or chinses (zh) then all table data will translate in specific language.
can you give me specific suggest me how can i do.
in previous conversation i attached table image for your reference.

You said all that in post #1! Don't repeat.

The translate function will translate all the application text (buttons, headings, etc.) but not the table contents.

You will have to write a script transform on your table data binding to use

1 Like

Really ? Huh...

Try this: Move your current binding to a custom property.
Then put a structure binding on your table's prop.data. Bind it to the locale and to the custom property holding the data.
Then add a transform that should look like this:

return [
	dict(
		row,
		dtreason = system.util.translate(row['dtreason'], value.locale, [strict]),
		comment = system.util.translate(row['comment'], value.locale, [strict])
	) for row in value.data
]

note that [strict] should be a boolean. It determines the behavior when the value is not found in the translation dictionary:
False (default) will make the function return the original term, True will make it return None. Take your pick.

1 Like