Back to index

glibc  2.9
Classes | Functions | Variables
tst-gettext2.c File Reference
#include <locale.h>
#include <libintl.h>
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Classes

struct  data_t

Functions

int main (void)

Variables

int data_cnt = 2
const int lang_cnt = 3
const char * lang [] = {"lang1", "lang2", "lang3"}

Class Documentation

struct data_t

Definition at line 28 of file tst-gettext2.c.

Class Members
const char * description
const char * selection

Function Documentation

int main ( void  )

Definition at line 45 of file tst-gettext2.c.

{
  int i;

  /* Clean up environment.  */
  unsetenv ("LANGUAGE");
  unsetenv ("LC_ALL");
  unsetenv ("LC_MESSAGES");
  unsetenv ("LC_CTYPE");
  unsetenv ("LANG");
  unsetenv ("OUTPUT_CHARSET");

  textdomain ("tstlang");

  for (i = 0; i < lang_cnt; ++i)
    {
      int j;

      if (setlocale (LC_ALL, lang[i]) == NULL)
       setlocale (LC_ALL, "C");
      bindtextdomain ("tstlang", OBJPFX "domaindir");

      for (j = 0; j < data_cnt; ++j)
       printf ("%s - %s\n", strings[j].selection,
              gettext (strings[j].description));
    }

  return 0;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 34 of file tst-gettext2.c.

const char* lang[] = {"lang1", "lang2", "lang3"}

Definition at line 42 of file tst-gettext2.c.

Definition at line 41 of file tst-gettext2.c.