Development/Tutorials/Localization/Message Appearance: Difference between revisions

From KDE TechBase
No edit summary
No edit summary
Line 30: Line 30:
</syntaxhighlight>
</syntaxhighlight>


(Perhaps use a screenshot of Lokalize here?)
(Perhaps have a screenshot of Lokalize here?)


== Messages in UI files ==
== Messages in UI files ==
Line 40: Line 40:
If the message appears in many places, the context information from all the places is shown.
If the message appears in many places, the context information from all the places is shown.


For example:
Examples:


(Mention that not all translators know how to infer context from class names of widgets.)
<syntaxhighlight lang="gettext">
#. i18n: ectx: property (displayFormat), widget (QDateEdit, dateEdit)
#. +> trunk stable
#: mainwindowview.ui:137
msgid "d/M/yyyy"
msgstr ""
 
#. i18n: ectx: property (toolTip), widget (KComboBox, maintypeBox)
#. i18n: ectx: property (whatsThis), widget (KComboBox, maintypeBox)
#. +> trunk stable
#: mainwindowview.ui:154 mainwindowview.ui:157
msgid "The main game of the theme"
msgstr ""
 
#. i18n: ectx: property (title), widget (QGroupBox, groupBox_2)
#. +> trunk stable
#: conf/dlgeditorbase.ui:19 conf/preferencesdialog.cpp:56
msgid "Editor"
msgstr ""
</syntaxhighlight>
 
(Perhaps have some screenshots of Lokalize here?)
 
For example from "property (displayFormat), widget (QDateEdit, dateEdit)" it could be inferred that the translatin should use the specific format that QDate's toString() accepts. Some translators cannot infer this, though, so it is good to additionally use "(qtdt-format)" as context as said on page [[Development/Tutorials/Localization/i18n]].


== Messages in .kcfg files ==
== Messages in .kcfg files ==


(TODO)
(TODO)

Revision as of 19:35, 16 July 2013

What Translators See

This page is a short summary that tries to show how translators see the translatable messages. The information that translators see about a given message also depends on where the message comes from.

(The idea is that I'll move this page to somewhere once it's at least somewhat useful.)

Messages coming from i18n() and friends

For these messages translators will only see the following:

  • the source string (and plural form if i18np is used)
  • the context parameter if i18nc is used
  • the code comment beginning with "i18n:" if used
  • list of file names and row numbers the messages appears in

For example this message:

QString msg = i18nc("%1 and %2 are file names", "Do you want to replace %1 with %2?",
                   oldFile, newFile)

Appears like this:

#: example.cpp:57
#, kde-format
msgctxt "%1 and %2 are file names"
msgid "Do you want to replace file %1 with file %2?"
msgstr ""

(Perhaps have a screenshot of Lokalize here?)

Messages in UI files

For these messages translators will see everything that they see for messages coming from i18n() and friends. They will additionally see the following:

  • the type and name of the widget the message it appears in
  • the name of the property the message is a value for

If the message appears in many places, the context information from all the places is shown.

Examples:

#. i18n: ectx: property (displayFormat), widget (QDateEdit, dateEdit)
#. +> trunk stable
#: mainwindowview.ui:137
msgid "d/M/yyyy"
msgstr ""

#. i18n: ectx: property (toolTip), widget (KComboBox, maintypeBox)
#. i18n: ectx: property (whatsThis), widget (KComboBox, maintypeBox)
#. +> trunk stable
#: mainwindowview.ui:154 mainwindowview.ui:157
msgid "The main game of the theme"
msgstr ""

#. i18n: ectx: property (title), widget (QGroupBox, groupBox_2)
#. +> trunk stable
#: conf/dlgeditorbase.ui:19 conf/preferencesdialog.cpp:56
msgid "Editor"
msgstr ""

(Perhaps have some screenshots of Lokalize here?)

For example from "property (displayFormat), widget (QDateEdit, dateEdit)" it could be inferred that the translatin should use the specific format that QDate's toString() accepts. Some translators cannot infer this, though, so it is good to additionally use "(qtdt-format)" as context as said on page Development/Tutorials/Localization/i18n.

Messages in .kcfg files

(TODO)