My ISP provider has decided to terminate personal homepages last year, so the page has been deleted.

I am attaching the html of the page explaining the process of translation to this message.

You can also look at the files in

https://github.com/edorig/cde-utf8/tree/master/la_FR.UTF-8


Le 22/06/2024 à 16:56, thraex via cdesktopenv-devel a écrit :
Hi CDE folks,

I'm a Ubuntu user, and I would love to be able to install CDE from the repositories. So I filed a needs packaging but for Ubuntu on Launchpad at <https://bugs.launchpad.net/ubuntu/+bug/2058151/>. If CDE ever gets packaged for Ubuntu, that would be the report to follow I guess. If you have an account there, feel free to correct any mistakes I might have made.

Also, I would like to translate CDE in Turkish during the next year or so (at best), when my current projects are finished. I remember a page by Edmond Orignac explaining precisely how to do that but I can't find it anymore. Would anyone have a link for it?

Thanks in advance.


_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
Title: Internationalization of Common Desktop Environment

Internationalization of Common Desktop Environment

The LANG environment variable

The environement variable LANG indicates both the language and the national specificities that (the "locale" in Unix jargon: man 7 locale for details) should be used by the Common Desktop Environnement. Its value takes the form LANG=language_country.encoding, where language is the two letter code specifying in which language menus (say english en) and messages should be written, country is another two-letter code indicating for which specific country adjustement (say the United States of America US or the United Kingdom UK) to the messages in a given language should be made, and encoding indicates whether the language is written with a latin, cyrillic, greek, hebrew, arabic, asian (etc...) alphabet.

For now, besides the english C locale, some possible values of LANG in the Common Desktop Environment are fr_FR.ISO8859-1, de_DE.ISO8859-1, es_ES.ISO8859-1and it_IT.ISO8859-1 that is messages written in French (fr) for France (FR), or in German (de) language and for Germany (DE), or in Spanish(es) and for Spain (ES) or in Italian (it) for Italy. In the case of Switzerland, in order to have the appropriate monetary symbol for the Swiss Franc, and to take into account possible differences between German and Swiss German in the messages, one would need to create a LANG=de_CH.ISO8859-1 locale. Similarly, an adaptation for French Swiss cantons (Genève, Valais, Vaud...) requires aLANG=fr_CH.ISO8859-1 locale, and and adaptation for Ticino a LANG=it_CH.ISO8859-1. In North America, an adaptation for Québec (with Canadian dollar as monetary symbol etc...) would require a LANG=fr_CA.ISO8859-1 "locale". In Mexico, a LANG=es_MX.ISO8859-1 "locale" would be used.

Obviously, some West European languages that can be encoded with ISO8859-1 such as Dutch (nl_NL.ISO8859-1) Finnish (fi_FI.ISO8859-1) or Portuguese (pt_PT.ISO8859-1) are missing. Moreover, no message catalog exists for any East European language, although since OSF/Motif supports all the ISO8859 family of encodings, translation of the messages should be possible for all of them. This page tries to explain how such message catalogs are generated, and how a translation could be made.

Two letter code Language
de German
es Spanish
eu Basque
fr French
it Italian
nl Dutch
oc Occitan
pt Portuguese
la Latin
two lowercase letter encoding of language (ISO639 Norm)
Two uppercase letter encoding for country (ISO3166 Norm)
Two letter code Country
BE Belgium
CA Canada
CH Swiss Confederation
DE Germany
ES Spain
FR France
IT Italy
PT Portugal

Different encodings (see relevant man pages)
Encoding Languages
ISO8859-1/15 Afar, Afrikaans, English, Basque, Breton, Catalan, Cornish, Danish, Dutch, Finnish, French, Gaelic, Galician, German, Icelandic, Indonesian,
Irish, Italian, Malagasy, Malay, Oromo, Norwegian, Portuguese, Scottish, Somali, Sotho, Spanish, Swahili, Swedish, Tagalog, Uzbek, Xhosa, Zulu
ISO8859-2 Albanian, Bosnian, Croatian, Czech, English, Finnish, German, Hungarian, Irish, Polish, Slovak, Slovenian and Sorbian
ISO 8859-3 Maltese, Esperanto
ISO 8859-4 Baltic and Scandinavian Languages:Icelandic, Lappish, Eskimo
ISO 8859-5 Cyrillic: Russsian, Serbo-Croat, Bulgarian
ISO 8859-6 Arabic
ISO 8859-7 Greek
ISO 8859-8 Hebrew
ISO-8859-9 Turkish
ISO-8859-10 Icelandic, Lappish, Eskimo, Luganda
ISO-8859-11 Thai
ISO-8859-13 Maori and Baltic languages: Latvian, Lithuanian
ISO-8859-14 Celtic Languages: Welsh, Gaelic, Breton, Cornish

Note that ISO-8859-15 is an improved version of ISO-8859-1 with the € symbol. Some African languages such as Zulu and Swahili only use ASCII characters, and thus can be written with any ISO-8859-X encoding.

Message catalogs, online help and miscellaneous

Message catalogs

When the variable LANG has a definite value, messages are taken in the usr/dt/lib/nls/msg/$LANG folder. For exemple, the folder /usr/dt/lib/nls/msg/fr_FR.ISO8859-1/ contains:

DtHelp.cat dtinfo_start.cat dtstyle.cat DtMail.cat dtcm.cat dtksh.cat dtterm.cat DtPrint.cat dtconfig.cat dtlogin.cat dttypes.cat DtWidget.cat dtcopy.cat dtlp.cat dtudcexch.cat MotifApp.cat dtcreate.cat dtmailopts.cat dtudcfonted.cat Mrm.cat dtfile.cat dtpad.cat dtwm.cat SUNW_TOOLTALK.cat dthello.cat dtpdm.cat fmt_tbl.cat Uil.cat dthelpgen.cat dtpdmd.cat libDtMail.cat Xm.cat dthelpprint.cat dtprintinfo.cat libdtcm.cat dt.cat dticon.cat dtscreen.cat dtact.cat dtimsstart.cat dtsearch.cat dtcalc.cat dtinfo.cat dtsession.cat

Each .cat file is a binary file in which messages, menu texts, button names of the application are stored. The binary file dtcalc.cat contains the names of the keys of the applications dtcalc as well as the text of the error messages.

The .cat binary files are generated during the CDE build process by the program gencat(1) from source files .msg that are included with sources of the Common Desktop Environment in the folder programs/localized/$LANG.

Online help

Similarly, when LANG is defined, help messages are taken from the folder /usr/dt/appconfig/help/$LANG. The folder /usr/dt/appconfig/help/fr_FR.ISO8859-1/ contains the following files and directories:

Appmanager/ Desktop.hf Iconed/ Loginmgr.sdl Stylemgr.sdl Appmanager.sdl DesktopIntro.hf Iconed.sdl Mailer/ Terminal/ Calculator/ FPanel/ Infomgr/ Mailer.sdl Terminal.sdl Calculator.sdl FPanel.sdl Infomgr.sdl Printmgr/ Textedit/ Calendar/ Filemgr/ Intromgr/ Printmgr.sdl Textedit.sdl Calendar.sdl Filemgr.sdl Intromgr.sdl PrnSetup/ graphics/ CreatAct/ Help4Help/ LibDtPrint/ PrnSetup.sdl CreatAct.sdl Help4Help.sdl LibDtPrint.sdl Stylemgr/ Source files are located in the folder doc/fr_FR.ISO8859-1/help. So, help for the dtpad text editor in French is found under dos/fr_FR.ISO8859-1/help/Textedit/

and is produced from the files GEntity.sgm MetaInfo.sgm TOC.sgm adbook.sgm Home.sgm Ref.sgm Tasks.sgm book.sgm The.sgm are written in a variant of SGML (a markup language analogous to HTML used in web pages). The french text is located between the delimiters <para> and </para> or <title> and </title>.

To add a new "locale" to the Common Desktop Environment one must translate the messages from the .msg files and the help messages from the .sgm files, and generate the .cat and .sdl files. The .cat will have to be placed under the new directory /usr/dt/lib/nls/msg/LANG, where LANG is formed of the two lowercase letter code of the language, followed by the two uppercase letter code of the country and terminated by the code indicating which ISO8859 encoding is used for the characters. The .sdl files have to be placed under /usr/dt/appconfig/help/LANG

.

Miscellaneous

The directory app-defaults/ contains: Dt.tmsg Dtinfo.tmsg DtCalendar.tmsg Dtlogin.tmsg Dtbuilder.tmsg Dtmail.tmsg Dtcalc.tmsg Dtpad.tmsg Dtcm.tmsg Dtscreen.tmsg Dtcreate.tmsg Dtsession.tmsg Dtfile.tmsg Dtstyle.tmsg Dthello.tmsg Dtterm.tmsg Dthelpview.tmsg Dtudcfonted.tmsg Dticon.tmsg Dtwm.tmsg Dtimsstart.tmsg These messages are in the same format as the *.msg files. The directory backdrops/ contains the file Backdrops.tmsg that describes the names of possible backdrops in the program dtstyle. The names need to be translated. The directory config/ contains the files: config/Xresources.ow.tmsg config/dtfile.config.tmsg config/Xresources.tmsg config/home.session.tmsg config/_common.session.tmsg config/sys.dtwmrc.tmsg config/current.session.tmsg config/sys.font.tmsg config/display.current.session.tmsg config/sys.resources.tmsg config/display.home.session.tmsg config/sys.session.tmsg The directory palettes/ contains a file: Palettes.tmsg which lists the names of the palettes that can be used with dtstyles. The directory types/ contains files _common.dt.tmsg and action.tmsg.

Message catalogs: an example

Let's assume that we want to add Latin to the available languages. We will need to create a "locale" for that language. The two letter code for latin is la, and Latin can be encoded with any ISO8859 encoding. The country can be picked at will, and in our example France will be chosen. We will have to create the folder programs/localized/la_FR.ISO8859-1 and copy there all files and folders under programs/localized/C.

mkdir programs/localized/la_FR.ISO8859-1/ cp -R programs/localized/C/* programs/localized/la_FR.ISO8859-1/

We also need to do

cd programs/localized/templates/ sed -e 's/LANG=fr/LANG=la/g' <French.tmpl >Latin.tmpl

The Imakefile under the directories

app-defaults config msg types backdrops dtsr palettes have to be modified. The lines: #include "../../templates/C.tmpl" have to be changed into #include "../../templates/Latin.tmpl" After that, it is possible to turn to translations.

Various dictionaries and grammars are available online:

For the vocabulary of computing, the following resource can be used.

Format of the message files

In any .msg file, the lines beginning with a $ followed by space are comments in English to help the translator (see for instance CDE Internationalization Programmer's Guide in Message Guidelines section). It is not necessary to translate them in Latin. Lines beginning with $set are $quote must not be changed. The lines containing a message begin with a number followed by a space and the message to be translated such as 66 Index. The number must remain untouched, and only the text of the message may need to be translated.

The following warning appears in the comments at the beginning of the file localized/C/msg/dtterm.msg :

$ ***** NOTE FOR MESSAGE CATALOG TRANSLATORS ***** $ $ There may be three types of messages in this file: $ $ 1. Messages that appear in dialogs or are displayed to the user. $ $ These messages are the default and they should ALL BE LOCALIZED. $ Note that these messages do NOT have any identification (see the $ comments for type 2 and 3 below). $ $ 2. Messages that only appear in the DT error log file ($HOME/.dt/errorlog). $ $ The localization of these messages is OPTIONAL. These messages are $ identified by the following: $ $ MESSAGES xx-yy WILL ONLY APPEAR IN THE DT ERRORLOG FILE $ $ 3. Messages that should not be localized. $ $ These messages are identified by the following: $ $ DO NOT TRANSLATE or CHANGE or LOCALIZE MESSAGES xx-yy $ ***** END (NOTE FOR MESSAGE CATALOG TRANSLATORS) ***** $ $ ********** PROLOGUE ****************

Moreover, the file localized/C/msg/dtpad.msg also contains comments of the form:

$ Label for the File text field in the file selection box $ ***UNUSED*** This label is no longer used and need not be localized.

Rules

  1. Never translate lines beginning with a $.
  2. Never translate the messages that should not be localized (DO NOT TRANSLATE/CHANGE/LOCALIZE) as this could cause undefined behavior of the program.
  3. Prioritize the translation of the messages displayed to the users over messages that go to the error log file (WILL ONLY APPEAR IN THE DT ERRORLOG FILE) or messages marked UNUSED.
These rules imply that one should not pass the *.msg files through automatic translation software (such as Google Translate). By rule 2, undefined behavior could result from using the translated files.

Simple messages

The file localized/C/msg/dtcm.msg contains the messages of the dtcm calendar program. For instance, the names of the months are given as messages 114 to 125):

114 "January" 115 "February" 116 "March" 117 "April" 118 "May" 119 "June" 120 "July" 121 "August" 122 "September" 123 "October" 124 "November" 125 "December"

The numbers of the first columns are the message numbers. They are used by dtcm to locate the name of the month that should be printed. They must therefore be left intact. The names of the months between quotes in the second columd must be changed to the Latin names in the file localized/la_FR.ISO8859-1/msg/dtcm.msg:

114 "Januarius" 115 "Februarius" 116 "Martius" 117 "Aprilis" 118 "Maius" 119 "Junius" 120 "Julius" 121 "Augustus" 122 "September" 123 "October" 124 "November" 125 "December"

Three-letter abbreviations are found as messages 126 to 137. Only the message 130 "May" needs to be changed to 130 "Mai" .

The names of the days are found in localized/C/msg/dtcm.msg as messages 146 to 152

146 "Sunday" 147 "Monday" 148 "Tuesday" 149 "Wednesday" 150 "Thursday" 151 "Friday" 152 "Saturday"

The names in the second column have to be translated in Latin in the file localized/la_FR.ISO8859-1/msg/dtcm.msg:

146 "Dies Solis" 147 "Dies Lunae" 148 "Dies Marti" 149 "Dies Mercurii" 150 "Dies Jovis" 151 "Dies Veneris" 152 "Dies Saturni"

Messages containing C language format strings

Some messages contain symbols %s (or %d), for instance in localized/C/msg/dtcm.msg:

2 "Reminder- %s" The symbol %s (indicating a string format in C) will be replaced by the name of the event that triggers the reminder by the dtcm program. Therefore, it must not be touched. Only the word "Reminder" needs to be translated in Latin. So we will change the message to:

2 "Repetitio- %s"

Examples of messages containing the symbol %d (indicating an integer number format in C) are:

596 "Monday %d" 597 "Tuesday %d" 598 "Wednesday %d" 599 "Thursday %d" 600 "Friday %d" 601 "Saturday %d" 602 "Sunday %d" where %d will be replaced by the day of the month by the program. These messages are translated as: 596 "Lunae die %d" 597 "Marti die %d" 598 "Mercurii die %d" 599 "Jovis die %d" 600 "Veneris die %d" 601 "Saturni die %d" 602 "Solis die %d" Other symbols can appear when writing date formats such as: 992 "%A, %B %e, %Y"

The %A is replaced by the name of the day, %B by the month, %e by the day of the month, %Y by the year. One only has to exchange the order into 992 "%A %e %B, %Y". Note that if such a format string is used in strftime(3), the result will depend on the existence of a locale for Latin on the system as as this one. In the absence of such a locale, the output of strftime(3)will be in English.

A more complex example of C format strings in localized/C/msg/dtcm.msg is, 7 "\n\n\t** Calendar Appointment **\n\n\tDate:\t%s\n\tStart:\t%s\n\tEnd:\t %s\n\tWhat:\t%s" where the symbols \n et \t indicate respectively a linefeed and a tab. As above, the %s symbols will be replaced by the appropriate texts by dtcm. Only the words Calendar Appointment, Date, Start, End and What have to be translated. 7 "\n\n\t** Constitutum libelli **\n\n\tDie:\t%s\n\tInitio:\t%s\n\tFinis:\t%s\n\tRes:\t%s"

The *.tmsg files under app-defaults/ backdrops/ config/ palettes/ types/ must be translated following the same rules.

In order to have some uniformity between the applications, it is useful to make a glossary of English terms frequently used by CDE. These words can be replaced using the global substitution (with confirmation since some messages must not bet translated) function of an interactive text editor. In that way, the same Latin terms will describe the same objects/operations across all CDE applications, ensuring consistency of the messages. An example of such glossary is given in the tables.

English Latin
Action Action, onis
Apply Applicare
Go To Ire
Cancel Relinquere
Help Adjumentum
Change Mutare
Close Claudere
Load Onerare
Copy Copiare
Paste Agglutinare
Create Creare
Edit Redigere
Error Error, oris
Execute Pellere
sample glossary (I): Nouns and Adjectives are given as nominative, genitive
English Latin
Folder Index, icis
File scapus, i
Host Hospes, itis
Ignore Contemnere
Print Exscribere
Group Circulus, i
Modify Modificare
Move Movere
Network Rete, is
New Novus, a, um
Options Optio, onis
Browse Perlustrare
Default Absentem Aliquis
Font Typus, i
sample glossary (II): Nouns and Adjectives are given as nominative, genitive
English Latin
Program Programma
Read Legere
Search Quaerere
Save (as) Perscribere (in)
Select Seligere
Delete Delere
Syntax Constructio, onis
Rename Vocare
Type Genus, neris
Text Textus
Key Clavis, is
User Usor (or Usuarius)
Validate Validare
Value Valor, oris
Visualise Aspicere
Yes/No Ita/Minime
sample glossary (III): Nouns and Adjectives are given as nominative, genitive

Once the necessary translations are finished, the message catalogs *.cat must be created with gencat .

The proper command is

gencat -o [Message file].cat [Message file].msg

To test the translated files, we need to do (as root)

mkdir /usr/dt/lib/nls/msg/la_FR.ISO8859-1 cp *.cat /usr/dt/lib/nls/msg/la_FR.ISO8859-1 and place the line: export LANG=la_FR.ISO8859-1 in .dtprofile. After restarting CDE, the messages will be displayed in Latin. Note that it is not necessary to have translated all *.msg the files before starting to test. The applications that do not have a *.cat will simply show messages in English, while the applications that have a .cat file in /usr/dt/lib/nls/msg/la_FR.ISO8859-1 will show messages in Latin. Since contrarily to English, Latin uses declensions, the testing phase is useful to see the messages in context and determine in the ambiguous situations which case (accusative, nominative, dative, genitive, ablative) is appropriate for the Latin noun/adjective. It is best, in such ambiguous cases, to leave the noun/adjective in the form [accusative, termination of the genitive] in the .msg file, so that the applicable declension can be determined by the tester.

To generate the application defaults one must do the following
  1. Compile the program merge.c from cde/programs/localized/util/ (cc merge.c -o merge).
  2. Copy the files *.nls in the same directory as the files *.tmsg
  3. Do for each file merge < file.nls file.tmsg > file
One can download sample .msg files in Latin to see an (unfinished, pre-alpha) translation. CDE in Latin

Help Messages

To generate the help messages the files other than book.sgm under doc/C/help/Calendar have to be translated. The translation work is simpler since no C formats strings appear. Text between <-- --> is a comment and does not need to be translated. Text of the form &something; is a SGML symbol and must not be translated. Only the text between <...> and </...> needs to be translated. The help volumes can be stored in the local directory under .dt/help. [Return to the main page on CDE]
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to