Features

Localization Issues

Foreign language support for AutoLISP

We need support for the international AutoCAD versions - to translate commands, options and prompts- and for user codepages - to convert user prompts.

Locale conventions are affected by the country, the language and the coepage used. You should provide locale support to format the output user-friendly, the library must support locale specific information because AutoCAD uses für some strings translated, not english messages, and AutoCAD always uses sometimes the current user codepage, sometimes its native codepage for which it was compiled for.

User codepages are set by the operating system (Win32: Control Panel) and affects SYSCODEPAGE, the AutoCAD language is fixed.

Library error prompts are always in english. User prompts may be localized, but default to english.

AutoCAD Language Specific STDLIB Functions:

Utilities:

(STD-VER-LANGUAGE) returns at runtime a keyword describing the actual AutoCAD language version, which may be different form the OS specific language setting and the system codepage. See STDINIT

Affected by different language settings - Locale Settings

Every output should be provided user-friendly, i.e. using the current (even dynamic) locale settings, country, language or codepage specific, formatting numeric, monetary or time information. There are also other issues to be respected. The main function to get the current locale information is (STD-GET-LOCALE-INFO).

The following functions and globals are affected by different AutoCAD and AutoLISP language versions:

(*STD-ERROR*) must detect

"quit / exit abort"

"Function cancelled" ;*cancel* on prompts

"Console break" ;*cancel* during evaluation

to be able to perform silent user breaks.

AutoLISP has translated error messages. See STDERROR.

So far we have support for :GERMAN, :ENGLISH, :JAPANESE and :CZECH

*DATE-FORMAT-STRING* and

*TIME-FORMAT-STRING* is be set at startup according the current language, but this should be changed to reflect the current system settings (Win32-Control Panel-Language). see STDTIME

So far english and german settings are provided. It affects the date and time printing and conversion functions like (std-today) (std-cdate->date-string) and (std-cdate->time-string)

(STD-CDATE->DATE-STRING) and (STD-TODAY) honor the current *DATE-FORMAT-STRING* setting.

(STD-CDATE->TIME-STRING) honors the current *DATETIME-FORMAT-STRING* setting.

(STD-OSMSTR flag) should return language specific options. see STDMISC.

So far supported are :ENGLISH, :GERMAN, :FRENCH, :SPANISH,:ITALIAN and :RUSSIAN

The values are calculated from translation-table *STD:LOCALIZED-OSMODE-TABLE* and stored in the globals *STD:OSMODE-LONG-STRINGS* and *STD:OSMODE-SHORT-STRINGS* (which is created dynamically from the long strings)

Global String Tables

The following global string tables would require translation into the supported languages:

*LOCALIZED-month-names*
*LOCALIZED-week-days*

*STD:LOCALIZED-OSMODE-TABLE*

We will keep translated names in seperate files per language: LOCALMSG.<lang>

Codepages

A codepage is a table of ascii characters in a special and unique order, dependent on the system settings. Normally the AutoCAD system codepage (getvar "SYSCODEPAGE") and the operating system codepage are the same, they don't need any translation. But sometimes you may want to maintain stringtables just in one codepage and automatically translate to to others. Or you may want to read in or write out strings in a different codepage.

Special treatment must be given to 8-bit extensions of foreign characters.

We can get and set codepages with

(STD-SYS-CODEPAGE cp)

(STD-CPTRANS string from-cp to-cp) is the general tool to translate strings between two arbitrary codepages. It uses the DBTRANS.CPM unicode table provided by AutoCAD.

LC_CTYPE:

Affected by codepages different to the standard ISO Latin-1 are:

STD-ISLOWER, STD-ISUPPER, STD-TOLOWER, STD-TOUPPER,. Changing the codepage with STD-SYS-CODEPAGE changes the behaviour of those functions. Also affected are all functions using these functions: STD-STRCASE, STD-STRING-UPCASE, STD-STRING-DOWNCASE, STD-STRING-CAPITALIZE and maybe later on some more string formatting functions.

LC_COLLATE:

STD-SORT and ACAD_STRLSORT behave dependent on the current collate sequence, which is defined by the system. This is fixed and cannot be changed efficiently enough supporting arbitrary codepages.

Questionable is if some file IO functions should take care of the current lisp codepage, which might be different to the system codepage. STD-READ-FILE-STRINGS, STD-READ-FILE-LIST and STD-PRINC-TO. For now we use only the system codepage, but you can easily translate the strings with STD-CPTRANS.

Codepage names may use common aliases. We support the aliases defined in DBTRANS.CPM and the aliases defined in the standard recode gnu tool for all supported codepages. The name -here with the abbrevation cp- is a case-sensitive string!

All codepage names are unified to the names below.

The yet supported codepages for STD-CPTRANS are:

("iso8859-1" "ascii" "dos437" "dos850" "dos852" "dos855" "dos857" "dos860" "dos861" "dos863" "dos864" "dos865" "dos866" "dos869" "iso8859-2" "iso8859-3" "iso8859-4" "iso8859-5" "iso8859-6" "iso8859-7" "iso8859-8" "iso8859-9" "ANSI_1251" "mac-roman")

Limited support, upper-lower ranges, supporting STD-TOLOWER, STD-TOUPPER, STD-ISLOWER, STD-ISUPPER, is so far given for the following codepages:

("ascii" "iso8859-1" "iso8859-2" "iso8859-3" "iso8859-4" "dos850" "koi8-r" "ANSI_1251" "dos866")

Missing are the 16-bit unicode codepages for asian languages like chinese, korean and japanese and some more LC_CTYPE ranges.

For a detailed list of valid aliases see STDLOCAL.LSP