рассылка русскоязычной группы пользователей и разработчиков KDE
 help / color / mirror / Atom feed
* Re: [kde-russian] Скрипт Messages
  @ 2015-12-02 15:20 ` Alexander Potashev
  0 siblings, 0 replies; only message in thread
From: Alexander Potashev @ 2015-12-02 15:20 UTC (permalink / raw)
  To: KDE russian translation mailing list

2015-12-02 15:56 GMT+03:00 Виктор <victorr2007@ya.ru>:
> Добрый день.
> Несколько лет назад нашёл скрипт,
> где-то здесь https://techbase.kde.org/Translate_a_Page/ru
> Примерный текст приложу ниже.
> Очень выручает, но для kde5 он не может корректно работать с файлами .ui
> Пропускает много строк.
> Может есть новые скрипты, или подскажите, что можно поменять в этом скрипте.
>
>
> #!/bin/bash
> BASEDIR="../krusader/"    # root of translatable sources
> PROJECT="krusader"    # project name
> # BUGADDR="http://sourceforge.net/tracker/?group_id=50231&atid=459007"    #
> MSGID-Bugs
> WDIR=`pwd`        # working dir
>
>
> echo "Preparing rc files"
> cd ${BASEDIR}
> # we use simple sorting to make sure the lines do not jump around too much
> from system to system
> find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort >
> ${WDIR}/rcfiles.list
> xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
> # additional string for KAboutData
> echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
> echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
> cd ${WDIR}
> echo "Done preparing rc files"
>
>
> echo "Extracting messages"
> cd ${BASEDIR}
> # see above on sorting
> find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort >
> ${WDIR}/infiles.list
> echo "rc.cpp" >> ${WDIR}/infiles.list
> cd ${WDIR}
> xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2
> -ki18ncp:1c,2,3 -ktr2i18n:1 \
>     -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2
> -kki18np:1,2 -kki18ncp:1c,2,3 \
>     --msgid-bugs-address="${BUGADDR}" \
>     --files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot ||
> { echo "error while calling xgettext. aborting."; exit 1; }
> echo "Done extracting messages"
>
>
> echo "Merging translations"
> catalogs=`find . -name '*.po'`
> for cat in $catalogs; do
>   echo $cat
>   msgmerge -o $cat.new $cat ${PROJECT}.pot
>   mv $cat.new $cat
> done
> echo "Done merging translations"
>
>
> echo "Cleaning up"
> cd ${WDIR}
> rm rcfiles.list
> rm infiles.list
> rm rc.cpp
> echo "Done"

Привет, Виктор,

В чём состоит задача, которую ты пытаешься решить этим скриптом?

Если нужно сгенерировать шаблон krusader.pot, простая инструкция есть
здесь [1]. Вероятно, для версии на KF5 нужно вместо
l10n-kde4/scripts/extract-messages.sh запускать
l10n-kf5/scripts/extract-messages.sh.

[1] http://tsdgeos.blogspot.ru/2010/08/how-to-run-messagessh-file-to-create.html

-- 
Alexander Potashev

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

only message in thread, other threads:[~2015-12-02 15:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-02 15:20 ` [kde-russian] Скрипт Messages Alexander Potashev

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