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 :
Title: Internationalization of Common Desktop EnvironmentHi 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
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 letter code | Country |
---|---|
BE | Belgium |
CA | Canada |
CH | Swiss Confederation |
DE | Germany |
ES | Spain |
FR | France |
IT | Italy |
PT | Portugal |
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:
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:
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: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.
We also need to do
The Imakefile under the directories
Various dictionaries and grammars are available online:
- A Copious and Critical English-Latin Dictionary by William Smith,Theophilus Dwight Hall
- A Complete English-Latin and Latin-English Dictionary by Joseph Esmond Riddle
- A Copious and Critical English-Latin Lexicon Joseph Esmond Riddle,Karl Ernst Georges,Thomas Kerchever Arnold
- A Phraseological English-Latin Dictionary Charles Duke Yonge
- Entick's English-Latin dictionary John Entick
- Elements of Latin Grammar Albert Harkness
- A Latin Grammar for Schools and Colleges Joseph Henry Allen,James Bradstreet Greenough
- Handbook of Latin writing Henry Preble, Charles Pomeroy Parker
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 :
Moreover, the file localized/C/msg/dtpad.msg also contains comments of the form:
Rules
- Never translate lines beginning with a $.
- Never translate the messages that should not be localized (DO NOT TRANSLATE/CHANGE/LOCALIZE) as this could cause undefined behavior of the program.
- 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.
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):
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:
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
The names in the second column have to be translated in Latin in the file localized/la_FR.ISO8859-1/msg/dtcm.msg:
Messages containing C language format strings
Some messages contain symbols %s (or %d), for instance in localized/C/msg/dtcm.msg:
Examples of messages containing the symbol %d (indicating an integer number format in C) are:
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,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 |
English | Latin |
---|---|
Folder | Index, icis |
File | scapus, i |
Host | Hospes, itis |
Ignore | Contemnere |
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 |
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 |
Once the necessary translations are finished, the message catalogs *.cat must be created with gencat .
The proper command is
To test the translated files, we need to do (as root)
- Compile the program merge.c from cde/programs/localized/util/ (cc merge.c -o merge).
- Copy the files *.nls in the same directory as the files *.tmsg
- Do for each file merge < file.nls file.tmsg > file
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