рассылка русскоязычной группы пользователей и разработчиков KDE
 help / color / mirror / Atom feed
* Re: [kde-russian] Fwd: c-formatted strings in rkward__analysis.po
  @ 2014-12-08 14:08       ` Yuri Chornoivan
  0 siblings, 0 replies; only message in thread
From: Yuri Chornoivan @ 2014-12-08 14:08 UTC (permalink / raw)
  To: KDE russian translation mailing list

написане 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
>
>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-08 14:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 14:08       ` [kde-russian] Fwd: c-formatted strings in rkward__analysis.po Yuri Chornoivan

рассылка русскоязычной группы пользователей и разработчиков 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