commit bf56a65a0cda87d8edc8e8926c8ee5e49b0121df
parent 347cbe5f10709c146cc6fce06acb082de01f2995
Author: silvioprog <silvioprog@gmail.com>
Date: Tue, 28 Feb 2017 22:36:40 -0300
i18n example has been failed in some SOs, then we decided to make it as an extra dist
Diffstat:
2 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
@@ -25,12 +25,13 @@ noinst_PROGRAMS = \
minimal_example_comet \
querystring_example \
timeout \
- msgs_i18n \
fileserver_example \
fileserver_example_dirs \
fileserver_example_external_select \
refuse_post_example
+EXTRA_DIST = msgs_i18n.c
+noinst_EXTRA_DIST = msgs_i18n.c
if ENABLE_HTTPS
noinst_PROGRAMS += https_fileserver_example
@@ -74,11 +75,6 @@ timeout_SOURCES = \
timeout_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la
-msgs_i18n_SOURCEs = \
- msgs_i18n.c
-msgs_i18n_LDADD = \
- $(top_builddir)/src/microhttpd/libmicrohttpd.la
-
chunked_example_SOURCES = \
chunked_example.c
chunked_example_LDADD = \
diff --git a/src/examples/msgs_i18n.c b/src/examples/msgs_i18n.c
@@ -23,27 +23,14 @@
*/
/*
- * suposing you are in the libmicrohttp root directory and the LANG is `pt_BR`: *
+ * suposing you are in Brazil:
*
- * # generate the POT file
- * $ xgettext --keyword=_ --language=C --add-comments --sort-output -o libmicrohttpd.pot src/microhttpd/*.c
- *
- * # generate the PO file
- * $ msginit --input=libmicrohttpd.pot --locale=pt_BR --output=libmicrohttpd.po
- *
- * # open the generated .po in any program like Poedit and translate the MHD messages; once done, let's go to the test:
- * mkdir -p src/examples/locale/pt_BR/LC_MESSAGES
- * mv libmicrohttpd.mo libmicrohttpd.po src/examples/locale/pt_BR/LC_MESSAGES
- * cd src/examples/
- * gcc -o msgs_i18n msgs_i18n.c -lmicrohttpd
* export LANGUAGE=pt_BR
* ./msgs_i18n
* # it may print: Opção inválida 4196490! (Você terminou a lista com MHD_OPTION_END?)
*
* # tip: if you get any problem in your i18n application, you can debug it using `strace` tool, e.g:
* $ strace -e trace=open ./msgs_i18n
- *
- * That's all!
*
*/
@@ -86,6 +73,6 @@ main() {
NULL, NULL,
&ahc_echo, NULL,
MHD_OPTION_EXTERNAL_LOGGER, &error_handler, NULL
- /* MHD_OPTION_END - to raise the error "Invalid option ..." we are going to translate */);
+ /* MHD_OPTION_END - to raise the error "Invalid option ..." we are going to translate */);
return 1; /* purposely */
}