Jump to content

Translations:Development/FAQs/Technical FAQ/39/ja: Difference between revisions

From KDE TechBase
Phanect (talk | contribs)
Created page with "<code>QString translatedStuff=i18n("foobar");</code> を使った場合、translatedStuff は "foobar" の翻訳結果が含まれます。一方、 <code>const char *markedStuff..."
 
(No difference)

Latest revision as of 08:19, 6 February 2012

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Development/FAQs/Technical FAQ)
If you do
<code>QString translatedStuff = i18n("foobar");</code> translatedStuff will contain the translation of "foobar", while for <code> const char *markedStuff = I18N_NOOP("foobar");</code> <tt>markedStuff</tt> will still contain literal "foobar", but translators will know you want "foobar" translated so you can later on do <code>QString translatedStuff = i18n(markedStuff);</code> and get the translation of "foobar", which wouldn't work without that I18N_NOOP. 
So, normally you want to just use i18n(), but in cases where you absolutely need to pass something untranslated, but still need to translate it later or in the case that you have something to be translated before the KInstance exists, use <code>I18N_NOOP()</code>.

QString translatedStuff=i18n("foobar"); を使った場合、translatedStuff は "foobar" の翻訳結果が含まれます。一方、 const char *markedStuff = I18N_NOOP("foobar"); を使った場合、marketStuff はまだ、リテラル "foobar" を含んでいます。しかし、翻訳者はそのが翻訳されてほしいことを分っているので、後に QString translatedStuff=i18n(markedStuff); を実行すると、"foobar" の翻訳結果が得られます。これは I18N_NOOP なしではうまくいきません。 そのため、普通は i18n を使ってください。しかし、絶対に翻訳をさせずに後で翻訳したい場合や、KInstance が存在する前に翻訳したいものを持っておきたい場合は、I18N_NOOP() を使って下さい。