рассылка русскоязычной группы пользователей и разработчиков KDE
 help / color / mirror / Atom feed
From: "Yuri Chornoivan" <yurchor@ukr.net>
To: "KDE russian translation mailing list" <kde-russian@lists.kde.ru>
Subject: Re: [kde-russian] Fwd: c-formatted strings in rkward__analysis.po
Date: Mon, 08 Dec 2014 16:08:28 +0200
Message-ID: <op.xqjywflll2zvei@ip-4ffd.proline.net.ua> (raw)
In-Reply-To: <CAKpAPq9XOduaW1O6PCYkmvviF5xOYskh1DBhX2h1e-gbbA7ybg@mail.gmail.com>

написане Mon, 08 Dec 2014 15:32:35 +0200, Juliette Tux  
<juliette.tux@gmail.com>:

> Это опять мы, пинджаки.
>
> У меня такой случай с "#, c-format" в пошке встретился в lxpanel (
> http://mirror.rosalab.ru/rosa/server/6.6/repository/SRPMS/extra/release/lxpanel-0.6.1-1.res6.src.rpm
> ), причём кое-что из помеченного как c-format интерфейс подхватывает на
> русском, кое-что упорно хочет показывать только на инглише. Пошка вот  
> тут:
> http://pastebin.com/dZwRsyMP
> Можно более подробно на пальцах пояснить, что куда вставлять, чтобы
> правильно собрать?

Насколько я могу судить, в оригинальном архиве с форматированием PO всё в  
порядке.

Вкратце, идея такова:

1. В коде на C/C++/JS есть какое-нибудь сообщение с символом «%».  
Например, «95% corresponds to a 5% level of significance".

2. Внутренний обработчик xgettext считает, что «%» — начало форматирования  
(«%с»). Поэтому на все переводы, не содержащие «%с» ругается как на  
неправильные. В тексте PO такие сообщения отмечаются комментарием «#,  
c-format».

3. Вставляем в код непосредственно перед строчкой с сообщением комментарий  
для xgettext: «//xgettext:no-c-format». Всё приходит в норму. Теперь в  
тексте PO такие сообщение отмечено комментарием «#, no-c-format». Можно  
переводить.

Я не вижу, где могут быть проблемы в lxpanel.pot. Если переводы не  
загружаются, то причина в чём-то другом. Например, где-то не хватает  
#include <gi18n.h>

С уважением,
Юрий

> ---------- Forwarded message ----------
> From: Yuri Chornoivan <yurchor@ukr.net>
> Date: 5 December 2014 at 08:26
> Subject: Re: c-formatted strings in rkward__analysis.po
> To: "kde-i18n-doc@kde.org" <kde-i18n-doc@kde.org>
>
>
> написане Thu, 04 Dec 2014 22:38:48 +0200, Thomas Friedrichsmeier <
> thomas.friedrichsmeier@ruhr-uni-bochum.de>:
>
>
>  Hi,
>>
>> On Thursday 04 December 2014 21:39:14 Yuri Chornoivan wrote:
>>
>>> Due to some subtle peculiarities of xgettext processing some extracted
>>> strings (those with '%') are now wrongly c-formatted which prevents  
>>> them
>>>  from to be translated well.
>>>
>>
>> I see.
>>
>>  It is usually enough to add "xgettext:no-c-format" for such messages  
>> to be
>>> processed right, but it is evidently not the case this time (tested).
>>>
>>
>> I guess that's because the extraction script just strips all comments  
>> that
>> don't start with i18n: or translators:.
>>
>>  Is there any way to post-process the file to replace #, c-format with  
>> #,
>>> no-c-format ?
>>>
>>
>> I've tried smartening up the extraction script to insert /*  
>> xgettext:no-c-
>> format */ in front of the calls in question (after all comment  
>> stripping).
>> This seems to produce the desired result. Please test.
>>
>> Thanks!
>> Thomas
>>
>
> Now it works as expected. Many thanks for your work.
>
> Best regards,
> Yuri
>
>

           reply	other threads:[~2014-12-08 14:08 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAKpAPq9XOduaW1O6PCYkmvviF5xOYskh1DBhX2h1e-gbbA7ybg@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.xqjywflll2zvei@ip-4ffd.proline.net.ua \
    --to=yurchor@ukr.net \
    --cc=kde-russian@lists.kde.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

рассылка русскоязычной группы пользователей и разработчиков KDE

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/kde-russian/0 kde-russian/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kde-russian kde-russian/ http://lore.altlinux.org/kde-russian \
		kde-russian@lists.kde.ru
	public-inbox-index kde-russian

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.kde-russian


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git