diff options
-rw-r--r-- | src/examples/Makefile.am | 8 | ||||
-rwxr-xr-x | src/examples/msgs_i18n.c | 17 |
2 files changed, 4 insertions, 21 deletions
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am index 0e211678..ba8e4307 100644 --- a/src/examples/Makefile.am +++ b/src/examples/Makefile.am | |||
@@ -25,12 +25,13 @@ noinst_PROGRAMS = \ | |||
25 | minimal_example_comet \ | 25 | minimal_example_comet \ |
26 | querystring_example \ | 26 | querystring_example \ |
27 | timeout \ | 27 | timeout \ |
28 | msgs_i18n \ | ||
29 | fileserver_example \ | 28 | fileserver_example \ |
30 | fileserver_example_dirs \ | 29 | fileserver_example_dirs \ |
31 | fileserver_example_external_select \ | 30 | fileserver_example_external_select \ |
32 | refuse_post_example | 31 | refuse_post_example |
33 | 32 | ||
33 | EXTRA_DIST = msgs_i18n.c | ||
34 | noinst_EXTRA_DIST = msgs_i18n.c | ||
34 | 35 | ||
35 | if ENABLE_HTTPS | 36 | if ENABLE_HTTPS |
36 | noinst_PROGRAMS += https_fileserver_example | 37 | noinst_PROGRAMS += https_fileserver_example |
@@ -74,11 +75,6 @@ timeout_SOURCES = \ | |||
74 | timeout_LDADD = \ | 75 | timeout_LDADD = \ |
75 | $(top_builddir)/src/microhttpd/libmicrohttpd.la | 76 | $(top_builddir)/src/microhttpd/libmicrohttpd.la |
76 | 77 | ||
77 | msgs_i18n_SOURCEs = \ | ||
78 | msgs_i18n.c | ||
79 | msgs_i18n_LDADD = \ | ||
80 | $(top_builddir)/src/microhttpd/libmicrohttpd.la | ||
81 | |||
82 | chunked_example_SOURCES = \ | 78 | chunked_example_SOURCES = \ |
83 | chunked_example.c | 79 | chunked_example.c |
84 | chunked_example_LDADD = \ | 80 | chunked_example_LDADD = \ |
diff --git a/src/examples/msgs_i18n.c b/src/examples/msgs_i18n.c index ed23d982..398a86da 100755 --- a/src/examples/msgs_i18n.c +++ b/src/examples/msgs_i18n.c | |||
@@ -23,27 +23,14 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * suposing you are in the libmicrohttp root directory and the LANG is `pt_BR`: * | 26 | * suposing you are in Brazil: |
27 | * | 27 | * |
28 | * # generate the POT file | ||
29 | * $ xgettext --keyword=_ --language=C --add-comments --sort-output -o libmicrohttpd.pot src/microhttpd/*.c | ||
30 | * | ||
31 | * # generate the PO file | ||
32 | * $ msginit --input=libmicrohttpd.pot --locale=pt_BR --output=libmicrohttpd.po | ||
33 | * | ||
34 | * # open the generated .po in any program like Poedit and translate the MHD messages; once done, let's go to the test: | ||
35 | * mkdir -p src/examples/locale/pt_BR/LC_MESSAGES | ||
36 | * mv libmicrohttpd.mo libmicrohttpd.po src/examples/locale/pt_BR/LC_MESSAGES | ||
37 | * cd src/examples/ | ||
38 | * gcc -o msgs_i18n msgs_i18n.c -lmicrohttpd | ||
39 | * export LANGUAGE=pt_BR | 28 | * export LANGUAGE=pt_BR |
40 | * ./msgs_i18n | 29 | * ./msgs_i18n |
41 | * # it may print: Opção inválida 4196490! (Você terminou a lista com MHD_OPTION_END?) | 30 | * # it may print: Opção inválida 4196490! (Você terminou a lista com MHD_OPTION_END?) |
42 | * | 31 | * |
43 | * # tip: if you get any problem in your i18n application, you can debug it using `strace` tool, e.g: | 32 | * # tip: if you get any problem in your i18n application, you can debug it using `strace` tool, e.g: |
44 | * $ strace -e trace=open ./msgs_i18n | 33 | * $ strace -e trace=open ./msgs_i18n |
45 | * | ||
46 | * That's all! | ||
47 | * | 34 | * |
48 | */ | 35 | */ |
49 | 36 | ||
@@ -86,6 +73,6 @@ main() { | |||
86 | NULL, NULL, | 73 | NULL, NULL, |
87 | &ahc_echo, NULL, | 74 | &ahc_echo, NULL, |
88 | MHD_OPTION_EXTERNAL_LOGGER, &error_handler, NULL | 75 | MHD_OPTION_EXTERNAL_LOGGER, &error_handler, NULL |
89 | /* MHD_OPTION_END - to raise the error "Invalid option ..." we are going to translate */); | 76 | /* MHD_OPTION_END - to raise the error "Invalid option ..." we are going to translate */); |
90 | return 1; /* purposely */ | 77 | return 1; /* purposely */ |
91 | } | 78 | } |