How to translate the string has context prefix?

Dancefire dancefire at gmail.com
Tue Apr 27 23:35:10 EDT 2010


After more check on ":" in translation string, I found more string
components, which should not be translated and without any comment for
translators.

src/register/ledger-core/split-register-layout.c: 522
----
    gnc_register_add_cell (layout,
                           DATE_CELL,
                           DATE_CELL_TYPE_NAME,
                           N_("sample:12/12/2000") + 7,
                           CELL_ALIGN_RIGHT,
                           FALSE,
                           FALSE);

    gnc_register_add_cell (layout,
                           DDUE_CELL,
                           DATE_CELL_TYPE_NAME,
                           N_("sample:12/12/2000") + 7,
                           CELL_ALIGN_RIGHT,
                           FALSE,
                           FALSE);
...
---------
More than 20 strings there contains "sample:" which should not be translated.

I feel uncomfortable with the untranslatable prefix, some are used as
comments, some are used to estimate widths in this case.

Is that possible to remove all these prefix from .pot file? So that
translators would not so easyly falling into the trap.


On Wed, Apr 28, 2010 at 1:17 PM, Dancefire <dancefire at gmail.com> wrote:
> On Tue, Apr 27, 2010 at 11:28 AM, Derek Atkins <warlord at mit.edu> wrote:
>> Cristian Marchi <cri79 at libero.it> writes:
>>
>>> The part before the "|" is just a description so you should only
>>> translate what is after that symbol (specifically the term "Deposit")
>>> The correct syntax for your case would be:
>>>
>>> msgid "Action Column|Deposit"
>>> msgstr "存款"
>>>
>>> Note that in the translation you are not supposed to include the "|" symbol.
>>
>> Oh, for some reason I thought the translation should have been
>>
>> msgid "Action Column|Deposit"
>> msgstr "Action Column|存款"
>>
>> I guess I was incorrect.  I thought there were some translations where
>> you specifically needed to keep the early part of the string.  But
>> perhaps that's more likely in the cases of something like:
>>
>> msgid "reconciled:y"
>>
>
> For the message you mentioned, "reconciled:y", I double checked the
> string and there is no any comment for translator, but I went further
> and checked the source and I found the comments for translators are
> put in wrong place.
> ----------
>    switch (reconciled_flag)
>    {
>        /* Translators: For the following strings, the single letters
>           after the colon are abbreviations of the word before the
>           colon. You should only translate the letter *after* the colon. */
>    case NREC:
>        return string_after_colon(_("not cleared:n"));
>        /* Translators: Please only translate the letter *after* the colon. */
>    case CREC:
>        return string_after_colon(_("cleared:c"));
>        /* Translators: Please only translate the letter *after* the colon. */
>    case YREC:
>        return string_after_colon(_("reconciled:y"));
>        /* Translators: Please only translate the letter *after* the colon. */
>    case FREC:
>        return string_after_colon(_("frozen:f"));
>        /* Translators: Please only translate the letter *after* the colon. */
>    case VREC:
>        return string_after_colon(_("void:v"));
>    default:
>        PERR("Bad reconciled flag\n");
>        return NULL;
>    }
> -----------
>
> And for this case, what is the rule for translation of the letter,
> such as 'y' after ":"? Does it have to be a single ASCII letter? or a
> single Unicode character? or, I can use more than one character to
> represent it?
>
>>> Regards
>>> Cristian
>>
>> -derek
>> --
>>       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>>       Member, MIT Student Information Processing Board  (SIPB)
>>       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>>       warlord at MIT.EDU                        PGP key available
>>
>
>
>
> --
> Regards
>
> Tao Wang
>



-- 
Regards

Tao Wang


More information about the gnucash-devel mailing list