2000-11-28 14:57:45 +01:00
|
|
|
#include <locale.h>
|
|
|
|
#include <nl_types.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
nl_catd catalog;
|
|
|
|
setlocale (LC_ALL, "");
|
|
|
|
|
|
|
|
printf ("LC_MESSAGES = %s\n", setlocale (LC_MESSAGES, NULL));
|
|
|
|
|
|
|
|
catalog = catopen ("sample", NL_CAT_LOCALE);
|
2001-08-08 23:25:01 +02:00
|
|
|
if (catalog == (nl_catd) -1)
|
|
|
|
{
|
|
|
|
printf ("no catalog: %m\n");
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
2000-11-28 14:57:45 +01:00
|
|
|
printf ("%s\n", catgets(catalog, 1, 1, "sample 1"));
|
|
|
|
printf ("%s\n", catgets(catalog, 1, 2, "sample 2"));
|
|
|
|
printf ("%s\n", catgets(catalog, 1, 3, "sample 3"));
|
|
|
|
printf ("%s\n", catgets(catalog, 1, 4, "sample 4"));
|
|
|
|
printf ("%s\n", catgets(catalog, 1, 5, "sample 5"));
|
2002-06-29 23:08:13 +02:00
|
|
|
printf ("%s\n", catgets(catalog, 1, 6, "sample 6"));
|
|
|
|
printf ("%s\n", catgets(catalog, 1, 7, "sample 7"));
|
2000-11-28 14:57:45 +01:00
|
|
|
catclose (catalog);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|