From: Alex P. <ale...@ci...> - 2005-02-18 15:14:46
|
Hi Ben & Yves, The next is normal: ./configure --prefbestaatni=3D/opt/asnmtap/perfparse=20 configure: error: unrecognized option: --prefbestaatni=3D/opt/asnmtap/perfparse Try `./configure --help' for more information. case ${DATA_SOURCE} in nagios) USE_SOURCE_NAGIOS=3Dyes AC_DEFINE_UNQUOTED([USE_SOURCE_NAGIOS],1, [Data Source is Nagios]) AC_MSG_RESULT([Nagios]) ;; asnmtap) USE_SOURCE_ASNMTAP=3Dyes AC_DEFINE_UNQUOTED([USE_SOURCE_ASNMTAP],1, [Data Source is ASNMTAP]) AC_MSG_RESULT([ASNMTAP]) ;; *) AC_MSG_ERROR([${DATA_SOURCE} is not supported (yet?)]) ;; esac No error when: ./configure --with-data-source=3DbestaatNiet Data Source is: nagios|asnmtap Not displayed when: ./configure --with-data-source=3Dasnmtap and config.h is wrong: config.h /* Data Source is ASNMTAP */ /* #undef USE_SOURCE_ASNMTAP */ /* Data Source is Nagios */ /* define USE_SOURCE_NAGIOS 1 */ into: Configuration options: Prefix: /opt/asnmtap/perfparse Perfparse: Selected DB tools: Selected CGI: Selected HTTP path for images: /asnmtap/img Installation path for images: /opt/asnmtap/htmlroot/img/ Installation path for CGIs: /opt/asnmtap/htmlroot/cgi-bin Using glib2.0: 2.2.3 Database support: mysql With: #ifdef USE_SOURCE_NAGIOS #define KEYWORD_APPLICATION N_("Nagios") #define KEYWORD_HOST N_("Host") #define KEYWORD_SERVICE N_("Title") #elseif USE_SOURCE_ASNMTAP #define KEYWORD_APPLICATION N_("ASNMTAP") #define KEYWORD_HOST N_("Plugin") #define KEYWORD_SERVICE N_("Unique Key") #endif i gets: In file included from config_file.c:41: libpp_common.h:41:2: invalid preprocessing directive #elseif libpp_common.h:42:1: warning: "KEYWORD_APPLICATION" redefined libpp_common.h:38:1: warning: this is the location of the previous definition libpp_common.h:43:1: warning: "KEYWORD_HOST" redefined libpp_common.h:39:1: warning: this is the location of the previous definition libpp_common.h:44:1: warning: "KEYWORD_SERVICE" redefined libpp_common.h:40:1: warning: this is the location of the previous definition make[2]: *** [libpp_common_la-config_file.lo] Fout 1 make[2]: Weggaan uit map = `/export/perfparse-0.105.6-asnmtap/libpp_common' make[1]: *** [all-recursive] Fout 1 make[1]: Weggaan uit map `/export/perfparse-0.105.6-asnmtap' I think that there is a difference between the version 0.150.6 from = today onto the website, and the one from yesterday? With the version from yesterday this part did work. With: #define KEYWORD_APPLICATION N_("Nagios") #define KEYWORD_HOST N_("Host") #define KEYWORD_SERVICE N_("Title") it works Problems with: #ifdef USE_SOURCE_NAGIOS printf("%s\n", _("Please select the Host from list:"));=20 #elseif USE_SOURCE_ASNMTAP printf("%s\n", _("Please select the Plugin from list:"));=20 #endif i get: perfgraph.c:891:2: invalid preprocessing directive #elseif make[2]: *** [perfparse_cgi-perfgraph.o] Fout 1 make[2]: Weggaan uit map `/export/perfparse-0.105.6-asnmtap/cgi' make[1]: *** [all-recursive] Fout 1 make[1]: Weggaan uit map `/export/perfparse-0.105.6-asnmtap' Mab this: Copyright =A9 2004. Program Version 0.105.6. Schema Version 0.19. Be changed to: Copyright =A9 2004-2005. Program Version 0.105.6. Schema Version 0.19. -- Alex -----Original Message----- From: Yves [mailto:yme...@pe...]=20 Sent: donderdag 17 februari 2005 9:33 To: ale...@ci... Cc: per...@li... Subject: RE: [Perfparse-devel-int] Re: [Perfparse-users] RE: Perfparse = error for version 0.105.5 >>> ii) This does not break the current translation. I note we have >>> several German / French users. I don't want to loose them >>> if possible :) Ben, if things are done correctly, there is no problem for translations. Alex's issue is about keywords, not translations. 2 distinct keywords make 2 strings to translate :) > How are this translation done for the language, hardcoded? Alex, when you write one of _("string to translate") N_("string to translate") gettext tools can find the string "string to translate" and put it in po/perfparse.pot. Then, translators copy that file (if not done already) with the name = fr.po (for french) or de.po (for german) or whatever the language is. Then they edit it, = and the previous becomes (for french) : msgid "string to translate" msgstr "cha=EEne =E0 traduire" Gettext tools compute those .po files and generate .gmo files, that are renamed at installation time. Check /usr/share/locale/... or something similar. Translation is done at runtime. Change your $LANG environment variable = and the program will talk another language. > #ifdef USE_LANGUAGE_ENGLISH > #define TXT_001 N_("Please select the Host from list:") > #define TXT_002 N_("...:") > #elseif USE_LANGUAGE_FRENCH > #define TXT_001 N_("Please select the Host from list:") > #define TXT_002 N_("...:") > #elseif USE_LANGUAGE_GERMAN > #define TXT_001 N_("Please select the Host from list:") > #define TXT_002 N_("...:") > #endif Some infos about gettext : in some header file, you should be able to = find this : #define N_(x) (x) #define _(x) gettext(x) char*gettext(const char*msgid) { 1/ get the $LANG variable 2/ read the $LANG.po file (in real, it is not $LANG.po but /usr/share/locale/.../$LANG/.../perfparse.mo) 3/ find msgid in that file 4/ read the msgstr that comes with that msgid return(msgstr); } The only things to remember are : use _(string) to have a translatable string use N_(string) when you define a keyword like #define KEY N_("keyword") = and use _(KEY) then (because N_(string) does nothing). That's all :) More info on http://www.gnu.org/software/gettext/manual/html_chapter/gettext_toc.html --=20 - Homepage - http://ymettier.free.fr - http://www.logicacmg.com - - GPG key - http://ymettier.free.fr/gpg.txt - - Maitretarot - http://www.nongnu.org/maitretarot/ - - Perfparse - http://www.perfparse.org/ - --=20 No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005 =20 --=20 No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005 =20 |