[Qt-qml] Writing i18n applications
warwick.allison at nokia.com
warwick.allison at nokia.com
Mon Aug 2 01:40:15 CEST 2010
> The QML translation documentation clearly documents raw string
> translation:
>
> http://doc.qt.nokia.com/4.7-snapshot/qdeclarativei18n.html
>
> and the i18n example demonstrates equally clearly. Having looked at the
> qmlviewer source, I have seen that the standard QTranslator mechanism
> is still used, and hence for the most part the Meego infrastructure built on
> this should function as intended.
Yes, it works the same as C++ Qt for plain tr() (qsTr() in JavaScript). It is possible to make a plugin to provide access to qtTrId(), but it is not supported in QtScript yet, as per:
http://bugreports.qt.nokia.com/browse/QTBUG-11833 and linked issues.
> I am currently imagining that we would recommend one QML implementation
> per language family within the context of a common pool of translated
> strings.
> ...
> Is this the intended approach to i18n in QML?
Yes.
> Are there going to be any (further) convenience
> structures for (QML) code reuse in the context of multiple (per
> language family) QML interface implementations.
The only specifically planned feature is per-module translations (rather than just per-application): http://bugreports.qt.nokia.com/browse/QTBUG-11793
It is an on-going research question as to whether any particular RTL support is required (rather than using the approach you mention above, which is more flexible). The general QML philosophy is not to make generic one-size-fits-all user interfaces - not for screen-resolutions and so not for languages.
--
Warwick
More information about the Qt-qml
mailing list