Previous Next Contents Index Doc Set Home


Localization Support

D


Support for languages other than English is described in this Appendix.


Native Language Support

This version of Fortran supports the development of applications using languages other than English, including most European languages. As a result, you can switch the development of applications from one native language to another.

This Fortran compiler implements internationalization as follows:

Locale

You can enable changing your application from one native language to another by setting the locale. Doing so changes some aspects of displays, such as date and time formats.

For information on this and other native language support features, read Chapter 6, "Native Language Application Support," of the System Services Overview for Solaris software.

Even though some aspects can change if you set the locale, certain aspects cannot change. An internationalized compiler language does not allow input and output in the various international formats. If it does, it does not comply with the language standard appropriate for its language. For example, some languages have standards that specify a period (.) as the decimal unit in the floating-point representation.

Example: No I/O in international formats:

	PROGRAM sample 
	REAL r 
	r = 1.2 
	WRITE( 6, 1 ) r
 1	FORMAT( 1X F10.5 )
	END 

Here is the output:

    1.20000

In the example above, if you reset your system locale to, say, France, and rerun the program, you still receive the same output. The period is not replaced with a comma, the French decimal unit.

Compile-Time Error Messages

The compile-time error messages are on files called source catalogs so you can edit them. You may decide to translate them to a local language such as French or Italian. Usually, a third party does the translating. Then you can make the results available to all local users of f77/f90. Each user of f77/f90 can choose to use these files or not.

Localizing and Installing the Files

Usually a system administrator does the installation. It is generally done only once per language for the whole system, rather than once for each user of f77/f90. The results are available to all users of f77/f90 on the system.

1. Find the message text files.

The file names are:

2. Edit the message text files.

a. Make backup copies of the files.

b. In whatever editor you are comfortable with, edit the files.

The editor can be vi, emacs, textedit, and so forth.

Preserve any existing format directives, such as %f, %d, %s, and so forth.

c. Save the files.

3. Generate the message database catalogs from the message text files.

The compiler uses only the formatted message database catalogs. Run the gencat program to create the database files.

a. Generate the SUNW_SPRO_SC_f77pass1.cat message database from the SUNW_SPRO_SC_f77pass1.msg text file using gencat:

demo% gencat SUNW_SPRO_SC_f77pass1.cat \        
                                 SUNW_SPRO_SC_f77pass1.msg

Do this for each changed .msg file.

4. Make the message database catalobs available to the general user.

Either put the catalogs into the standard location or put the path for them into the environment variable NLSPATH.

a. Define the standard location and name.

Put the files into the directory indicated:

/opt/SUNWspro/lib/locale/lang/LC_MESSAGES/

where lang is the directory for the particular (natural) language. For example, the value of lang for Italian is it.

b. Set up the environment variable.

Put the path for the new files into the NLSPATH environment variable.
For example, if your files are in /usr/local/MyMessDir/, then use the following commands.

In a sh shell:

demo$ NLSPATH=/usr/local/MyMessDir/%N.cat
demo$ export NLSPATH

In a csh shell:

demo% setenv NLSPATH  /usr/local/MyMessDir/%N.cat

The NLSPATH variable is standard for the X/Open environment. For more information, read the X/Open documents. See also gencat(1) and catgets(3C) for more information on message catalogs.

Using the File After Installation

You use the file by setting the environment variable LC_MESSAGES. This setup is generally done once for each developer.

Example: Set the environment variable LC_MESSAGES,assuming standard install locations, and the messages are localized in Italian:

In a sh shell:

demo$ LC_MESSAGES=it
demo$ export LC_MESSAGES

In a csh shell:

demo% setenv  LC_MESSAGES it


Previous Next Contents Index Doc Set Home