[Interest] Translating to chinese

Jason H jhihn at gmx.com
Tue Jun 7 23:43:11 CEST 2016


I'm trying to translate a date, while respecting the locale, but I'm  having some issues. This is all in QML
"June 8, 2016" // en desired output (locale date without dow)
"2016年6月7日" // zh ideal desired output (locale date without dow)
"7.6.2016" // zh acceptable output (dd.mm.yyyy without dow)

Since I cannot figure out how to get the date without dow, I'm resorting to the following:
I'm use qsTr().arg():
qsTr("%1 %2, %3", "jan 23 2015").arg(qsTr(month)).arg(date.getDate()).arg(date.getFullYear()) +langMgr.null;

The chinese translation is "%2.%1.%3", so it should be the same as:
qsTr("%2.%1.%3", "jan 23 2015").arg(qsTr(month)).arg(date.getDate()).arg(date.getFullYear()) +langMgr.null;

It works only for the first parameter, I get:
%2.6 月 .%3
And then I get:
QString::arg: Argument missing: %2.6 月 .%3, 7
QString::arg: Argument missing: %2.6 月 .%3, 2016

What am I doing wrong?



More information about the Interest mailing list