EiffelStudio Internationalization: Difference between revisions

From EiffelStudio: an EiffelSoftware project
Jump to navigation Jump to search
Ted (talk | contribs)
Ted (talk | contribs)
 
(21 intermediate revisions by 3 users not shown)
Line 13: Line 13:
## Modify places using EV_CONSTANTS, make new classes if needed. e.g. EV_CONFIRMATION_DIALOG; EV_WARNING_DIALOG are not usable.
## Modify places using EV_CONSTANTS, make new classes if needed. e.g. EV_CONFIRMATION_DIALOG; EV_WARNING_DIALOG are not usable.
## Write scripts to draw strings from default.xml. "Directory", names and descriptions of preferences are also needed to be translated.
## Write scripts to draw strings from default.xml. "Directory", names and descriptions of preferences are also needed to be translated.
## Find a solution to wizards, since some of them are external excutables.
## Write scripts to draw names of wizards from .dsc files, and translate interface names by code in wizard projects.
# Build language menus to switch language.  
# Build language menus to switch language. (Choices have been done as a preference, and decided not to do observer pattern.)
## Make interface classes locale observers so that all tools know when interface names should be reread.
## Make interface classes locale observers so that all tools know when interface names should be reread.
# Solve the problems in vision2.
# Solve the problems in vision2.
Line 20: Line 20:
## Handle "&" as both char and wchar for menu items.
## Handle "&" as both char and wchar for menu items.
## Fix "tab" issue for menu items.
## Fix "tab" issue for menu items.
# Integrate i18n .po generation tool. It has been done in i18n branch.
# Add string encoding conversion support in i18n library, with which correct translated stream can be direct to the console. And this would be usefull when doing the following editor part.
# using .po generation tool integrated ec to compile an ec in which interface names have been adapted.  
# Integrate i18n .po generation tool. It has been done in i18n branch. (po generation tool has been done a stand alone tool.)
# Use .po generation tool to generate estudio.pot file. The .po generation tool generally extracts strings that are taken as parameters of `translated' and `translated_plural' and produce .pot file.
# Use .po generation tool to generate estudio.pot file. The .po generation tool generally extracts strings that are taken as parameters of `translated' and `translated_plural' and produce .pot file.
# Since strings used in EiffelStudio not only come from the source code. Write scripts to extract them and merge them into estudio.pot. Strings should be extracted from: default.xml → descriptions of preferences
# Since strings used in EiffelStudio not only come from the source code. Write scripts to extract them and merge them into estudio.pot. Strings should be extracted from: default.xml → descriptions of preferences
Line 29: Line 29:


=== Editor part ===
=== Editor part ===
==== Earlier glance ====
# This step might be more complicated. And will be done later after the first step. Probably after 6.0 release. This step concentrates on extending the editor library to accept wide characters. Internationalization of any output directed to the editor is done in the step. Many existing tools might be affected, search tool, formatting tools etc.  
# This step might be more complicated. And will be done later after the first step. Probably after 6.0 release. This step concentrates on extending the editor library to accept wide characters. Internationalization of any output directed to the editor is done in the step. Many existing tools might be affected, search tool, formatting tools etc.  
# Encoding conversion facility is needed.
# Encoding conversion facility is needed.
==== More detailed plan ====
* Editor library
** Use UTF-32 internally in the editor (done)
** Unicode supported Eiffel sanner (done)
** Unicode text rendering (done)
** Ability read all kinds of text format. This implies the editor is able to convert all kinds of format from and to Unicode. Attribute of `encoding' is needed. This also affects how to handle strings from IM.
** Enabling IM of drawing area on GTK.
* i18n library
** Add ability to recognize context. `translation_with_context (original: STRING_GENERAL): STRING_32' and `plural_translation_with_context (original_singular, original_plural: STRING_GENERAL; plural_number: INTEGER): STRING_32' would be added.
** Modify po generation tool to handle new interfaces.
* GUI
** A way to let the user decide which encoding should the editor use to read or save.
** Search facility (ES part done, need Gobo backing)
** Text Formatting
** Code completion (80% done)
** Refactoring tool/Text modifier -- diff library
** Pick and Drop able grids (done, not tested)
* Others
** Unicode wild cards support
** Unicode "as_lower", "is_alpha" and "is_digit" -- i.e. EB_TOKEN_TOOLKIT.
** Unicode XML support. Handlers of ECFs and other XML based files that could be added Unicode chars must support Unicode encoding.
* Compiler (Possible step, may lead to change of ECMA)
** Choose an encoding that the parser works on. (UTF-8 probably)
** Hence the compiler has to be able to convert all kinds of texts to the one it accepts.
** Names heaps, queries and outputs need to be changed.
** This may affect a lot of things, configuration, metrics etc.
** Sync roundtrip parser against correct Unicode char positions. Now position bases on byte counts.
* Documentation generation
==== Text Flow and Encoding (Design) ====
[[Image:Eiffel_Studio_Text_Flow_and_Encoding_Design.PNG]]


== File structure ==
== File structure ==
Line 63: Line 101:
* When the translation or modification is done, translators only need to commit .po file(s) that they are working on.
* When the translation or modification is done, translators only need to commit .po file(s) that they are working on.
* Whenever new languages are decided to add in. New .po file can be added directly in %EIFFEL_SRC%\Delivery\studio\lang\po_files. Eiffel Studio should have the ability to detect at runtime what languages are available.
* Whenever new languages are decided to add in. New .po file can be added directly in %EIFFEL_SRC%\Delivery\studio\lang\po_files. Eiffel Studio should have the ability to detect at runtime what languages are available.
=== Life Cycle ===
# Changes take place in code.(Developer)
# Syncronize local code from repository.(Maintainer)
# Run po_generation_tool with approperate arguments (Maintainer)
# Run build_misc_enties.bat (Maintainer)
# Commit estudio.pot from last step.  (Maintainer)
# Update .po files from estudio.pot. (Translator)
# Translate and commit various .po files. (Translator)
# Build and commit .mo files. (Release maker in principle. Maintainer or Translator is also OK.)
# .mo files go with releases. (Release maker)


=== Translator Guide ===
=== Translator Guide ===
Line 70: Line 119:
* When the translation is done, just commit those modified po files.
* When the translation is done, just commit those modified po files.
* Make sure that po files are saved in UTF-8 encoding.
* Make sure that po files are saved in UTF-8 encoding.
* Note that never try by hand to add or remove terms in .po files. Because other translators wouldn't see the changes if estudio.pot file were not updated.
* Note that a translator should not modify estudio.pot file.


=== Developer Guide ===
=== Developer Guide ===
Line 76: Line 127:


=== Maintainer Guide ===
=== Maintainer Guide ===
* Build po generation tool which is located at internal svn repository /ise_svn/trunk/Src/tools/po_generation_tool.
* Build po generation tool which is located at internal svn repository $EIFFEL_SRC/tools/po_generation_tool.
* Make sure gettext and perl is installed. On windows cygwin cantains perl and gettext modules.
* Make sure gettext and perl is installed. On windows cygwin cantains perl and gettext modules.
* When there are new or modified strings need to be translated in the code. $EIFFEL_SRC/Delivery/studio/lang/estudio.pot should be regenerated.
* When there are new or modified strings need to be translated in the code. $EIFFEL_SRC/Delivery/studio/lang/estudio.pot should be regenerated.
   To regenerate estudio.pot, one should do:
   To regenerate estudio.pot, one should do:
   po_generation_tool -D $EIFFEL_SRC/Eiffel $EIFFEL_SRC/framework -o $EIFFEL_SRC/Delivery/studio/lang/estudio.pot
   po_generation_tool -D %EIFFEL_SRC%/Eiffel %EIFFEL_SRC%/framework %EIFFEL_SRC%/help/wizards %EIFFEL_SRC%/library/wizard -o %EIFFEL_SRC%/Delivery/studio/lang/po_files/estudio.pot
   On windows:
   On windows:
   $EIFFEL_SRC/Delivery/studio/script/build_preference_entries.bat
   %EIFFEL_SRC%/Delivery/studio/lang/script/build_misc_entries.bat
   On Unix:
   On Unix:
   perl $EIFFEL_SRC/Delivery/studio/script/preference_po_extraction.pl
   perl $EIFFEL_SRC/Delivery/studio/lang/script/misc_po_extraction.pl
   msguniq -o ../po_files/estudio.pot ../po_files/estudio.pot
   msguniq -s -o $EIFFEL_SRC/Delivery/studio/lang/po_files/estudio.pot $EIFFEL_SRC/Delivery/studio/lang/po_files/estudio.pot
* Make sure etudio.pot file committed is generated from repository code. Do not commit estudio.pot that was generated from local code. Because other maintainers might override your changes that are not from repository. And modification of estudio.pot file by hand is not recommended.
* Carefully check estudio.pot file is correct before committing, because tranlators who work on estudio.pot with problem would probably lose their efforts when the correction is done.
* Commit the estudio.pot file to let translators to update.
* Commit the estudio.pot file to let translators to update.
* To add a new language support, simply copy estudio.pot to LOCALE_ID.po where LOCALE_ID should be:
* To add a new language support, simply copy estudio.pot to LOCALE_ID.po where LOCALE_ID should be:
   Case 1: LL-RR
   Case 1: LL_RR
   Case 2: LL-SS-RR
   Case 2: LL_SS_RR
   Case 3: LL_RR
   Case 3: LL_RR
   Case 4: LL_RR.Enc
   Case 4: LL_RR.Enc
Line 98: Line 151:
   SS under windows is mostly either 'Latn' or 'Cyrl'. @SS on linux is sometimes useful and sometimes meaningless
   SS under windows is mostly either 'Latn' or 'Cyrl'. @SS on linux is sometimes useful and sometimes meaningless


  List for reference:
=== Locale Id for reference ===
         aa
         Afrikaans (South Africa)        af-ZA       
         ab
         Amharic (Ethiopia)        am-ET       
         ace
         Arabic (U.A.E.)        ar-AE       
         ach
         Arabic (Bahrain)        ar-BH       
         ada
         Arabic (Algeria)        ar-DZ       
         ady
         Arabic (Egypt)        ar-EG       
         ae
         Arabic (Iraq)        ar-IQ       
         af
         Arabic (Jordan)        ar-JO       
         afa
         Arabic (Kuwait)        ar-KW       
         afh
         Arabic (Lebanon)        ar-LB       
         af_ZA
         Arabic (Libya)        ar-LY       
         ain
         Arabic (Morocco)        ar-MA          
         ak
         Arabic (Oman)         ar-OM          
         akk
         Arabic (Qatar)         ar-QA          
         ale
         Arabic (Saudi Arabia)         ar-SA          
         alg
         Arabic (Syria)         ar-SY       
         alt
         Arabic (Tunisia)         ar-TN          
         am
         Arabic (Yemen)         ar-YE          
         am_ET
         Mapudungun (Chile)         arn-CL          
         an
         Assamese (India)         as-IN          
         ang
         Azeri (Azerbaijan, Cyrillic)         az-Cyrl-AZ          
         anp
         Azeri (Azerbaijan, Latin)         az-Latn-AZ          
         apa
         Bashkir (Russia)         ba-RU          
         ar
         Belarusian (Belarus)         be-BY          
         arc
         Bulgarian (Bulgaria)         bg-BG          
         arn
         Bengali (India)         bn-IN          
         arp
         Tibetan (Bhutan)         bo-BT          
         art
         Tibetan (PRC)         bo-CN          
         arw
         Breton (France)         br-FR       
         as
         Bosnian (Bosnia and Herzegovina, Cyrillic)         bs-Cyrl-BA          
         ast
         Bosnian (Bosnia and Herzegovina, Latin)         bs-Latn-BA          
         ast_ES
         Catalan (Catalan)         ca-ES       
         ath
         Corsican (France)        co-FR          -- Note: Corsican is in the msdn table, but has no LCID - maybe in future releases it will get one (corsican nationalists might threaten to blow up Microsoft HQ)
         aus
         Czech (Czech Republic)        cs-CZ       
         av
         Welsh (United Kingdom)        cy-GB       
         awa
         Danish (Denmark)        da-DK       
         ay
         German (Austria)        de-AT       
         az
         German (Switzerland)        de-CH          
         az_IR
         German (Germany)         de-DE          
         ba
         German (Liechtenstein)         de-LI          
         bad
         German (Luxembourg)         de-LU          
         bai
         Lower Sorbian (Germany)         dsb-DE          
         bal
         Divehi (Maldives)         dv-MV          
         ban
         Greek (Greece)         el-GR          
         bas
         English (Caribbean)         en-029          
         bat
         English (Australia)         en-AU          
         be
         English (Belize)         en-BZ          
         bej
         English (Canada)         en-CA          
         bem
         English (United Kingdom)         en-GB          
        ber
         English (Ireland)         en-IE          
         bg
         English (India)         en-IN          
         bh
         English (Jamaica)         en-JM          
         bho
         English (Malaysia)         en-MY          
         bi
         English (New Zealand)         en-NZ          
         bik
         English (Philippines)         en-PH          
         bin
         English (Singapore)         en-SG          
         bla
         English (Trinidad and Tobago)         en-TT       
         bm
         English (United States)         en-US       
         bn
         English (South Africa)        en-ZA          
         bn_IN
         English (Zimbabwe)         en-ZW       
         bnt
         Spanish (Argentina)        es-AR       
         bo
         Spanish (Bolivia)        es-BO       
         br
        Spanish (Chile)         es-CL       
         bra
         Spanish (Colombia)         es-CO          
         bs
         Spanish (Costa Rica)         es-CR          
         btk
         Spanish (Dominican Republic)         es-DO          
         bua
         Spanish (Ecuador)         es-EC          
         bug
         Spanish (Spain)         es-ES          
         byn
         Spanish (Guatemala)         es-GT          
         C
         Spanish (Honduras)         es-HN          
         ca
         Spanish (Mexico)         es-MX          
         cad
         Spanish (Nicaragua)         es-NI          
         ca_ES
         Spanish (Panama)         es-PA          
         ca_ES@valencian
         Spanish (Peru)         es-PE          
         cai
         Spanish (Puerto Rico)         es-PR          
         car
         Spanish (Paraguay)         es-PY          
         cau
         Spanish (El Salvador)         es-SV          
         ce
         Spanish (United States)         es-US          
         ceb
         Spanish (Uruguay)         es-UY          
         cel
         Spanish (Venezuela)         es-VE          
         ch
         Estonian (Estonia)         et-EE          
         chb
         Basque (Basque)         eu-ES          
         chg
         Persian (Iran)         fa-IR          
         chk
         Finnish (Finland)         fi-FI          
         chm
         Filipino (Philippines)         fil-PH          
         chn
         Faroese (Faroe Islands)         fo-FO          
         cho
         French (Belgium)         fr-BE          
         chp
         French (Canada)         fr-CA          
         chr
         French (Switzerland)         fr-CH          
         chy
         French (France)         fr-FR          
         cmc
         French (Luxembourg)         fr-LU          
         co
         French (Monaco)         fr-MC          
         cop
         Frisian (Netherlands)         fy-NL          
         cpe
         Irish (Ireland)         ga-IE          
         cpf
         Dari (Afghanistan)         gbz-AF          
         cpp
         Galician (Spain)         gl-ES          
         cr
         Alsatian (France)         gsw-FR          
         crh
         Gujarati (India)         gu-IN          
         crp
         Hausa (Nigeria, Latin)         ha-Latn-NG          
         cs
         Hebrew (Israel)         he-IL          
         csb
         Hindi (India)         hi-IN          
         cs_CZ
         Croatian (Bosnia and Herzegovina, Latin)         hr-BA          
         cu
         Croatian (Croatia)         hr-HR          
         cus
         Hungarian (Hungary)         hu-HU          
         cv
         Armenian (Armenia)         hy-AM          
         cy
         Indonesian (Indonesia)         id-ID          
         da
         Igbo (Nigeria)         ig-NG          
         dak
         Yi (PRC)         ii-CN          
         dar
         Icelandic (Iceland)         is-IS          
         day
         Italian (Switzerland)         it-CH          
         de
         Italian (Italy)         it-IT          
         de_AT
         Inuktitut (Canada, Syllabics)         iu-Cans-CA          
         de_CH
         Inuktitut (Canada, Latin)         iu-Latn-CA          
         de_DE
         Japanese (Japan)         ja-JP          
         del
         Georgian (Georgia)         ka-GE          
         den
         Khmer (Cambodia)         kh-KH          
         dgr
         Kazakh (Kazakhstan)         kk-KZ          
         din
         Greenlandic (Greenland)         kl-GL          
         doi
         Kannada (India)         kn-IN          
         dra
         Korean (Korea)         ko-KR          
         dsb
         Konkani (India)         kok-IN          
         dua
         Kyrgyz (Kyrgyzstan)         ky-KG          
         dum
         Luxembourgish (Luxembourg)         lb-LU          
         dv
         Lao (Lao PDR)         lo-LA          
         dyu
         Lithuanian (Lithuania)         lt-LT          
         dz
         Latvian (Latvia)         lv-LV          
         ee
         Maori (New Zealand)         mi-NZ          
         efi
         Macedonian (Macedonia, FYROM)         mk-MK          
         egy
         Malayalam (India)         ml-IN          
         eka
         Mongolian (Mongolia)         mn-Cyrl-MN          
         el
         Mongolian (PRC)         mn-Mong-CN          
         el_GR
         Mohawk (Canada)         moh-CA          
         elx
         Marathi (India)         mr-IN          
         en
         Malay (Brunei Darussalam)         ms-BN          
         en_AU
         Malay (Malaysia)         ms-MY          
         en@boldquot
         Maltese (Malta)         mt-MT          
         en_CA
         Norwegian (Bokm?l, Norway)         nb-NO          
         en_GB
         Nepali (India)         ne-IN          --also missing   
         enm
         Nepali (Nepal)         ne-NP          
         en@quot
         Dutch (Belgium)         nl-BE          
         en_US
         Dutch (Netherlands)         nl-NL          
         eo
         Norwegian (Nynorsk, Norway)         nn-NO          
         es
         Sesotho sa Leboa/Northern Sotho (South Africa)         ns-ZA          
         es_AR
         Occitan (France)         oc-FR          
         es_CL
         Oriya (India)         or-IN       
         es_CO
         Punjabi (India)         pa-IN          
         es_CR
         Polish (Poland)         pl-PL          
         es_DO
         Pashto (Afghanistan)         ps-AF          
         es_EC
         Portuguese (Brazil)         pt-BR          
         es_ES
         Portuguese (Portugal)         pt-PT          
         es_GT
         K'iche (Guatemala)         qut-GT          
         es_HN
         Quechua (Bolivia)         quz-BO          
         es_MX
         Quechua (Ecuador)         quz-EC          
         es_NI
         Quechua (Peru)         quz-PE          
         es_PA
         Romansh (Switzerland)         rm-CH       
         es_PE
         Romanian (Romania)         ro-RO          
         es_PR
         Russian (Russia)         ru-RU          
         es_SV
         Kinyarwanda (Rwanda)         rw-RW       
         es_UY
        Sanskrit (India)         sa-IN       
         es_VE
         Yakut (Russia)         sah-RU       
         et
         Sami (Northern, Finland)        se-FI          
         et_EE
         Sami (Northern, Norway)         se-NO          
         eu
         Sami (Northern, Sweden)         se-SE          
         eu_ES
         Sinhala (Sri Lanka)         si-LK          
         ewo
         Slovak (Slovakia)         sk-SK          
         fa
         Slovenian (Slovenia)         sl-SI          
         fa_IR
         Sami (Southern, Norway)         sma-NO          
         fan
         Sami (Southern, Sweden)         sma-SE          
         fat
         Sami (Lule, Norway)         smj-NO          
         ff
         Sami (Lule, Sweden)         smj-SE       
         fi
        Sami (Inari, Finland)         smn-FI       
         fil
        Sami (Skolt, Finland)         sms-FI       
         fiu
         Albanian (Albania)         sq-AL          
         fj
         Serbian (Bosnia and Herzegovina, Cyrillic)         sr-Cyrl-BA          
         fo
         Serbian (Serbia and Montenegro, Cyrillic)         sr-Cyrl-CS       
         fon
         Serbian (Bosnia and Herzegovina, Latin)         sr-Latn-BA          
         fr
         Serbian (Serbia and Montenegro, Latin)         sr-Latn-CS          
         fr_BE
         Swedish (Finland)         sv-FI          
         fr_CA
         Swedish (Sweden)         sv-SE          
         fr_CH
         Swahili (Kenya)         sw-KE       
         fr_FR
        Syriac (Syria)         syr-SY       
         frm
        Tamil (India)         ta-IN       
         fro
         Telugu (India)         te-IN       
         frr
         Tajik (Tajikistan)         tg-Cyrl-TJ          
         frs
         Thai (Thailand)         th-TH          
         fur
         Turkmen (Turkmenistan)         tk-TM          
         fy
         Tamazight (Algeria, Latin)         tmz-Latn-DZ          
         ga
         Setswana/Tswana (South Africa)         tn-ZA       
         gaa
         Urdu (India)        tr-IN          
         gay
         Turkish (Turkey)         tr-TR          
         gba
         Tatar (Russia)         tt-RU          
         gd
         Uighur (PRC)         ug-CN          
         gem
         Ukrainian (Ukraine)         uk-UA          
         gez
         Urdu (Pakistan)         ur-PK          
         gil
         Uzbek (Uzbekistan, Cyrillic)         uz-Cyrl-UZ          
         gl
         Uzbek (Uzbekistan, Latin)         uz-Latn-UZ          
         gmh
         Vietnamese (Vietnam)         vi-VN       
         gn
         Upper Sorbian (Germany)        wen-DE       
         goh
         Wolof (Senegal)        wo-SN          
         gon
         Xhosa/isiXhosa (South Africa)         xh-ZA          
         gor
         Yoruba (Nigeria)         yo-NG          
         got
         Chinese (PRC)         zh-CN          
         gr
         Chinese (Hong Kong SAR, PRC)         zh-HK          
         grb
         Chinese (Macao SAR)         zh-MO          
         grc
         Chinese (Singapore)         zh-SG       
         gsw
         Chinese (Taiwan)         zh-TW          
         gu
         Zulu/isiZulu (South Africa)         zu-ZA
         gv
         gwi
         ha
         hai
         haw
         he
         he_IL
         hi
         hil
         him
         hit
         hmn
         ho
         hr
         hr_HR
         hsb
         ht
         hu
         hu_HU
         hup
         hy
         hz
         ia
         iba
         id
         ie
         ig
         ii
         ijo
         ik
         ilo
         inc
         ine
         inh
         io
         ira
         iro
         is
         it
         it_CH
         it_IT
         iu
         ja
         ja_JP
         jbo
         jpr
         jrb
         jv
         ka
         kaa
         kab
         kac
         kam
         kar
         kaw
         kbd
         kg
         kha
         khi
         kho
         ki
         kj
         kk
         kl
         km
         kmb
         kn
         ko
         kok
         ko_KR
         kos
         kpe
         kr
         krc
         krl
         kro
         kru
         ks
         ku
         kum
         kut
         kv
         kw
         ky
         la
         lad
         lah
         lam
         lb
         lez
         lg
         li
         ln
         lo
         lol
         loz
         lt
         lu
         lua
         lui
         lun
         luo
         lus
         lv
         mad
         mag
         mai
         mak
         man
         map
         mas
         mdf
         mdr
         men
         mg
         mga
         mh
         mi
         mic
         min
         mis
         mk
         mkh
         ml
         mn
         mnc
         mni
         mno
         mo
         moh
         mos
         mr
         ms
         mt
         mul
         mun
         mus
         mwl
         mwr
         my
         my_MM
         myn
         myv
         na
         nah
         nai
         nap
         nb
         nb_NO
         nd
         nds
         nds@NFE
         ne
         new
         ng
         nia
         nic
         niu
         nl
         nl_BE
         nl_NL
         nn
         no
         nog
         non
         nqo
         nr
         nso
         nub
         nv
         nwc
         ny
         nym
         nyn
         nyo
         nzi
         oc
         oj
         om
         or
         os
         osa
         ota
         oto
         pa
         paa
         pag
         pal
         pam
         pap
         pau
         peo
         phi
         phn
         pi
         pl
         pl_PL
         pon
         pra
         pro
         ps
         pt
         pt_BR
         pt_PT
         qu
         raj
         rap
         rar
         rm
         rn
         ro
         roa
         rom
         ru
         rup
         ru_RU
         rw
         sa
         sad
         sah
         sai
         sal
         sam
         sas
         sat
         sc
         scn
         sco
         sd
         se
         sel
         sem
         sg
         sga
         sgn
         shn
         si
         sid
         sio
         sit
         sk
         sl
         sla
         sl_SI
         sm
         sma
         smi
         smj
         smn
         sms
         sn
         snk
         so
         sog
         son
         sq
         sq_AL
         sr
         sr@ije
         sr@Latn
         srn
         srr
         ss
         ssa
         st
         su
         suk
         sus
         sux
         sv
         sv_SE
         sw
         syr
         ta
         tai
         te
         tem
         ter
         tet
         tg
         th
        ti
         tig
         tiv
         tk
         tkl
         tl
         tlh
         tli
         tmh
         tn
         to
         tog
         tpi
         tr
         ts
         tsi
         tt
         tum
         tup
         tut
         tvl
         tw
         ty
         tyv
         udm
         ug
         uga
         uk
         uk_UA
         umb
         und
        ur
         uz
        uz@Latn
         vai
         ve
         vi
         vo
         vot
         wa
         wak
         wal
         war
         was
         wen
         wo
         xal
         xh
         yao
         yap
         yi
         yo
         ypk
         za
         zap
         zen
         zh
         zh_CN
         zh_HK
         zh_TW
         znd
         zu
        zun

Latest revision as of 10:32, 7 July 2008

Overview

Since i18n have been mostly implemented in Eiffel, Eiffel Studio is coming into the new era of internationalization. The goal of i18n integration is to provide multiple language support in Eiffel Studio and let users switch languages of the interface easily at runtime.

Steps to integrate i18n

Non-editor part

The first step concentrates on the interface of Eiffel Studio. All buttons, labels, tool tips and grids that are directly used by Eiffel Studio project.

  1. Collect all static interface strings in the system., including some context dependent strings.
    1. This is not necessary, but doing this give us better management and code quality. Only INTERFACE_NAMES knows i18n.
    2. Change all types in INTERFACE_NAMES, EB_METRIC_NAMES, CONF_INTERFACE_NAMES, WARNING_MESSAGES to be STRING_GENERAL. Caller should be adapted correspondingly.For some stings, two versions maybe needed. One for internal use, the other one for the interface,especially for strings saved as preferences and strings constants used in configure XML files.
    3. Rewrite bodies of those strings using i18n translation routines, STRING_32 instances are actually produced.
    4. Modify places using EV_CONSTANTS, make new classes if needed. e.g. EV_CONFIRMATION_DIALOG; EV_WARNING_DIALOG are not usable.
    5. Write scripts to draw strings from default.xml. "Directory", names and descriptions of preferences are also needed to be translated.
    6. Write scripts to draw names of wizards from .dsc files, and translate interface names by code in wizard projects.
  2. Build language menus to switch language. (Choices have been done as a preference, and decided not to do observer pattern.)
    1. Make interface classes locale observers so that all tools know when interface names should be reread.
  3. Solve the problems in vision2.
    1. In Chinese, menu chars are conventionally parenthesized and under scored following the menu text. This can be done by the translator.
    2. Handle "&" as both char and wchar for menu items.
    3. Fix "tab" issue for menu items.
  4. Add string encoding conversion support in i18n library, with which correct translated stream can be direct to the console. And this would be usefull when doing the following editor part.
  5. Integrate i18n .po generation tool. It has been done in i18n branch. (po generation tool has been done a stand alone tool.)
  6. Use .po generation tool to generate estudio.pot file. The .po generation tool generally extracts strings that are taken as parameters of `translated' and `translated_plural' and produce .pot file.
  7. Since strings used in EiffelStudio not only come from the source code. Write scripts to extract them and merge them into estudio.pot. Strings should be extracted from: default.xml → descriptions of preferences
  8. Duplicate estudio.pot file to .po files with names of locale ids. Each .po file represents a locale. i18n library read .mo files with correct names of id. Though .po files are not necessary to have names of locale id, .mo files are one-to-one produced from .po files. So using locale ids as names of .po files is reasonable.
  9. Translators using .po editor open .po files and translate interface names to all kinds of languages.
  10. Generate .mo files using .mo generation script.

Editor part

Earlier glance

  1. This step might be more complicated. And will be done later after the first step. Probably after 6.0 release. This step concentrates on extending the editor library to accept wide characters. Internationalization of any output directed to the editor is done in the step. Many existing tools might be affected, search tool, formatting tools etc.
  2. Encoding conversion facility is needed.

More detailed plan

  • Editor library
    • Use UTF-32 internally in the editor (done)
    • Unicode supported Eiffel sanner (done)
    • Unicode text rendering (done)
    • Ability read all kinds of text format. This implies the editor is able to convert all kinds of format from and to Unicode. Attribute of `encoding' is needed. This also affects how to handle strings from IM.
    • Enabling IM of drawing area on GTK.
  • i18n library
    • Add ability to recognize context. `translation_with_context (original: STRING_GENERAL): STRING_32' and `plural_translation_with_context (original_singular, original_plural: STRING_GENERAL; plural_number: INTEGER): STRING_32' would be added.
    • Modify po generation tool to handle new interfaces.
  • GUI
    • A way to let the user decide which encoding should the editor use to read or save.
    • Search facility (ES part done, need Gobo backing)
    • Text Formatting
    • Code completion (80% done)
    • Refactoring tool/Text modifier -- diff library
    • Pick and Drop able grids (done, not tested)
  • Others
    • Unicode wild cards support
    • Unicode "as_lower", "is_alpha" and "is_digit" -- i.e. EB_TOKEN_TOOLKIT.
    • Unicode XML support. Handlers of ECFs and other XML based files that could be added Unicode chars must support Unicode encoding.
  • Compiler (Possible step, may lead to change of ECMA)
    • Choose an encoding that the parser works on. (UTF-8 probably)
    • Hence the compiler has to be able to convert all kinds of texts to the one it accepts.
    • Names heaps, queries and outputs need to be changed.
    • This may affect a lot of things, configuration, metrics etc.
    • Sync roundtrip parser against correct Unicode char positions. Now position bases on byte counts.
  • Documentation generation

Text Flow and Encoding (Design)

File structure

Repository

All files are stored in %EIFFEL_SRC%\Delivery\studio\lang

%EIFFEL_SRC%\Delivery\studio\lang\script

Place where scripts for generating .mo files are put. The scripts are invoked when building a delivery.

%EIFFEL_SRC%\Delivery\studio\lang\mo_files

Place to put .mo files. Those files are actually used at runtime.
Only .mo files need to be included in a delivery.

%EIFFEL_SRC%\Delivery\studio\lang\po_files

Place to put .pot file and .po files. 

Delivery

 Windows:
 %ISE_EIFFEL%\studio\lang\mo_files\*.mo
 Unix:
 /usr/share/locale/(product_version_name)/*.mo

Maintenance

General

  • .pot file is PO template file which is generated by .po generation tool. .pot file is simply untranslated file with only source entries and blank target entries.
  • .po files are the files translators actually work on. Whenever translators get a new version of .pot file, they should update .po file they are working on from the .pot file. Update is normally done by third party tools. Tools like poEdit give lists of new strings and obsolete strings. And in the full list new strings and fuzzy strings are marked in different colors by poEdit.
  • Fuzzy strings are applied when updating. msgmerge of Gettext make slightly changed strings fuzzy. When the checking of fuzzy strings is done, translators should remove fuzzy marks.
  • Obsolete strings are commented out at the end of .po files when merging. Those comments can be removed at anytime if we wish.
  • When the translation or modification is done, translators only need to commit .po file(s) that they are working on.
  • Whenever new languages are decided to add in. New .po file can be added directly in %EIFFEL_SRC%\Delivery\studio\lang\po_files. Eiffel Studio should have the ability to detect at runtime what languages are available.

Life Cycle

  1. Changes take place in code.(Developer)
  2. Syncronize local code from repository.(Maintainer)
  3. Run po_generation_tool with approperate arguments (Maintainer)
  4. Run build_misc_enties.bat (Maintainer)
  5. Commit estudio.pot from last step. (Maintainer)
  6. Update .po files from estudio.pot. (Translator)
  7. Translate and commit various .po files. (Translator)
  8. Build and commit .mo files. (Release maker in principle. Maintainer or Translator is also OK.)
  9. .mo files go with releases. (Release maker)

Translator Guide

  • Update $EIFFEL_SRC/Delivery.
  • Download a po editor. poEdit for Windows and KBabel or gtranslator for KDE and Gnome.
  • In $EIFFEL_SRC/Delivery/studio/lang/po_files, find out the .po file(s) one should work on. Take zh_CN.po as example. Open zh_CN.po in po editor. In the po editor, there should be a command to update from pot file. Update from $EIFFEL_SRC/Delivery/studio/lang/po_files/estudio.pot within the po editor. If there is any change took place in estudio.pot, the po editor should inform. The translator fills empty entries, solves FUZZY strings or modifies translated entries.
  • When the translation is done, just commit those modified po files.
  • Make sure that po files are saved in UTF-8 encoding.
  • Note that never try by hand to add or remove terms in .po files. Because other translators wouldn't see the changes if estudio.pot file were not updated.
  • Note that a translator should not modify estudio.pot file.

Developer Guide

  • The major thing a developer should take care of is code quality. All names need to be translated should in principle be put in framework/interface_names. Whenever a string of sentence is needed in the interface, just leave it as a sentence to be translated. Be careful to SEPERATE a sentence into terms or phrases, because ways to sequence those terms again into sentence vary in different languages. Plural form should be used whenever needed. There are a lot of examples in INTERFACE_NAMES.
  • If a developer wants to take changes into effect immediately, see what a maintainer and a translator should do.

Maintainer Guide

  • Build po generation tool which is located at internal svn repository $EIFFEL_SRC/tools/po_generation_tool.
  • Make sure gettext and perl is installed. On windows cygwin cantains perl and gettext modules.
  • When there are new or modified strings need to be translated in the code. $EIFFEL_SRC/Delivery/studio/lang/estudio.pot should be regenerated.
 To regenerate estudio.pot, one should do:
 po_generation_tool -D %EIFFEL_SRC%/Eiffel %EIFFEL_SRC%/framework %EIFFEL_SRC%/help/wizards %EIFFEL_SRC%/library/wizard -o %EIFFEL_SRC%/Delivery/studio/lang/po_files/estudio.pot
 On windows:
 %EIFFEL_SRC%/Delivery/studio/lang/script/build_misc_entries.bat
 On Unix:
 perl $EIFFEL_SRC/Delivery/studio/lang/script/misc_po_extraction.pl
 msguniq -s -o $EIFFEL_SRC/Delivery/studio/lang/po_files/estudio.pot $EIFFEL_SRC/Delivery/studio/lang/po_files/estudio.pot
  • Make sure etudio.pot file committed is generated from repository code. Do not commit estudio.pot that was generated from local code. Because other maintainers might override your changes that are not from repository. And modification of estudio.pot file by hand is not recommended.
  • Carefully check estudio.pot file is correct before committing, because tranlators who work on estudio.pot with problem would probably lose their efforts when the correction is done.
  • Commit the estudio.pot file to let translators to update.
  • To add a new language support, simply copy estudio.pot to LOCALE_ID.po where LOCALE_ID should be:
 Case 1: LL_RR
 Case 2: LL_SS_RR
 Case 3: LL_RR
 Case 4: LL_RR.Enc
 Case 5: LL_RR@SS  [sometimes the SS is simply variant information]
 LL is a two-letter language identifier from ISO 639-1 or, if there is none, a three-letter
 identifier from ISO 639-2/T
 RR is a two-letter country coding from ISO 3166-1, except when it is not (en-029 ('English (Carribean)') under Windows)
 SS under windows is mostly either 'Latn' or 'Cyrl'. @SS on linux is sometimes useful and sometimes meaningless

Locale Id for reference

       Afrikaans (South Africa)         af-ZA         
       Amharic (Ethiopia)         am-ET         
       Arabic (U.A.E.)         ar-AE         
       Arabic (Bahrain)         ar-BH         
       Arabic (Algeria)         ar-DZ         
       Arabic (Egypt)         ar-EG         
       Arabic (Iraq)         ar-IQ         
       Arabic (Jordan)         ar-JO         
       Arabic (Kuwait)         ar-KW         
       Arabic (Lebanon)         ar-LB         
       Arabic (Libya)         ar-LY         
       Arabic (Morocco)         ar-MA         
       Arabic (Oman)         ar-OM         
       Arabic (Qatar)         ar-QA         
       Arabic (Saudi Arabia)         ar-SA         
       Arabic (Syria)         ar-SY         
       Arabic (Tunisia)         ar-TN         
       Arabic (Yemen)         ar-YE         
       Mapudungun (Chile)         arn-CL         
       Assamese (India)         as-IN         
       Azeri (Azerbaijan, Cyrillic)         az-Cyrl-AZ         
       Azeri (Azerbaijan, Latin)         az-Latn-AZ         
       Bashkir (Russia)         ba-RU         
       Belarusian (Belarus)         be-BY         
       Bulgarian (Bulgaria)         bg-BG         
       Bengali (India)         bn-IN         
       Tibetan (Bhutan)         bo-BT         
       Tibetan (PRC)         bo-CN         
       Breton (France)         br-FR         
       Bosnian (Bosnia and Herzegovina, Cyrillic)         bs-Cyrl-BA         
       Bosnian (Bosnia and Herzegovina, Latin)         bs-Latn-BA         
       Catalan (Catalan)         ca-ES         
       Corsican (France)         co-FR          -- Note: Corsican is in the msdn table, but has no LCID - maybe in future releases it will get one (corsican nationalists might threaten to blow up Microsoft HQ)
       Czech (Czech Republic)         cs-CZ         
       Welsh (United Kingdom)         cy-GB         
       Danish (Denmark)         da-DK         
       German (Austria)         de-AT         
       German (Switzerland)         de-CH         
       German (Germany)         de-DE         
       German (Liechtenstein)         de-LI         
       German (Luxembourg)         de-LU         
       Lower Sorbian (Germany)         dsb-DE         
       Divehi (Maldives)         dv-MV         
       Greek (Greece)         el-GR         
       English (Caribbean)         en-029         
       English (Australia)         en-AU         
       English (Belize)         en-BZ         
       English (Canada)         en-CA         
       English (United Kingdom)         en-GB         
       English (Ireland)         en-IE         
       English (India)         en-IN         
       English (Jamaica)         en-JM         
       English (Malaysia)         en-MY         
       English (New Zealand)         en-NZ         
       English (Philippines)         en-PH         
       English (Singapore)         en-SG         
       English (Trinidad and Tobago)         en-TT         
       English (United States)         en-US         
       English (South Africa)         en-ZA         
       English (Zimbabwe)         en-ZW         
       Spanish (Argentina)         es-AR         
       Spanish (Bolivia)         es-BO         
       Spanish (Chile)         es-CL         
       Spanish (Colombia)         es-CO         
       Spanish (Costa Rica)         es-CR         
       Spanish (Dominican Republic)         es-DO         
       Spanish (Ecuador)         es-EC         
       Spanish (Spain)         es-ES         
       Spanish (Guatemala)         es-GT         
       Spanish (Honduras)         es-HN         
       Spanish (Mexico)         es-MX         
       Spanish (Nicaragua)         es-NI         
       Spanish (Panama)         es-PA         
       Spanish (Peru)         es-PE         
       Spanish (Puerto Rico)         es-PR         
       Spanish (Paraguay)         es-PY         
       Spanish (El Salvador)         es-SV         
       Spanish (United States)         es-US         
       Spanish (Uruguay)         es-UY         
       Spanish (Venezuela)         es-VE         
       Estonian (Estonia)         et-EE         
       Basque (Basque)         eu-ES         
       Persian (Iran)         fa-IR         
       Finnish (Finland)         fi-FI         
       Filipino (Philippines)         fil-PH         
       Faroese (Faroe Islands)         fo-FO         
       French (Belgium)         fr-BE         
       French (Canada)         fr-CA         
       French (Switzerland)         fr-CH         
       French (France)         fr-FR         
       French (Luxembourg)         fr-LU         
       French (Monaco)         fr-MC         
       Frisian (Netherlands)         fy-NL         
       Irish (Ireland)         ga-IE         
       Dari (Afghanistan)         gbz-AF         
       Galician (Spain)         gl-ES         
       Alsatian (France)         gsw-FR         
       Gujarati (India)         gu-IN         
       Hausa (Nigeria, Latin)         ha-Latn-NG         
       Hebrew (Israel)         he-IL         
       Hindi (India)         hi-IN         
       Croatian (Bosnia and Herzegovina, Latin)         hr-BA         
       Croatian (Croatia)         hr-HR         
       Hungarian (Hungary)         hu-HU         
       Armenian (Armenia)         hy-AM         
       Indonesian (Indonesia)         id-ID         
       Igbo (Nigeria)         ig-NG         
       Yi (PRC)         ii-CN         
       Icelandic (Iceland)         is-IS         
       Italian (Switzerland)         it-CH         
       Italian (Italy)         it-IT         
       Inuktitut (Canada, Syllabics)         iu-Cans-CA         
       Inuktitut (Canada, Latin)         iu-Latn-CA         
       Japanese (Japan)         ja-JP         
       Georgian (Georgia)         ka-GE         
       Khmer (Cambodia)         kh-KH         
       Kazakh (Kazakhstan)         kk-KZ         
       Greenlandic (Greenland)         kl-GL         
       Kannada (India)         kn-IN         
       Korean (Korea)         ko-KR         
       Konkani (India)         kok-IN         
       Kyrgyz (Kyrgyzstan)         ky-KG         
       Luxembourgish (Luxembourg)         lb-LU         
       Lao (Lao PDR)         lo-LA         
       Lithuanian (Lithuania)         lt-LT         
       Latvian (Latvia)         lv-LV         
       Maori (New Zealand)         mi-NZ         
       Macedonian (Macedonia, FYROM)         mk-MK         
       Malayalam (India)         ml-IN         
       Mongolian (Mongolia)         mn-Cyrl-MN         
       Mongolian (PRC)         mn-Mong-CN         
       Mohawk (Canada)         moh-CA         
       Marathi (India)         mr-IN         
       Malay (Brunei Darussalam)         ms-BN         
       Malay (Malaysia)         ms-MY         
       Maltese (Malta)         mt-MT         
       Norwegian (Bokm?l, Norway)         nb-NO         
       Nepali (India)         ne-IN          --also missing    
       Nepali (Nepal)         ne-NP         
       Dutch (Belgium)         nl-BE         
       Dutch (Netherlands)         nl-NL         
       Norwegian (Nynorsk, Norway)         nn-NO         
       Sesotho sa Leboa/Northern Sotho (South Africa)         ns-ZA         
       Occitan (France)         oc-FR         
       Oriya (India)         or-IN         
       Punjabi (India)         pa-IN         
       Polish (Poland)         pl-PL         
       Pashto (Afghanistan)         ps-AF         
       Portuguese (Brazil)         pt-BR         
       Portuguese (Portugal)         pt-PT         
       K'iche (Guatemala)         qut-GT         
       Quechua (Bolivia)         quz-BO         
       Quechua (Ecuador)         quz-EC         
       Quechua (Peru)         quz-PE         
       Romansh (Switzerland)         rm-CH         
       Romanian (Romania)         ro-RO         
       Russian (Russia)         ru-RU         
       Kinyarwanda (Rwanda)         rw-RW         
       Sanskrit (India)         sa-IN         
       Yakut (Russia)         sah-RU         
       Sami (Northern, Finland)         se-FI         
       Sami (Northern, Norway)         se-NO         
       Sami (Northern, Sweden)         se-SE         
       Sinhala (Sri Lanka)         si-LK         
       Slovak (Slovakia)         sk-SK         
       Slovenian (Slovenia)         sl-SI         
       Sami (Southern, Norway)         sma-NO         
       Sami (Southern, Sweden)         sma-SE         
       Sami (Lule, Norway)         smj-NO         
       Sami (Lule, Sweden)         smj-SE         
       Sami (Inari, Finland)         smn-FI         
       Sami (Skolt, Finland)         sms-FI         
       Albanian (Albania)         sq-AL         
       Serbian (Bosnia and Herzegovina, Cyrillic)         sr-Cyrl-BA         
       Serbian (Serbia and Montenegro, Cyrillic)         sr-Cyrl-CS         
       Serbian (Bosnia and Herzegovina, Latin)         sr-Latn-BA         
       Serbian (Serbia and Montenegro, Latin)         sr-Latn-CS         
       Swedish (Finland)         sv-FI         
       Swedish (Sweden)         sv-SE         
       Swahili (Kenya)         sw-KE         
       Syriac (Syria)         syr-SY         
       Tamil (India)         ta-IN         
       Telugu (India)         te-IN         
       Tajik (Tajikistan)         tg-Cyrl-TJ         
       Thai (Thailand)         th-TH         
       Turkmen (Turkmenistan)         tk-TM         
       Tamazight (Algeria, Latin)         tmz-Latn-DZ         
       Setswana/Tswana (South Africa)         tn-ZA         
       Urdu (India)         tr-IN         
       Turkish (Turkey)         tr-TR         
       Tatar (Russia)         tt-RU         
       Uighur (PRC)         ug-CN         
       Ukrainian (Ukraine)         uk-UA         
       Urdu (Pakistan)         ur-PK         
       Uzbek (Uzbekistan, Cyrillic)         uz-Cyrl-UZ         
       Uzbek (Uzbekistan, Latin)         uz-Latn-UZ         
       Vietnamese (Vietnam)         vi-VN         
       Upper Sorbian (Germany)         wen-DE         
       Wolof (Senegal)         wo-SN         
       Xhosa/isiXhosa (South Africa)         xh-ZA         
       Yoruba (Nigeria)         yo-NG         
       Chinese (PRC)         zh-CN         
       Chinese (Hong Kong SAR, PRC)         zh-HK         
       Chinese (Macao SAR)         zh-MO         
       Chinese (Singapore)         zh-SG         
       Chinese (Taiwan)         zh-TW         
       Zulu/isiZulu (South Africa)         zu-ZA