[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    delay i18n arg replacement
From:       Milian Wolff <mail () milianw ! de>
Date:       2015-01-19 11:55:21
Message-ID: 2535200.yazp5KOJ9c () milian-kdab2
[Download RAW message or body]

Hello all,

I'm trying to solve a string puzzle in KDevelop, where we currently do 
something like this:

QStringLiteral( "%1 %2 (%3)")
  .arg(asdf.translatedString)
  .arg(foo)
  .arg(bar)

translatedString is a member in a list of static data structures which gets 
initialized with i18n. I tried to move the %2 (%3) in there, but then the %1 
(%2) gets replaced with I18N_ARGUMENT_MISSING. So, how do I delay the argument 
resolution such that I can do

asdf.translatedString
  .arg(foo)
  .arg(bar)

or similar? Do I really need to store I18N_NOOP2_NOSTRIP and use that with

i18nc(asdf.context, asdf.translatedString, foo, bar)

then? Or is there a better way, where it would be enough to store a QString in 
my static data structure? Or is this not possible b/c the translation might be 
scripted or something like that?

Bye
-- 
Milian Wolff
mail@milianw.de
http://milianw.de

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic