Пример использования message catalog-a :
/* X/Open XPG4 message catalog test */ #include #include char *MF_EXAMPLE = "example.cat";
main() { nl_catd catd; int error; (void)setlocale(LC_ALL, ""); catd = catopen(MF_EXAMPLE, 0); /* Get the message number 1 from the first set.*/ printf( catgets(catd,1,1,"Hello world\n") ); /* Get the message number 1 from the second set.*/ printf( catgets(catd, 2, 1,"Howdy\n") ); /* Display an error message. No message 4 in set 1.*/ printf( catgets(catd, 1, 4, "example: 100.220 Permission is denied to read the file %s.\n"), MF_EXAMPLE); catclose(catd); } |