diff options
author | EuAndreh <eu@euandre.org> | 2022-01-28 07:33:30 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-01-01 12:35:01 -0300 |
commit | 9f554a72b01705ebf6be66143c5e69b09b3c1372 (patch) | |
tree | fadf04038b2d5df32fd4b5bc93ba291269c322a0 /src/i18n.c | |
download | pindaiba-9f554a72b01705ebf6be66143c5e69b09b3c1372.tar.gz pindaiba-9f554a72b01705ebf6be66143c5e69b09b3c1372.tar.xz |
Init project: copy files and skeletons from others
Diffstat (limited to 'src/i18n.c')
-rw-r--r-- | src/i18n.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/i18n.c b/src/i18n.c new file mode 100644 index 0000000..60d900a --- /dev/null +++ b/src/i18n.c @@ -0,0 +1,74 @@ +#include "config.h" + +#include <stdio.h> + +#include "i18n.h" + +#ifdef TEST +#include <stdlib.h> + +#include "logerr.h" +#include "catalog.h" +#endif + +const char *const +MSGS[] = { + "", + [MSG_USAGE_FIRST]="Usage:\n", + [MSG_USAGE_1]=" " NAME " -p FILE [-o DIRECTORY]\n", + [MSG_USAGE_2]=" " NAME " -l FILE [-o DIRECTORY]\n", + [MSG_USAGE_LAST]=" " NAME " [-hV]\n", + [MSG_HELP_FIRST]="\n", + [MSG_HELP_1]="\n", + [MSG_HELP_2]="Options:\n", + [MSG_HELP_3]=" -p FILE parser file to be processed\n", + [MSG_HELP_4]=" -l FILE lexer file to be processed\n", + [MSG_HELP_5]=" -o DIRECTORY output where to place the\n", + [MSG_HELP_6]=" generated files (default .)\n", + [MSG_HELP_7]=" -h, --help show this help message\n", + [MSG_HELP_8]=" -V, --version print the version number\n", + [MSG_HELP_9]="\n", + [MSG_HELP_10]="\n", + [MSG_HELP_11]="Run the " NAME "(1) parser program.\n", + [MSG_HELP_12]="\n", + [MSG_HELP_13]="Here is the explanation for what it does, and the synopsis\n", + [MSG_HELP_14]="of its usage.\n", + [MSG_HELP_15]="\n", + [MSG_HELP_16]="See \"man " NAME "\" for usage information and\n", + [MSG_HELP_17]="\"man " NAME ".tutorial\" for a beginner introduction.\n", + [MSG_HELP_18]="\n", + [MSG_HELP_19]="\n", + [MSG_HELP_20]="Examples:\n", + [MSG_HELP_21]="\n", + [MSG_HELP_22]=" Do a one-line parser:\n", + [MSG_HELP_23]="\n", + [MSG_HELP_24]=" $ " NAME " run md.grammar < README.md\n", + [MSG_HELP_25]="\n", + [MSG_HELP_26]="\n", + [MSG_HELP_27]=" Compile the grammer:\n", + [MSG_HELP_28]="\n", + [MSG_HELP_LAST]=" $ " NAME " build csv.grammar > dunno.alsodunno\n", + [MSG_VERSION]= NAME " " VERSION " " DATE "\n", + [MSG_ERR_VECTOR_MAX_CAPACITY]= "Already at max capacity (%ld): %s\n", + [MSG_ERR_VECTOR_OUT_OF_BOUNDS]= "idx (%ld) is beyond bounds (%ld)\n", + NULL +}; + + +#ifdef TEST +int +main(void) { + int rc = 0; + + if (getenv("DUMP_TRANSLATABLE_STRINGS")) { + if (dump_translatable_strings(MSGS)) { + logerr("dump_translatable_strings(MSGS)\n"); + rc = -1; + goto out; + } + } + +out: + return !!rc; +} +#endif |