[Qt-creator] Untranslatable strings

Diego Schulz dschulz at gmail.com
Tue Jun 2 17:38:20 CEST 2009


On Tue, Jun 2, 2009 at 11:20 AM, Alexandre Bique
<bique.alexandre at gmail.com> wrote:
> On Tue, Jun 2, 2009 at 3:26 PM, Diego Schulz <dschulz at gmail.com> wrote:
>> Hi all,
>>
>> I recently found this in ./src/plugins/coreplugin/versiondialog.cpp:
>>
>>
>>  const QString description = tr(
>>        "<h3>Qt Creator %1</h3>"
>>        "Based on Qt %2<br/>"
>>        "<br/>"
>>        "Built on " __DATE__ " at " __TIME__ "<br />"
>> #ifdef IDE_REVISION
>>        "From revision %5<br/>"
>> #endif
>>        "<br/>"
>>        "<br/>"
>>        "Copyright 2008-%3 %4. All rights reserved.<br/>"
>>        "<br/>"
>>        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
>>        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
>>        "PARTICULAR PURPOSE.<br/>")
>>        .arg(version, QLatin1String(QT_VERSION_STR),
>> QLatin1String(IDE_YEAR), (QLatin1String(IDE_AUTHOR))
>> #ifdef IDE_REVISION
>>             , QString(IDE_REVISION_STR).left(10)
>> #endif
>>             );
>>
>>
>> Just want to point out that this appears not to be fully
>> translatable.. Does Linguist and the other Qt translation tools can
>> manage to work with macros?
>>
>> Please let me know if I'm wrong.
>
> It is possible to transform it to a printf like string:
>
> QString("....... %1 ............").arg(__DATE__);

yes, but there's only one QString and more important, only one tr() call.

 const QString description = tr(  .....

and there are some #ifdefs ... I suspect this is wrong, in fact
Linguist (Qt 4.5.0) doesn't recognize the full string.
I think it could be solved by splitting in multiple QStrings
(translated independently) and then joined together after the tr()
calls.




More information about the Qt-creator-old mailing list