doc/help localization changes

- by default, do not build any other locale than C for now
- do not try to build the guides.  These require functioning
  dtinfo/docbook
- add a Linux.lcx locale translation db.  Not used yet.
- fix some overflows in dtdocbook/instant
This commit is contained in:
Jon Trulson
2012-06-18 22:01:02 -06:00
parent 81b0818361
commit fff18bf2b7
10 changed files with 621 additions and 10 deletions

View File

@@ -320,11 +320,13 @@ static char *UnEscapeI18NChars(
)
{
unsigned char c;
char *buf, *to, *from;
char *buf;
unsigned char *to, *from;
if (MB_CUR_MAX != 1) {
from = source;
to = buf = malloc(strlen(source)+1);
from = (unsigned char*)source;
buf = malloc(strlen(source)+1);
to = (unsigned char *)buf;
while (c = *from++) {
if (c == I18N_TRIGGER) {
c = *from++;
@@ -449,7 +451,7 @@ static int CompareI18NStrings(ClientData clientData,
while (*cp) {
if ((len = mblen(cp, MB_CUR_MAX)) == 1) {
if (isalpha(*cp)) {
*cp = _toupper(*cp);
*cp = toupper(*cp);
}
cp++;
} else {
@@ -460,7 +462,7 @@ static int CompareI18NStrings(ClientData clientData,
while (*cp) {
if ((len = mblen(cp, MB_CUR_MAX)) == 1) {
if (isalpha(*cp)) {
*cp = _toupper(*cp);
*cp = toupper(*cp);
}
cp++;
} else {
@@ -853,15 +855,17 @@ EscapeI18NChars(
char *source
)
{
char *retval, *from, *to;
char *retval;
unsigned char *from, *to;
int len;
if (MB_CUR_MAX == 1) {
return source;
} else {
/* worst case, the string will expand by a factor of 3 */
from = source;
to = retval = malloc(3 * strlen(source) + 1);
from = (unsigned char *)source;
retval = malloc(3 * strlen(source) + 1);
to = (unsigned char *)retval;
while (*from) {
if ((len = mblen(from, MB_CUR_MAX)) < 0) {
fprintf(stderr,