From: php-coder <php-coder@ngs.ru>
To: devel@lists.altlinux.org
Subject: [devel] Как правильно оформлять исходники для использования gettext ?
Date: Mon, 27 Feb 2006 01:11:02 +0600
Message-ID: <20060226191102.GA14157@rock.home> (raw)
Доброго времени суток, разработчики! :)
В программе будет использоваться интернационализация при помощи
gettext. В файлах уже где нужно используются соответствующие макросы.
Но вот проблема. Как минимум, во всех файлах в которых используется
ф-ция gettext должны быть следующие строчки:
#ifdef NLS
#include <libintl.h>
#define _(str) gettext(str)
#else
#define _(str) str
#endif // NLS
И сейчас про попытке компиляции разумеется выдаётся ошибка, к прмиеру,
такая:
Color.cc:167: error: `_' undeclared (first use this function)
Color.cc:167: error: (Each undeclared identifier is reported only once
for each function it appears in.)
Внимание, вопрос! (с)
Как лучше это решить? Собственно это и не вопрос даже, просто хочу
посоветоваться, может есть какие-то готовые решения, придуманные и
используемые ещё до меня?
Сейчас я собираюсь вынести все эти 6 строчек в отдельный хедер
(скажем, gettext.h -- нормально если я его так назову?) и потом
подключить его во все файлы. Это правильный вариант ? :)
--
+ Semushin Slava | php-coder @ ngs.ru
+ ALT Linux Team | php-coder @ altlinux.ru
next reply other threads:[~2006-02-26 19:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-26 19:11 php-coder [this message]
2006-02-26 19:27 ` Sergey Pinaev
2006-02-26 19:36 ` php-coder
2006-02-26 22:08 ` Dmitry V. Levin
2006-02-27 7:19 ` Sergey Pinaev
2006-02-27 9:20 ` Vitaly Ostanin
2006-02-27 12:14 ` Semushin Slava
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=20060226191102.GA14157@rock.home \
--to=php-coder@ngs.ru \
--cc=devel@lists.altlinux.org \
/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
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/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 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git