src/interp/alloc.c
/*=============================
 * interp_load_lang -- Load the common
 *  error msgs for current locale
 * These are used by many report functions.
 * This avoids having to localize dozens of strings
 * just like these.
 * Examples:
 * nonfam1 is for a function taking a single argument 
 *   which should be a FAM
 * nonfamx is for a function taking multiple arguments 
 *   with error in one which should be a FAM
 * Created: 2002/02/16, Perry Rapp
 *===========================*/
- Load the common
error msgs for current locale
These are used by many report functions.
This avoids having to localize dozens of strings
just like these.
Examples:
nonfam1 is for a function taking a single argument
which should be a FAM
nonfamx is for a function taking multiple arguments
with error in one which should be a FAM
Created: 2002/02/16, Perry Rapp
- Load the common error msgs for current locale These are used by many report functions . This avoids having to localize dozens of strings just like these . Examples : nonfam1 is for a function taking a single argument which should be a FAM nonfamx is for a function taking multiple arguments with error in one which should be a FAM Created : 2002 / 02 / 16 Perry Rapp
void
interp_load_lang (void)
{
#ifdef HAVE_SETLOCALE
	STRING cur_locale = setlocale(LC_COLLATE, NULL);
	if (interp_locale) {
		if (eqstr(interp_locale, cur_locale))
			return;
		stdfree(interp_locale);
	}
	interp_locale = strsave(cur_locale);
#else
	if (interp_locale)
		return;
	interp_locale = strsave("C");
#endif
	clear_error_strings();
	nonint1     = strsave(_("%s: the arg must be an integer."));
	nonintx     = strsave(_("%s: the arg #%s must be an integer."));
	nonboo1     = strsave(_("%s: the arg must be a boolean."));
	nonboox     = strsave(_("%s: the arg #%s must be a boolean."));
	nonflo1     = strsave(_("%s: the arg must be a float."));
	nonflox     = strsave(_("%s: the arg #%s must be a float."));
	nonstr1     = strsave(_("%s: the arg must be a string."));
	nonstrx     = strsave(_("%s: the arg #%s must be a string."));
	nullarg1    = strsave(_("%s: null arg not permissible."));
	nonfname1   = strsave(_("%s: the arg must be a filename."));
	nonnodstr1  = strsave(_("%s: the arg must be a node or string."));
	nonind1     = strsave(_("%s: the arg must be a person."));
	nonindx     = strsave(_("%s: the arg #%s must be a person."));
	nonfam1     = strsave(_("%s: the arg must be a family."));
	nonfamx     = strsave(_("%s: the arg #%s must be a family."));
	nonif1      = strsave(_("%s: the arg must be a person or family."));
	nonrecx     = strsave(_("%s: the arg #%s must be a record."));
	nonnod1     = strsave(_("%s: the arg must be a node."));
	nonnodx     = strsave(_("%s: the arg #%s must be a node."));
	nonvar1     = strsave(_("%s: the arg must be a variable."));
	nonvarx     = strsave(_("%s: the arg #%s must be a variable."));
	nonlst1     = strsave(_("%s: the arg must be a list."));
	nonlstx     = strsave(_("%s: the arg #%s must be a list."));
	nontabx     = strsave(_("%s: the arg #%s must be a table."));
	nonset1     = strsave(_("%s: the arg must be a set."));
	nonsetx     = strsave(_("%s: the arg #%s must be a set."));
	nonlstarrx  = strsave(_("%s: the arg #%s must be a list or array."));
	badargs     = strsave(_("%s: Bad arguments"));
	badarg1     = strsave(_("%s: the arg had a major error."));
	badargx     = strsave(_("%s: the arg #%s had a major error."));
	badtrig     = strsave(_("%s: the arg #%s would cause an arithmetic exception."));
}
void interp_load_lang ( void ) { #ifdef HAVE_SETLOCALE STRING cur_locale = setlocale ( LC_COLLATE , NULL ) ; if ( interp_locale ) { if ( eqstr ( interp_locale , cur_locale ) ) return ; stdfree ( interp_locale ) ; } interp_locale = strsave ( cur_locale ) ; #else if ( interp_locale ) return ; interp_locale = strsave ( " " ) ; #endif clear_error_strings ( ) ; nonint1 = strsave ( _ ( " " ) ) ; nonintx = strsave ( _ ( " " ) ) ; nonboo1 = strsave ( _ ( " " ) ) ; nonboox = strsave ( _ ( " " ) ) ; nonflo1 = strsave ( _ ( " " ) ) ; nonflox = strsave ( _ ( " " ) ) ; nonstr1 = strsave ( _ ( " " ) ) ; nonstrx = strsave ( _ ( " " ) ) ; nullarg1 = strsave ( _ ( " " ) ) ; nonfname1 = strsave ( _ ( " " ) ) ; nonnodstr1 = strsave ( _ ( " " ) ) ; nonind1 = strsave ( _ ( " " ) ) ; nonindx = strsave ( _ ( " " ) ) ; nonfam1 = strsave ( _ ( " " ) ) ; nonfamx = strsave ( _ ( " " ) ) ; nonif1 = strsave ( _ ( " " ) ) ; nonrecx = strsave ( _ ( " " ) ) ; nonnod1 = strsave ( _ ( " " ) ) ; nonnodx = strsave ( _ ( " " ) ) ; nonvar1 = strsave ( _ ( " " ) ) ; nonvarx = strsave ( _ ( " " ) ) ; nonlst1 = strsave ( _ ( " " ) ) ; nonlstx = strsave ( _ ( " " ) ) ; nontabx = strsave ( _ ( " " ) ) ; nonset1 = strsave ( _ ( " " ) ) ; nonsetx = strsave ( _ ( " " ) ) ; nonlstarrx = strsave ( _ ( " " ) ) ; badargs = strsave ( _ ( " " ) ) ; badarg1 = strsave ( _ ( " " ) ) ; badargx = strsave ( _ ( " " ) ) ; badtrig = strsave ( _ ( " " ) ) ; }
interp_load_lang -- Load the common
  error msgs for current locale
 These are used by many report functions.
interp_load_lang -- Load the common error msgs for current locale These are used by many report functions .
/* using LC_COLLATE because Win32 lacks LC_MESSAGES */