xref: /freebsd/contrib/ee/ee.i18n.guide (revision 10b3b54548f2290bbe8d8f88c59c28d12b7a635d)
172fcea8cSEd SchoutenEasy Editor ("ee") provides the ability to translate the messages
272fcea8cSEd Schoutendisplayed to the user and the commands entered.  This is done via message
372fcea8cSEd Schoutencatalogs, following X/Open standards.  ee supports eight bit characters,
472fcea8cSEd Schoutenas well as 16-bit characters.  The Chinese Big 5 code set is the 16-bit
572fcea8cSEd Schoutencode set that ee was modified to handle, as it is relatively easy to
672fcea8cSEd Schoutensupport since two byte characters also take up two columns on the screen,
772fcea8cSEd Schoutenthereby simplifying the screen position calculations.  Other multibyte
872fcea8cSEd Schoutencode sets may function, but have not been tested.
972fcea8cSEd Schouten
1072fcea8cSEd Schouten(The name ee.i18n.guide is for "ee internationalization guide".  The i18n
1172fcea8cSEd Schoutenabbreviation is used because there are 18 characters between the first
1272fcea8cSEd Schoutenletter ("i") and last ("n") of "internationalization".)
1372fcea8cSEd Schouten
1472fcea8cSEd SchoutenAll of the messages, warnings, information, and commands, are contained
1572fcea8cSEd Schoutenin the message catalog.  Each numbered entry represents an individual
1672fcea8cSEd Schoutenstring used by ee.  Some strings contain formatting information for
1772fcea8cSEd Schoutenformatted print statements, which are of the form "%s", or "%d", these
1872fcea8cSEd Schoutenmust be preserved in the translation, or the correct information will not
1972fcea8cSEd Schoutenbe displayed.  For those strings containing multiple formatting codes,
2072fcea8cSEd Schoutenthe order of each item must be preserved as well.
2172fcea8cSEd Schouten
2272fcea8cSEd SchoutenMessage		content
2372fcea8cSEd Schouten1 		title for modes, or settings menu
2472fcea8cSEd Schouten2 - 8		entries for modes menu, each line should be the same length
2572fcea8cSEd Schouten		 (padded with spaces)
2672fcea8cSEd Schouten9 - 34		other menu titles and entries
2772fcea8cSEd Schouten35 - 56 	help screen
2872fcea8cSEd Schouten57 - 61 	actions assigned to control keys
2972fcea8cSEd Schouten62 - 66 	commands information
3072fcea8cSEd Schouten67 		message displayed when info window turned off
3172fcea8cSEd Schouten68 		indication that no file name was entered when invoking ee
3272fcea8cSEd Schouten69		prompt for decimal value of character to be entered
3372fcea8cSEd Schouten70		message displaying the print command being invoked
3472fcea8cSEd Schouten71 		prompt for command
3572fcea8cSEd Schouten72		prompt for name of file to be written
3672fcea8cSEd Schouten73		prompt for name of file to be read
3772fcea8cSEd Schouten74		string used to display the decimal value of the character
3872fcea8cSEd Schouten		 the cursor is on
3972fcea8cSEd Schouten75		string displaying an unrecognized command
4072fcea8cSEd Schouten76 		string indicating that the command entered is not a unique
4172fcea8cSEd Schouten		 substring of a valid command
4272fcea8cSEd Schouten77		string indicating the current line number
4372fcea8cSEd Schouten78		string for displaying the length of the line
4472fcea8cSEd Schouten79		string for displaying the name of the file
4572fcea8cSEd Schouten80 - 83		strings showing how to invoke ee, and its options
4672fcea8cSEd Schouten84		message indicating that the file entered is a directory, not a
4772fcea8cSEd Schouten		 text file
4872fcea8cSEd Schouten85		message informing that the entered file does not yet exist
4972fcea8cSEd Schouten86		message informing that the file can't be opened (because of
5072fcea8cSEd Schouten		 permission problems)
5172fcea8cSEd Schouten87		message after file has been read with the file name and number
5272fcea8cSEd Schouten		 of lines read
5372fcea8cSEd Schouten88		message indicating that the file has been read
5472fcea8cSEd Schouten89		message indicating that the file is being read
5572fcea8cSEd Schouten90		message indicating that permissions only allow the file to be
5672fcea8cSEd Schouten		 read, not written
5772fcea8cSEd Schouten91		message after file has been read with the file name and number
5872fcea8cSEd Schouten		 of lines read
5972fcea8cSEd Schouten92		prompt for name of file to be saved (used when no name was
6072fcea8cSEd Schouten		 entered for a file to edit)
6172fcea8cSEd Schouten93		message indicating that the file was not written, since no
6272fcea8cSEd Schouten		 name was entered at the prompt
6372fcea8cSEd Schouten94		prompt asking user if changes should not be saved ("yes_char"
6472fcea8cSEd Schouten		 will be expected for affirmative response)
6572fcea8cSEd Schouten95		"yes" character, single character expected to confirm action
6672fcea8cSEd Schouten		 (can be upper or lower case, will be converted to upper-case
6772fcea8cSEd Schouten		 during test)
6872fcea8cSEd Schouten96		prompt
6972fcea8cSEd Schouten97		error message
7072fcea8cSEd Schouten98		message indicating that the named file is being written
7172fcea8cSEd Schouten99		message indicating the name of the file written, the number of
7272fcea8cSEd Schouten		 lines, and the number of characters (order of items must be
7372fcea8cSEd Schouten		 maintained)
7472fcea8cSEd Schouten100		search in progress message
7572fcea8cSEd Schouten101		message that the string was not found
7672fcea8cSEd Schouten102		prompt for search
7772fcea8cSEd Schouten103		message that string could not be executed
7872fcea8cSEd Schouten104		self-explanatory
7972fcea8cSEd Schouten105		message for menus, indicating that the Escape character will
8072fcea8cSEd Schouten		 allow the user to exit the menu
8172fcea8cSEd Schouten106		error message indicating the menu won't fit on the screen
8272fcea8cSEd Schouten107		self-explanatory
8372fcea8cSEd Schouten108		prompt for shell command
8472fcea8cSEd Schouten109		message displayed while formatting a paragraph
8572fcea8cSEd Schouten110		string which places message for spell checking at top of
8672fcea8cSEd Schouten		 buffer (the portions 'list of unrecognized words' and
8772fcea8cSEd Schouten		 '-=-=-=-=-=-' may be replaced, but the rest must remain the
8872fcea8cSEd Schouten		 same)
8972fcea8cSEd Schouten111		message informing that spell checking is in progress
9072fcea8cSEd Schouten112		prompt for right margin
9172fcea8cSEd Schouten113		error informing user that operation is not permitted in ree
9272fcea8cSEd Schouten114		string indicating mode is turned 'on' in modes menu
9372fcea8cSEd Schouten115		string indicating mode is turned 'off' in modes menu
9472fcea8cSEd Schouten116 - 131	strings used for commands (some also used for initialization)
9572fcea8cSEd Schouten132 - 144	strings used for initialization
9672fcea8cSEd Schouten145		entry for settings menu for emacs key bindings settings
9772fcea8cSEd Schouten146 - 153	help screen entries for emacs key bindings info
9872fcea8cSEd Schouten154 - 158	info window entries for emacs key bindings info
9972fcea8cSEd Schouten159		string for turning on emacs key bindings in the init file
10072fcea8cSEd Schouten160		string for turning off emacs key bindings in the init file
10172fcea8cSEd Schouten161		fifth line of usage statement
10272fcea8cSEd Schouten162		error message when unable to save configuration file
10372fcea8cSEd Schouten163		positive feedback about saving the configuration file
10472fcea8cSEd Schouten164 - 167	menu items for saving editor configuration
10572fcea8cSEd Schouten168		error message when unable to save configuration file
10672fcea8cSEd Schouten169		error message for ree when not specifying the file
10772fcea8cSEd Schouten180		self-explanatory
10872fcea8cSEd Schouten181 - 182	indicators of more information in menu (for when scrolling
10972fcea8cSEd Schouten		 menus because menu contents won't fit vertically on screen)
11072fcea8cSEd Schouten183		menu entry for modes menu for 16 bit characters
11172fcea8cSEd Schouten184 - 185	strings for initialization to turn on or off 16 bit
11272fcea8cSEd Schouten		character handling
11372fcea8cSEd Schouten
11472fcea8cSEd SchoutenCare should be taken when translating commands and initialization keywords
11572fcea8cSEd Schoutenbecause the algorithm used for detecting uniqueness of entered commands
11672fcea8cSEd Schoutenwill not be able to distinguish words that are not unique before the end
11772fcea8cSEd Schoutenof the shorter word, for example, it would not be able to distinguish the
11872fcea8cSEd Schoutencommand 'abcd' from 'abcde'.
11972fcea8cSEd Schouten
12072fcea8cSEd SchoutenAfter translating the messages, use the 'gencat' command to create the compiled
12172fcea8cSEd Schoutencatalog used when running the software.  The standard syntax would be:
12272fcea8cSEd Schouten
12372fcea8cSEd Schouten	gencat ee.cat ee.msg
12472fcea8cSEd Schouten
12572fcea8cSEd SchoutenWhere ee.msg is the file containing the translations, and ee.cat is the
12672fcea8cSEd Schoutencompiled catalog.  If the file ee.cat does not exist, it will be created.
12772fcea8cSEd SchoutenCheck the documentation for your system for proper syntax.
12872fcea8cSEd Schouten
12972fcea8cSEd SchoutenMessage catalog placement varies from system to system.  A common location
13072fcea8cSEd Schoutenfor message catalogs is in /usr/lib/nls.  In this directory are
13172fcea8cSEd Schoutendirectories with the names of other languages.  The default language is
13272fcea8cSEd Schouten'C'.  There is also an environment variable, named NLSPATH used to
13372fcea8cSEd Schoutendetermine where message catalogs can be found.  This variable is similar
13472fcea8cSEd Schoutento the PATH variable used for commands, but with some differences.  The
13572fcea8cSEd SchoutenNLSPATH variable must have the ability to handle different names for
13672fcea8cSEd Schoutenlanguages and the catalog files, so it has field descriptors for these.  A
13772fcea8cSEd Schoutentypical setting for NLSPATH could be:
13872fcea8cSEd Schouten
13972fcea8cSEd Schouten	NLSPATH=/usr/lib/nls/%L/%N.cat:/usr/local/lib/nls/%L/%N.cat
14072fcea8cSEd Schouten
14172fcea8cSEd SchoutenWhere "%L" is the field descriptor for the language (obtained from the
14272fcea8cSEd SchoutenLANG environment variable) and "%N" is the name of the file (with the
14372fcea8cSEd Schouten".cat" appended by the path variable, it is not passed from the requesting
14472fcea8cSEd Schoutenprogram).  The colon (:) is used to separate paths, so in the above
14572fcea8cSEd Schoutenexample there are two paths possible for message catalogs.  You may wish
14672fcea8cSEd Schoutento maintain catalogs for applications that are not supported by your
14772fcea8cSEd Schoutensystem vendor in a location unique for you, and this is facilitated by the
14872fcea8cSEd SchoutenNLSPATH variable.  Remember to set and export both the LANG and NLSPATH
14972fcea8cSEd Schoutenvariables for each user that expects to use localization either in a
15072fcea8cSEd Schoutensystem-wide profile or in each user's profile.  See your system
15172fcea8cSEd Schoutendocumentation for more information.
15272fcea8cSEd Schouten
15372fcea8cSEd SchoutenThe message catalog supplied with ee also uses the '$quote' directive to
15472fcea8cSEd Schoutenspecify a quote around strings to ensure proper padding.  This directive
15572fcea8cSEd Schoutenmay not be supported on all systems, and lead to quotes being included in
15672fcea8cSEd Schoutenthe string used in ee, which will cause incorrect behavior.  If the
15772fcea8cSEd Schouten'$quote' directive is not supported by your system's gencat command, edit
15872fcea8cSEd Schoutenthe msg file to remove the leading and trailing quotation marks.
159