Hello squeakers,
i'm squeak newbie and i often watch at squeak's progress always with the hope of being able to drop the barrier of it's scarce documentation doing something using something useful with it and contributing back to the community which has create this incredble environment. Some qualities of squeak repeatly led me to involve some amount of time in it, always without so much luck. I think it could be the best environment for the kids i know to learn programming, also my syster works with neuropsychiatrysts to help impaired children learn by using some kind of commercial tools which let the operator create, merge and show a kind of simple iconic alphabet that helps the learning of concepts (if i recall, she call it something like 'augmentative communication'). The fact that these tools are commercial inhibits the spreading of such "advanced" learning tecniques. I think that a similar and even more powerful environment can be setup for the operator by using squeak. But i think also that a key need for squeak to be usable and adopted both by "normal" kids and by operators and impaired children is the translation of the standard environment in their mother tongue (e.g. italian for me). Recently, i got the time to also try out Tweak, which i find so good and much more understandable, even without so much docs:) , so i "revamped" my idea of contribute an italian translation to squeak, in order to try "teaching" it, to some extent. I do know and use some "standard tools" to deal with translations like gettext, emacs po-mode (and the others) and svn or darcs for versioning. With some friends we have set up a public repository of translations along with a complete wiki help to let non-developer people contribute to the translation process in a manageable way ( http://docit.bice.dyndns.org ) i do not known the reasons under "reinventing the wheel" with tools like the language editor when there are so many good tools to deal with translations, even with multi-byte character sets like japan's one. I can only immagine that these other tools don't represent the "squeak way" of doing things. However this not the point.. the point is that the "squeak way" of coordinate a translation between a group of people that want to contribute, like sharing in progress translation resources, isn't still clear to me nor it seems to be documented (it is?) and to be frank, it was not so simple to understand how to add an another language to the image, due to outdated docs. More than that, i have a group of people that want to contribute to the translation and they are already familiar with the tools above, so my willing is to reuse that infrastructure. I want to translate the squeak's standard full image, the one which is downloaded by the normal user most of the time, not the small-land image or the squeakland one, because it is the "default" image downloaded by a new user which approaches squeak. So my desire is to do the following things: 1) Learn how to add italian to the multiligual infrastructure; 2) do an export in gettext's po mode; 3) reuse stantard po tools and svn and the site docit.bice.dyndns.org to coordinate the effort; 4) import the translation back to the image; 5) prepare a squackmap package to let normal users load the italian translation; For the point 1), the swiki has very old informations, but i learned how to do that with the email from Yoshiki at http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-February/100956.html I downloaded that image and i found that it has and improved language editor with and added butto "new" which adds a new LocaleID and thus enables a new translation. The interesting code is: LocaleID isoString: 'it' Aside from having a specific button to do it, evaluating that code in a workspace even in the standard image does the right job, and then is possible to open a language editor for that language code. I'll update the swiki asap with this information:) The point 2) is much more difficoult though. I tried the gettext export both in the standard image and in the squeaklanddev's one withouth any luck. An error box comes up, saying that #GetTextExport is not a key into 'Smalltalk' dictionary (i think it's a kind of global one). a quick googling for that problem showed that there is a bug filed already for it at http://bugs.impara.de/view.php?id=1744 in stat 'new' since august. It says that the missing classes are available into the small-land image. How it's possible to highilight the differences between the standard image, the squeaklanddev one and the small-land one and backport these missing features to the standard one? I really do not know yet and i've still to read the doc if there is one on that subject so i tried another approach. I told to me.. "maybe if i can find a repository with the sources available as a monticello repo i can be able to load such missing parts from there and also track future development". So i visited Yoshiki's site, quite unuseful, and then SqueakSource site, looking for something interesting. I found the "LanguageEditor" project (http://www.squeaksource.com/LanguageEditor.html)! Wow "i found it", i've said to me! Sadly, after loading the code with monticello i found that it is quite old comapared to the features available on newer images! So finally my question is: there is a way to track sources of such a widely intersring topic like traslations in consitent or affordable way? do you publish your sources somewhere guys? I don't want to start a flame but it would be quite simple in other communities and generally translations and translation-infrastructure are considered a key thing to share in open source projects. thanks in advance, Alberto |
Best Alberto,
Im a squeak newbie too ... I wholehartedly agree with your post. I also have tried to (start) with translating to my native language (dutch) so squeak would be more accessable to my kids, but i have not come very far. Ik think the NaturalLanguageTranslator/Editor in images 3.7 - 3.9 is broken. There is some kind of working copy in the squeakland image (there was a previous post of mine on this topic), but i havent succeeded in translating something exporting and importing in another image (if that is possible at all?). And doing the translation with the Editor is not very handy process... (no offense). Since squeak and Smalltalk are still mazes to me, i havent found out how to work with this. If you know ways to make this process better (gettext method sounds very good), i would be glad to help / assist in any way i can. What i would also like to know: "Alberto Berti" <[hidden email]> wrote in message news:[hidden email]... > Hello squeakers, >How it's possible to highilight the differences between the standard image, >the squeaklanddev one and the small-land one and backport these missing >features to the standard one? I really do not know yet and i've still to >read the doc if there is one on that subject so i tried another approach. and >[Is] there is a way to track sources of such a widely >intersring topic like traslations in consitent or affordable way? do you >publish your sources somewhere guys? NOTE: this is all positve critisism - i love squeak and admire all tricks you guys perfom... ;) Best - Jeroen "Alberto Berti" <[hidden email]> wrote in message news:[hidden email]... > Hello squeakers, > <snip> > > But i think also that a key need for squeak to be usable and adopted both > by "normal" kids and by operators and impaired children is the translation > of the standard environment in their mother tongue (e.g. italian for me). > <snip> > > So my desire is to do the following things: > > 1) Learn how to add italian to the multiligual infrastructure; > 2) do an export in gettext's po mode; > 3) reuse stantard po tools and svn and the site docit.bice.dyndns.org to > coordinate the effort; > 4) import the translation back to the image; > 5) prepare a squackmap package to let normal users load the italian > translation; > |
Jeroen van Hilst wrote:
> Best Alberto, > > Im a squeak newbie too ... > > I wholehartedly agree with your post. I also have tried to (start) with > translating to my native language (dutch) so squeak > would be more accessable to my kids, but i have not come very far. > > Ik think the NaturalLanguageTranslator/Editor in images 3.7 - 3.9 is broken. it not seems so to me. There are some glitches though. > And doing the translation with the Editor is not very handy process... (no > offense). > yes, it's true, a fillInTheBlank isn't really so comfortable, especially for long sentences. I must say however that the Small-Land image is in a much better shape from the point of translation support. Also the different and much more readable font it uses by default helps. > Since squeak and Smalltalk are still mazes to me, i havent found out how to > work with this. > > If you know ways to make this process better (gettext method sounds very > good), i would be glad to help / assist in any way i can. I've made some other steps... :) I've prepared two changesets with changes coming from the SqueakLand-dev image and from the SmallLand's one. To load them, save them on disk, open a vanilla 3.8 image, take a Filelist from the tools flap and "install" them in order. If all goes well, you should be able to open a LanguageEditor which let you insert a new LocaleID via the "new" button (just like the Squeakland-dev image) and export/import translation to/from gettext format using the "gettext" button backported from the SmallLand image. Tell me how it work. Still no news on how to "package" translations, but it's not a so urgent question if we have gettext. Please pay attention that this is my first try at changeset preparing:) So there can be mistakes and bugs. But it seems to do its job It seems that there are still some encoding problems on the exported file, but it may be a problem of my platform. I've started doing some translation. It seems that when a LaguageEditor is open now the execution slows down.. i don't know if it will happen also to you, let me know. As soon as you close the LanguageEditor, the slow down ends.. Maybe someone with better insights can review my changesets? >>[Is] there is a way to track sources of such a widely >>intersring topic like traslations in consitent or affordable way? do you >>publish your sources somewhere guys? > > > NOTE: this is all positve critisism - i love squeak and admire all tricks > you guys perfom... ;) > It wants to be positive also from me, but sadly no one answered :-/ cheers, Alberto 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 2 March 2006 at 4:13:29 pm'! "Change Set: nihongo7Language Date: 22 July 2005 Author: Takashi Yamamiya, Noose Toru, and Yoshiki Ohshima The changes related to language features. These are: * LanguageEditor and NaturalLanguageTranslator for better saving and usability. * Better multi byte true type font handling with project saving. * JapaneseEnvironment and MultiByteBinaryOrTextStream default changes. * SecurityManager knows the interpreted path name. "! Object subclass: #ISOLanguageDefinition instanceVariableNames: 'iso3 iso2 iso3Alternate language ' classVariableNames: 'ISO2Table ISO3Table ISOCountries ISO3Countries ISO2Countries ' poolDictionaries: '' category: 'System-Localization'! Object subclass: #LanguageEnvironment instanceVariableNames: 'id translator ' classVariableNames: 'ClipboardInterpreterClass Current FileNameConverterClass InputInterpreterClass KnownEnvironments SystemConverterClass ' poolDictionaries: '' category: 'Multilingual-Languages'! !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 14:06'! buildIso3166CodesTables "ISOLanguageDefinition buildIso3166CodesTables" | rawdata stream country isoa2 isoa3 unNumeric macName macCode windowsName windowsCode empty table | rawdata := self iso3166Codes. table := OrderedCollection new: 200. stream := rawdata readStream. empty := 160 asCharacter asString. [stream atEnd] whileFalse: [country := stream nextLine. isoa2 := stream nextLine. isoa3 := stream nextLine. unNumeric := stream nextLine. windowsName := stream nextLine. windowsName = empty ifTrue: [windowsName := nil]. windowsCode := stream nextLine. windowsCode = empty ifTrue: [windowsCode := nil]. macName := stream nextLine. macName = empty ifTrue: [macName := nil]. macCode := stream nextLine. macCode = empty ifTrue: [macCode := nil]. table add: { country. isoa2. isoa3. unNumeric. windowsName. windowsCode. macName. macCode. }]. ^table! ! !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 14:14'! extraCountryDefinitions ^{ {'Kids'. 'KIDS'. 'KIDS'.}. }! ! !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 14:12'! initISOCountries "ISOLanguageDefinition initISOCountries" | iso3166Table | iso3166Table := ISOLanguageDefinition buildIso3166CodesTables. ISO2Countries := Dictionary new. ISO3Countries := Dictionary new. iso3166Table do: [:entry | ISO2Countries at: (entry at: 2) put: (entry at: 1). ISO3Countries at: (entry at: 3) put: (entry at: 1)]. self extraCountryDefinitions do: [:entry | ISO2Countries at: (entry at: 2) put: (entry at: 1). ISO3Countries at: (entry at: 3) put: (entry at: 1)]! ! !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 14:18'! iso2Countries "ISOLanguageDefinition iso2Countries" "ISO2Countries := nil. ISO3Countries := nil" ISO2Countries ifNil: [self initISOCountries]. ^ISO2Countries! ! !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 13:57'! iso3166Codes "http://www.unicode.org/onlinedat/countries.html" ^'à LAND ISLANDS AX     AFGHANISTAN AF AFG 004     ALBANIA AL ALB 008 CTRY_ALBANIA 355   ALGERIA DZ DZA 012 CTRY_ALGERIA 213 verArabic 16 AMERICAN SAMOA AS ASM 016     ANDORRA AD AND 020     ANGOLA AO AGO 024     ANGUILLA AI AIA 660     ANTARCTICA AQ ATA 010     ANTIGUA AND BARBUDA AG ATG 028     ARGENTINA AR ARG 032 CTRY_ARGENTINA 54   ARMENIA AM ARM 051 CTRY_ARMENIA 374 verArmenian 84 ARUBA AW ABW 533     AUSTRALIA AU AUS 036 CTRY_AUSTRALIA 61 verAustralia 15 AUSTRIA AT AUT 040 CTRY_AUSTRIA 43 verAustria 92 AZERBAIJAN AZ AZE 031 CTRY_AZERBAIJAN 994   BAHAMAS BS BHS 044     BAHRAIN BH BHR 048 CTRY_BAHRAIN 973   BANGLADESH BD BGD 050   verBengali 60 BARBADOS BB BRB 052     BELARUS BY BLR 112 CTRY_BELARUS 375   BELGIUM BE BEL 056 CTRY_BELGIUM 32 verFrBelgium, verFlemish 98 BELIZE BZ BLZ 084 CTRY_BELIZE 501   BENIN BJ BEN 204     BERMUDA BM BMU 060     BHUTAN BT BTN 064   verBhutan 83 BOLIVIA BO BOL 068 CTRY_BOLIVIA 591   BOSNIA AND HERZEGOVINA BA BIH 070     BOTSWANA BW BWA 072     BOUVET ISLAND BV BVT 074     BRAZIL BR BRA 076 CTRY_BRAZIL 55 verBrazil 71 BRITISH INDIAN OCEAN TERRITORY IO IOT 086     BRUNEI DARUSSALAM BN BRN 096 CTRY_BRUNEI_DARUSSALAM 673   BULGARIA BG BGR 100 CTRY_BULGARIA 359 verBulgaria 72 BURKINA FASO BF BFA 854     BURUNDI BI BDI 108     CAMBODIA KH KHM 116     CAMEROON CM CMR 120     CANADA CA CAN 124 CTRY_CANADA 2 verFrCanada, verEndCanada 82 CAPE VERDE CV CPV 132     CAYMAN ISLANDS KY CYM 136     CENTRAL AFRICAN REPUBLIC CF CAF 140     CHAD TD TCD 148     CHILE CL CHL 152 CTRY_CHILE 56   CHINA CN CHN 156 CTRY_PRCHINA 86 verChina 52 CHRISTMAS ISLAND CX CXR 162     COCOS (KEELING) ISLANDS CC CCK 166     COLOMBIA CO COL 170 CTRY_COLOMBIA 57   COMOROS KM COM 174     CONGO CG COG 178     CONGO, THE DEMOCRATIC REPUBLIC OF THE CD     COOK ISLANDS CK COK 184     COSTA RICA CR CRI 188 CTRY_COSTA_RICA 506   COTE D''IVOIRE CI CIV 384     CROATIA (local name: Hrvatska) HR HRV 191 CTRY_CROATIA 385 verCroatia, verYugoCroatian 68 (c), 25 (y) CUBA CU CUB 192     CYPRUS CY CYP 196   verCyprus 23 CZECH REPUBLIC CZ CZE 203 CTRY_CZECH 420 verCzech 56 DENMARK DK DNK 208 CTRY_DENMARK 45 verDenmark(da), verFaeroeIsl(fo) 9(da), 47(fo) DJIBOUTI DJ DJI 262     DOMINICA DM DMA 212     DOMINICAN REPUBLIC DO DOM 214 CTRY_DOMINICAN_REPUBLIC 1   EAST TIMOR TL TLS 626     ECUADOR EC ECU 218 CTRY_ECUADOR 593   EGYPT EG EGY 818 CTRY_EGYPT 20 verArabic 16 EL SALVADOR SV SLV 222 CTRY_EL_SALVADOR 503   EQUATORIAL GUINEA GQ GNQ 226     ERITREA ER ERI 232     ESTONIA EE EST 233 CTRY_ESTONIA 372 verEstonia 44 ETHIOPIA ET ETH 210     FALKLAND ISLANDS (MALVINAS) FK FLK 238     FAROE ISLANDS FO FRO 234 CTRY_FAEROE_ISLANDS 298   FIJI FJ FJI 242     FINLAND FI FIN 246 CTRY_FINLAND 358 verFinland 17 FRANCE FR FRA 250 CTRY_FRANCE 33 verFrance 1 FRANCE, METROPOLITAN FX FXX 249     FRENCH GUIANA GF GUF 254     FRENCH POLYNESIA PF PYF 258     FRENCH SOUTHERN TERRITORIES TF ATF 260     GABON GA GAB 266     GAMBIA GM GMB 270     GEORGIA GE GEO 268 CTRY_GEORGIA 995 verGeorgian 85 GERMANY DE DEU 276 CTRY_GERMANY 49 verGermany 3 GHANA GH GHA 288     GIBRALTAR GI GIB 292     GREECE GR GRC 300 CTRY_GREECE 30 verGreece, verGreecePoly 20, 40 GREENLAND GL GRL 304   verGreenland 107 GRENADA GD GRD 308     GUADELOUPE GP GLP 312     GUAM GU GUM 316     GUATEMALA GT GTM 320 CTRY_GUATEMALA 502   GUINEA GN GIN 324     GUINEA-BISSAU GW GNB 624     GUYANA GY GUY 328     HAITI HT HTI 332     HEARD ISLAND & MCDONALD ISLANDS HM HMD 334     HONDURAS HN HND 340 CTRY_HONDURAS 504   HONG KONG HK HKG 344 CTRY_HONG_KONG 852   HUNGARY HU HUN 348 CTRY_HUNGARY 36 verHungary 43 ICELAND IS ISL 352 CTRY_ICELAND 354 verIceland 21 INDIA IN IND 356 CTRY_INDIA 91 verIndiaHindi(hi) 33 INDONESIA ID IDN 360 CTRY_INDONESIA 62   IRAN, ISLAMIC REPUBLIC OF IR IRN 364 CTRY_IRAN 981 verIran 48 IRAQ IQ IRQ 368 CTRY_IRAQ 964 verArabic 16 IRELAND IE IRL 372 CTRY_IRELAND 353 verIreland 50 ISRAEL IL ISR 376 CTRY_ISRAEL 972 verIsrael 13 ITALY IT ITA 380 CTRY_ITALY 39 verItaly 4 JAMAICA JM JAM 388 CTRY_JAMAICA 1   JAPAN JP JPN 392 CTRY_JAPAN 81 verJapan 14 JORDAN JO JOR 400 CTRY_JORDAN 962   KAZAKHSTAN KZ KAZ 398 CTRY_KAZAKSTAN 7   KENYA KE KEN 404 CTRY_KENYA 254   KIRIBATI KI KIR 296     KOREA, DEMOCRATIC PEOPLE''S REPUBLIC OF KP PRK 408   verKorea 51 KOREA, REPUBLIC OF KR KOR 410 CTRY_SOUTH_KOREA 82 verKorea  KUWAIT KW KWT 414 CTRY_KUWAIT 965   KYRGYZSTAN KG KGZ 417 CTRY_KYRGYZSTAN 996   LAO PEOPLE''S DEMOCRATIC REPUBLIC LA LAO 418     LATVIA LV LVA 428 CTRY_LATVIA 371 verLatvia 45 LEBANON LB LBN 422 CTRY_LEBANON 961   LESOTHO LS LSO 426     LIBERIA LR LBR 430     LIBYAN ARAB JAMAHIRIYA LY LBY 434 CTRY_LIBYA 218 verArabic 16 LIECHTENSTEIN LI LIE 438 CTRY_LIECHTENSTEIN 41   LITHUANIA LT LTU 440 CTRY_LITHUANIA 370 verLithuania 41 LUXEMBOURG LU LUX 442 CTRY_LUXEMBOURG 352 verFrBelgiumLux 6 MACAU MO MAC 446 CTRY_MACAU 853   MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF MK MKD 807 CTRY_MACEDONIA 389 verMacedonian  MADAGASCAR MG MDG 450     MALAWI MW MWI 454     MALAYSIA MY MYS 458 CTRY_MALAYSIA 60   MALDIVES MV MDV 462 CTRY_MALDIVES 960   MALI ML MLI 466     MALTA MT MLT 470   verMalta 22 MARSHALL ISLANDS MH MHL 584     MARTINIQUE MQ MTQ 474     MAURITANIA MR MRT 478     MAURITIUS MU MUS 480     MAYOTTE YT MYT 175     MEXICO MX MEX 484 CTRY_MEXICO 52   MICRONESIA, FEDERATED STATES OF FM FSM 583     MOLDOVA, REPUBLIC OF MD MDA 498     MONACO MC MCO 492 CTRY_MONACO 33   MONGOLIA MN MNG 496 CTRY_MONGOLIA 976   MONTSERRAT MS MSR 500     MOROCCO MA MAR 504 CTRY_MOROCCO 212 verArabic 16 MOZAMBIQUE MZ MOZ 508     MYANMAR MM MMR 104     NAMIBIA NA NAM 516     NAURU NR NRU 520     NEPAL NP NPL 524   verNepal 106 NETHERLANDS NL NLD 528 CTRY_NETHERLANDS 31 verNetherlands 5 NETHERLANDS ANTILLES AN ANT 530     NEW CALEDONIA NC NCL 540     NEW ZEALAND NZ NZL 554 CTRY_NEW_ZEALAND 64   NICARAGUA NI NIC 558 CTRY_NICARAGUA 505   NIGER NE NER 562     NIGERIA NG NGA 566     NIUE NU NIU 570     NORFOLK ISLAND NF NFK 574     NORTHERN MARIANA ISLANDS MP MNP 580     NORWAY NO NOR 578 CTRY_NORWAY 47 verNorway 12 OMAN OM OMN 512 CTRY_OMAN 968   PAKISTAN PK PAK 586 CTRY_PAKISTAN 92 verPakistanUrdu, verPunjabi 34 (U), 95 (P) PALAU PW PLW 585     PANAMA PA PAN 591 CTRY_PANAMA 507   PALESTINIAN TERRITORY, OCCUPIED PS   PAPUA NEW GUINEA PG PNG 598     PARAGUAY PY PRY 600 CTRY_PARAGUAY 595   PERU PE PER 604 CTRY_PERU 51   PHILIPPINES PH PHL 608 CTRY_PHILIPPINES 63   PITCAIRN PN PCN 612     POLAND PL POL 616 CTRY_POLAND 48 verPoland 42 PORTUGAL PT PRT 620 CTRY_PORTUGAL 351 verPortugal 10 PUERTO RICO PR PRI 630 CTRY_PUERTO_RICO 1   QATAR QA QAT 634 CTRY_QATAR 974   REUNION RE REU 638     ROMANIA RO ROU* 642 CTRY_ROMANIA 40 verRomania 39 RUSSIAN FEDERATION RU RUS 643 CTRY_RUSSIA 7 verRussia 49 RWANDA RW RWA 646     SAINT KITTS AND NEVIS KN KNA 659     SAINT LUCIA LC LCA 662     SAINT VINCENT AND THE GRENADINES VC VCT 670     SAMOA WS WSM 882     SAN MARINO SM SMR 674     SAO TOME AND PRINCIPE ST STP 678     SAUDI ARABIA SA SAU 682 CTRY_SAUDI_ARABIA 966 verArabic 16 SENEGAL SN SEN 686     SERBIA AND MONTENEGRO CS   CTRY_SERBIA 381   SEYCHELLES SC SYC 690     SIERRA LEONE SL SLE 694     SINGAPORE SG SGP 702 CTRY_SINGAPORE 65 verSingapore 100 SLOVAKIA (Slovak Republic) SK SVK 703 CTRY_SLOVAK 421 verSlovak 57 SLOVENIA SI SVN 705 CTRY_SLOVENIA 386 verSlovenian 66 SOLOMON ISLANDS SB SLB 90     SOMALIA SO SOM 706     SOUTH AFRICA ZA ZAF 710 CTRY_SOUTH_AFRICA 27   SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS GS   SPAIN ES ESP 724 CTRY_SPAIN 34 verSpain 8 SRI LANKA LK LKA 144     SAINT HELENA SH SHN 654     SAINT PIERRE AND MIQUELON PM SPM 666     SUDAN SD SDN 736     SURINAME SR SUR 740     SVALBARD AND JAN MAYEN ISLANDS SJ SJM 744     SWAZILAND SZ SWZ 748     SWEDEN SE SWE 752 CTRY_SWEDEN 46 verSweden 7 SWITZERLAND CH CHE 756 CTRY_SWITZERLAND 41 verFrSwiss(fr), verGrSwiss(de) 18(fr), 19(de) SYRIAN ARAB REPUBLIC SY SYR 760 CTRY_SYRIA 963   TAIWAN, PROVINCE OF CHINA TW TWN 158 CTRY_TAIWAN 886 verTaiwan 53 TAJIKISTAN TJ TJK 762     TANZANIA, UNITED REPUBLIC OF TZ TZA 834     TATARSTAN  CTRY_TATARSTAN 7   THAILAND TH THA 764 CTRY_THAILAND 66 verThailand 54 TIMOR-LESTE TL     TOGO TG TGO 768     TOKELAU TK TKL 772     TONGA TO TON 776   verTonga 88 TRINIDAD AND TOBAGO TT TTO 780 CTRY_TRINIDAD_Y_TOBAGO 1   TUNISIA TN TUN 788 CTRY_TUNISIA 216 verArabic 16 TURKEY TR TUR 792 CTRY_TURKEY 90 verTurkey 24 TURKMENISTAN TM TKM 795     TURKS AND CAICOS ISLANDS TC TCA 796     TUVALU TV TUV 798     UGANDA UG UGA 800     UKRAINE UA UKR 804 CTRY_UKRAINE 380 verUkraine 62 UNITED ARAB EMIRATES AE ARE 784 CTRY_UAE 971   UNITED KINGDOM GB GBR 826 CTRY_UNITED_KINGDOM 44 verBritain 2 UNITED STATES US USA 840 CTRY_UNITED_STATES 1 verUS 0 UNITED STATES MINOR OUTLYING ISLANDS UM UMI 581     URUGUAY UY URY 858 CTRY_URUGUAY 598   UZBEKISTAN UZ UZB 860 CTRY_UZBEKISTAN 7   VANUATU VU VUT 548     VATICAN CITY STATE (HOLY SEE) VA VAT 336     VENEZUELA VE VEN 862 CTRY_VENEZUELA 58   VIET NAM VN VNM 704 CTRY_VIET_NAM 84 verVietnam  VIRGIN ISLANDS (BRITISH) VG VGB 92     VIRGIN ISLANDS (U.S.) VI VIR 850     WALLIS AND FUTUNA ISLANDS WF WLF 876     WESTERN SAHARA EH ESH 732     YEMEN YE YEM 887 CTRY_YEMEN 967   YUGOSLAVIA YU YUG 891     ZAIRE ZR ZAR 180     ZAMBIA ZM ZMB 894     ZIMBABWE ZW ZWE 716 CTRY_ZIMBABWE 263   '! ! !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 14:18'! iso3Countries "ISOLanguageDefinition iso3Countries" "ISO2Countries := nil. ISO3Countries := nil" ISO3Countries ifNil: [self initISOCountries]. ^ISO3Countries! ! !LanguageEditor methodsFor: 'gui methods' stamp: 'yo 11/29/2005 11:20'! codeSelectedTranslationAsMimeString | keys code tmpStream s2 gzs cont | keys := selectedTranslations collect: [:key | self translations at: key]. code := String streamContents: [:aStream | self translator fileOutOn: aStream keys: keys]. tmpStream _ MultiByteBinaryOrTextStream on: ''. tmpStream converter: UTF8TextConverter new. translator fileOutHeaderOn: tmpStream. tmpStream nextPutAll: code. s2 _ RWBinaryOrTextStream on: ''. gzs := GZipWriteStream on: s2. tmpStream reset. gzs nextPutAll: (tmpStream binary contentsOfEntireFile asString) contents. gzs close. s2 reset. cont _ String streamContents: [:strm | strm nextPutAll: '"Gzip+Base64 encoded translation for;'; cr. strm nextPutAll: '#('. keys do: [:each | strm nextPutAll: '''', each, ''' '.]. strm nextPutAll: ')"'; cr; cr. strm nextPutAll: 'NaturalLanguageTranslator loadForLocaleIsoString: '. strm nextPut: $'. strm nextPutAll: translator localeID isoString. strm nextPut: $'. strm nextPutAll: ' fromGzippedMimeLiteral: '. strm nextPut: $'. strm nextPutAll: (Base64MimeConverter mimeEncode: s2) contents. strm nextPutAll: '''.'. strm cr. ]. (StringHolder new contents: cont) openLabel: 'exported codes in Gzip+Base64 encoding'! ! !LanguageEditor methodsFor: 'gui methods' stamp: 'tak 9/14/2005 10:42'! newTranslations "private - try to apply the translations as much as possible all over the image" | result newID | result := FillInTheBlank request: 'New locale ID string?' initialAnswer: Locale current determineLocaleID isoString. result isEmpty ifTrue: ["Do nothing" ^ self]. newID := LocaleID isoString: result. NaturalLanguageTranslator newLocaleID: (LocaleID isoString: result). self class openOn: newID! ! !LanguageEditor methodsFor: 'initialization - toolbar' stamp: 'AB 3/2/2006 15:55'! createMainToolbar "create a toolbar for the receiver" | toolbar | toolbar := self createRow. "" " toolbar addMorphBack: (self createUpdatingButtonWording: #debugWording action: #switchDebug help: 'Switch the debug flag')." toolbar addTransparentSpacerOfSize: 5 @ 0. "" toolbar addMorphBack: (self createButtonLabel: 'new' action: #newTranslations help: 'Create translations for new language.'). toolbar addMorphBack: (self createButtonLabel: 'save' action: #saveToFile help: 'Save the translations to a file'). toolbar addMorphBack: (self createButtonLabel: 'load' action: #loadFromFile help: 'Load the translations from a file'). toolbar addMorphBack: (self createButtonLabel: 'merge' action: #mergeFromFile help: 'Merge the current translations with the translations in a file'). "" toolbar addTransparentSpacerOfSize: 5 @ 0. toolbar addMorphBack: (self createButtonLabel: 'apply' action: #applyTranslations help: 'Apply the translations as much as possible.'). "" toolbar addTransparentSpacerOfSize: 5 @ 0. toolbar addMorphBack: (self createButtonLabel: 'check translations' action: #check help: 'Check the translations and report the results.'). toolbar addMorphBack: (self createButtonLabel: 'report' action: #report help: 'Create a report.'). toolbar addMorphBack: (self createButtonLabel: 'gettext' action: #getText help: 'Interface with gettext.'). "" ^ toolbar! ! !LanguageEditor class methodsFor: 'instance creation' stamp: 'tak 9/7/2005 23:21'! on: localeID "answer an instance of the receiver on aLanguage" (NaturalLanguageTranslator availableLanguageLocaleIDs includes: localeID) ifFalse: [self error: ('Translator for {1} is not found' translated format: {localeID})]. ^ self new initializeOn: (NaturalLanguageTranslator availableForLocaleID: localeID)! ! !LanguageEditor class methodsFor: 'opening' stamp: 'TN 4/8/2005 01:13'! openOnDefault "open the receiver on the default language" self openOn: LocaleID current! ! !LanguageEnvironment class methodsFor: 'accessing' stamp: 'tak 9/14/2005 10:43'! localeID: localeID "LanguageEnvironment localeID: (LocaleID isoString: 'ja-kid')" "LanguageEnvironment localeID: (LocaleID isoString: 'xx')" ^ self knownEnvironments at: localeID ifAbsent: [localeID hasParent ifTrue: [self knownEnvironments at: localeID parent ifAbsent: [self localeID: (LocaleID isoLanguage: 'en')]] ifFalse: [self localeID: (LocaleID isoLanguage: 'en')]]! ! !LanguageEnvironment class methodsFor: 'private' stamp: 'yo 11/29/2005 13:33'! initKnownEnvironments "LanguageEnvironment initKnownEnvironments" | env known id | known := Dictionary new. self allSubclassesDo: [:subClass | subClass supportedLanguages do: [:language | env := subClass new. id _ LocaleID isoString: language. env localeID: id. known at: id put: env]]. ^known! ! !JapaneseEnvironment class methodsFor: 'subclass responsibilities' stamp: 'tetha 7/13/2005 00:44'! inputInterpreterClass | platformName osVersion encoding | platformName := SmalltalkImage current platformName. osVersion := SmalltalkImage current getSystemAttribute: 1002. (platformName = 'Win32' and: [osVersion = 'CE']) ifTrue: [^ MacRomanInputInterpreter]. platformName = 'Win32' ifTrue: [^ WinShiftJISInputInterpreter]. platformName = 'Mac OS' ifTrue: [^ (('10*' match: SmalltalkImage current osVersion) and: [(SmalltalkImage current getSystemAttribute: 3) isNil]) ifTrue: [MacUnicodeInputInterpreter] ifFalse: [MacShiftJISInputInterpreter]]. platformName = 'unix' ifTrue: [encoding := X11Encoding encoding. (EUCJPTextConverter encodingNames includes: encoding) ifTrue: [^ UnixEUCJPInputInterpreter]. (UTF8TextConverter encodingNames includes: encoding) ifTrue: [^ UnixUTF8JPInputInterpreter]. (ShiftJISTextConverter encodingNames includes: encoding) ifTrue: [^ MacShiftJISInputInterpreter]]. ^ MacRomanInputInterpreter! ! !Locale methodsFor: 'system primitives' stamp: 'mir 8/31/2005 17:36'! primCountry "Returns string with country tag according to ISO 639" <primitive: 'primitiveCountry' module: 'LocalePlugin'> ^nil! ! !Locale methodsFor: 'system primitives' stamp: 'mir 8/17/2005 15:53'! primLanguage "returns string with language tag according to ISO 639" <primitive:'primitiveLanguage' module: 'LocalePlugin'> ^nil! ! !Locale methodsFor: 'accessing' stamp: 'mir 8/31/2005 17:03'! determineLocale self localeID: self determineLocaleID! ! !Locale methodsFor: 'accessing' stamp: 'tak 9/8/2005 01:45'! determineLocaleID "Locale current determineLocaleID" | isoLang isoCountry | isoLang := self fetchISO2Language ifNil: [^ self localeID]. isoCountry := self fetchISOCountry ifNil: [^ LocaleID isoLanguage: isoLang]. ^ LocaleID isoLanguage: isoLang isoCountry: isoCountry! ! !Locale methodsFor: 'private' stamp: 'mir 8/31/2005 17:36'! fetchISO2Language "Locale current fetchISO2Language" | lang isoLang | lang := self primLanguage. lang ifNil: [^nil]. lang := lang copyUpTo: 0 asCharacter. lang size == 2 ifTrue: [^lang]. isoLang := ISOLanguageDefinition iso3LanguageDefinition: lang. ^isoLang ifNil: [nil] ifNotNil: [isoLang iso2]! ! !Locale methodsFor: 'private' stamp: 'tak 9/8/2005 01:47'! fetchISOCountry "Locale current fetchISOCountry" | countryCode | countryCode := self primCountry ifNil: [^ nil]. ^ countryCode copyUpTo: 0 asCharacter! ! !Locale class methodsFor: 'accessing' stamp: 'mir 8/31/2005 17:36'! current "Current := nil" Current ifNil: [ Current := self determineCurrentLocale. "Transcript show: 'Current locale: ' , Current localeID asString; cr"]. ^Current! ! !Locale class methodsFor: 'accessing' stamp: 'tak 9/7/2005 23:24'! switchTo: locale "Locale switchTo: (Locale isoLanguage: 'de')" | availableID | availableID := (NaturalLanguageTranslator availableForLocaleID: locale localeID) localeID. Current localeID = availableID ifFalse: [CurrentPlatform := Current := Locale localeID: availableID. self localeChanged]! ! !Locale class methodsFor: 'private' stamp: 'mir 7/28/2005 00:24'! determineCurrentLocale "For now just return the default locale. A smarter way would be to determine the current platforms default locale." "Locale determineCurrentLocale" ^self new determineLocale! ! !Locale class methodsFor: 'class initialization' stamp: 'mir 8/31/2005 17:00'! initialize "Locale initialize" Smalltalk addToStartUpList: Locale. Preferences addPreference: #useLocale categories: #('general') default: false balloonHelp: 'Use the system locale to set the system language etc at startup'.! ! !Locale class methodsFor: 'system startUp' stamp: 'tak 9/2/2005 15:06'! startUp: resuming | newID | resuming ifFalse: [^self]. (Preferences valueOfFlag: #useLocale) ifTrue: [ newID := self current determineLocaleID. newID ~= LocaleID current ifTrue: [self switchAndInstallFontToID: newID]]! ! !LocaleID methodsFor: 'accessing' stamp: 'mir 9/1/2005 14:17'! displayCountry ^(ISOLanguageDefinition iso2Countries at: self isoCountry asUppercase ifAbsent: [ self isoCountry ]) ! ! !MultiByteBinaryOrTextStream class methodsFor: 'defaults' stamp: 'yo 2/25/2005 20:04'! defaultConverter ^ Latin1TextConverter new. ! ! !NaturalLanguageTranslator methodsFor: 'translation' stamp: 'tak 9/7/2005 23:45'! translate: aString ^ self generics at: aString ifAbsent: [self class registeredPhraseFor: aString. self changed: #untranslated. self localeID hasParent ifTrue: [self class translate: aString to: self localeID parent] ifFalse: [aString]]! ! !NaturalLanguageTranslator methodsFor: 'user interface' stamp: 'yo 9/9/2005 17:27'! fileOutHeaderOn: aStream aStream binary. UTF8TextConverter writeBOMOn: aStream. aStream text. aStream nextChunkPut: self fileOutHeader; cr. aStream timeStamp; cr. aStream nextPut: $!!. aStream nextChunkPut: '(' , self class name , ' localeID: ' , id storeString , ')'. aStream cr! ! !NaturalLanguageTranslator methodsFor: 'fileIn/fileOut' stamp: 'yo 2/25/2005 09:37'! writeAsMimeString | fileName fileStream tmpStream s2 gzs | tmpStream _ MultiByteBinaryOrTextStream on: ''. tmpStream converter: UTF8TextConverter new. self fileOutOn: tmpStream. s2 _ RWBinaryOrTextStream on: ''. gzs := GZipWriteStream on: s2. tmpStream reset. gzs nextPutAll: (tmpStream binary contentsOfEntireFile asString) contents. gzs close. s2 reset. fileName _ id isoString, '.translation.gz.mime'. fileStream _ FileStream newFileNamed: fileName. fileStream nextPutAll: (Base64MimeConverter mimeEncode: s2) contents. fileStream close. ! ! !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/14/2005 11:37'! availableForLocaleID: localeID "Answer available locale ID. If translator is not found for correct locale ID, then isoLanguage is attempted for the key." ^ self cachedTranslations at: localeID ifAbsent: [localeID hasParent ifTrue: [self cachedTranslations at: localeID parent ifAbsent: [self default]] ifFalse: [self default]]! ! !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/7/2005 23:08'! default "Answer translator for backstop" "self default translate: 'test'" ^ self new localeID: (LocaleID isoLanguage: 'en')! ! !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/15/2005 02:08'! localeID: localeID "For backward compatibility, see NaturalLanguageTranslator >> fileOutHeaderOn:." ^ self newLocaleID: localeID! ! !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/7/2005 23:17'! newLocaleID: localeID ^ self cachedTranslations at: localeID ifAbsentPut: [self new localeID: localeID]! ! !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/8/2005 00:39'! removeLocaleID: localeID "self removeLocaleID: (LocaleID isoString: 'ja-kids')" ^ self cachedTranslations removeKey: localeID ifAbsent: []! ! !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/7/2005 21:53'! translate: aString to: localeID ^ (self availableForLocaleID: localeID) translate: aString! ! !NaturalLanguageTranslator class methodsFor: 'class initialization' stamp: 'tak 9/8/2005 00:56'! startUp: resuming resuming ifFalse: [^ self]. self loadAvailableExternalLocales! ! !NaturalLanguageTranslator class methodsFor: 'file-services' stamp: 'tak 3/14/2005 15:51'! loadForLocaleIsoString: localeString fromGzippedMimeLiteral: mimeString "merge the translation from the mime literal." | stream localeID translator gs rbStream s currentPlatform | s := Base64MimeConverter mimeDecodeToBytes: mimeString readStream. s reset. gs := GZipReadStream on: s. rbStream := MultiByteBinaryOrTextStream with: gs contents asString. rbStream converter: UTF8TextConverter new. rbStream reset. localeID := LocaleID isoString: localeString. currentPlatform := Locale currentPlatform. [Locale currentPlatform: (Locale localeID: localeID). stream := ReadStream on: rbStream contents] ensure: [Locale currentPlatform: currentPlatform]. translator := self localeID: localeID. translator loadFromStream: stream. LanguageEnvironment resetKnownEnvironments! ! !NaturalLanguageTranslator class methodsFor: 'private loading' stamp: 'tak 9/7/2005 23:17'! loadTranslatorForIsoLanguage: isoLanguage isoCountry: isoCountry "private - load the translations from <prefs>/locale/ directory the procedure is to assure the existence of a translator for the given language/country and then load the external translations for this translator" | translator | translator := self newLocaleID: (LocaleID isoLanguage: isoLanguage isoCountry: isoCountry). self loadExternalTranslationsFor: translator! ! !NaturalLanguageTranslator class methodsFor: 'private' stamp: 'mir 8/31/2005 16:55'! cleanUpCache "NaturalLanguageTranslator cleanUpCache" self cachedTranslations keys do: [:key | key isoLanguage size > 2 ifTrue: [self cachedTranslations removeKey: key]]! ! !Project methodsFor: 'language' stamp: 'mir 9/1/2005 00:37'! localeID "Answer the natural language for the project" | prev | ^ self projectParameterAt: #localeID ifAbsentPut: [ (prev _ self previousProject) ifNotNil: [prev projectParameterAt: #localeID ifAbsent: [LocaleID current]] ifNil: [LocaleID current]]! ! !SecurityManager methodsFor: 'accessing' stamp: 'tak 3/15/2005 00:45'! primSecureUserDirectory <primitive: 'primitiveGetSecureUserDirectory' module: 'SecurityPlugin'> ^ nil! ! !SecurityManager methodsFor: 'accessing' stamp: 'tak 3/15/2005 00:46'! secureUserDirectory "SecurityManager default secureUserDirectory" | dir | dir := self primSecureUserDirectory. ^ dir ifNil: [FileDirectory default pathName] ifNotNil: [(FilePath pathName: dir isEncoded: true) asSqueakPathName]! ! !String methodsFor: 'translating' stamp: 'tak 9/7/2005 23:00'! translated "answer the receiver translated to the default language" ^ self translatedTo: LocaleID current! ! !String methodsFor: 'translating' stamp: 'tak 9/7/2005 12:07'! translatedTo: localeID "answer the receiver translated to the given locale id" ^ NaturalLanguageTranslator translate: self to: localeID! ! !ByteString methodsFor: 'comparing' stamp: 'tak 11/6/2005 22:38'! primitiveFindSubstring: key in: body startingAt: start matchTable: matchTable "Answer the index in the string body at which the substring key first occurs, at or beyond start. The match is determined using matchTable, which can be used to effect, eg, case-insensitive matches. If no match is found, zero will be returned. The algorithm below is not optimum -- it is intended to be translated to C which will go so fast that it wont matter." | index | <primitive: 'primitiveFindSubstring' module: 'MiscPrimitivePlugin'> self var: #key declareC: 'unsigned char *key'. self var: #body declareC: 'unsigned char *body'. self var: #matchTable declareC: 'unsigned char *matchTable'. key size = 0 ifTrue: [^ 0]. start to: body size - key size + 1 do: [:startIndex | index _ 1. [(matchTable at: (body at: startIndex+index-1) asciiValue + 1) = (matchTable at: (key at: index) asciiValue + 1)] whileTrue: [index = key size ifTrue: [^ startIndex]. index _ index+1]]. ^ 0 " ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 1 matchTable: CaseSensitiveOrder 1 ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 2 matchTable: CaseSensitiveOrder 7 ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 8 matchTable: CaseSensitiveOrder 0 ' ' findSubstring: 'abc' in: 'abcdefABcd' startingAt: 2 matchTable: CaseSensitiveOrder 0 ' ' findSubstring: 'abc' in: 'abcdefABcd' startingAt: 2 matchTable: CaseInsensitiveOrder 7 "! ! !TextStyle methodsFor: 'fonts and font indexes' stamp: 'yo 3/17/2005 11:10'! addNewFontSize: pointSize "Add a font in specified size to the array of fonts." | f d newArray t isSet fallbackStyle | fontArray first emphasis ~= 0 ifTrue: [ t _ TextConstants at: self fontArray first familyName asSymbol. t fonts first emphasis = 0 ifTrue: [ ^ t addNewFontSize: pointSize. ]. ]. pointSize <= 0 ifTrue: [^ nil]. fontArray do: [:s | s pointSize = pointSize ifTrue: [^ s]. ]. (isSet _ fontArray first isKindOf: TTCFontSet) ifTrue:[ | fonts | fonts _ fontArray first fontArray collect: [ :font | | newFont | (font isNil) ifTrue: [newFont _ nil] ifFalse: [ newFont _ (font ttcDescription size > 256) ifTrue: [MultiTTCFont new initialize] ifFalse: [TTCFont new initialize]. newFont ttcDescription: font ttcDescription. newFont pixelSize: pointSize * 96 // 72. font derivativeFonts notEmpty ifTrue: [font derivativeFonts do: [ :proto | proto ifNotNil: [ d _ proto class new initialize. d ttcDescription: proto ttcDescription. d pixelSize: newFont pixelSize. newFont derivativeFont: d]]]. ]. newFont]. f _ TTCFontSet newFontArray: fonts] ifFalse: [ f _ TTCFont new initialize. f ttcDescription: fontArray first ttcDescription. f pointSize: pointSize. fontArray first derivativeFonts do: [:proto | proto ifNotNil: [ d _ TTCFont new initialize. d ttcDescription: proto ttcDescription. d pointSize: f pointSize. f derivativeFont: d. ]. ]. ]. isSet ifFalse: [ fallbackStyle _ TextStyle named: (fontArray first fallbackFont textStyleName). ]. newArray _ ((fontArray copyWith: f) asSortedCollection: [:a :b | a pointSize <= b pointSize]) asArray. self newFontArray: newArray. isSet ifTrue: [ TTCFontSet register: newArray at: newArray first familyName asSymbol. ]. isSet ifFalse: [ f setupDefaultFallbackFontTo: fallbackStyle. f derivativeFonts do: [:g | g setupDefaultFallbackFontTo: fallbackStyle]. ]. ^ self fontOfPointSize: pointSize ! ! !TTCFont methodsFor: 'objects from disk' stamp: 'yo 3/17/2005 11:21'! objectForDataStream: refStrm | dp | "I am about to be written on an object file. Write a reference to a known FontSet in the other system instead." "a path to me" dp _ DiskProxy global: #TTCFont selector: #familyName:pointSize:emphasis: args: {self familyName. self pointSize. self emphasis}. refStrm replace: self with: dp. ^ dp. ! ! !TTCFont class methodsFor: 'instance creation' stamp: 'yo 8/1/2005 15:06'! familyName: n pointSize: s emphasis: code "(TTCFont familyName: 'BitstreamVeraSans' pointSize: 12 emphasis: 0)" | t ret index | t _ self registry at: n asSymbol ifAbsent: [#()]. t isEmpty ifTrue: [ t _ (TextConstants at: #DefaultTextStyle) fontArray. ret _ t first. ret pointSize >= s ifTrue: [^ ret emphasis: code]. index _ 2. [index <= t size and: [(t at: index) pointSize <= s]] whileTrue: [ ret _ t at: index. index _ index + 1. ]. ^ ret emphasis: code. ]. ^ ((TextStyle named: n) addNewFontSize: s) emphasis: code. ! ! !TTCFont class methodsFor: 'other' stamp: 'yo 3/17/2005 11:11'! registerAll " TTCFont registerAll " TextStyle allInstancesDo: [:e | (e fontArray first isMemberOf: TTCFont) ifTrue: [ self register: e fontArray at: e fontArray first familyName asSymbol. ]. ]. ! ! !TTCFont class methodsFor: 'other' stamp: 'yo 3/17/2005 10:52'! register: anObject at: symbolName self registry at: symbolName put: anObject. ! ! !TTCFont class methodsFor: 'other' stamp: 'yo 3/17/2005 10:52'! registry ^ Registry isNil ifTrue: [Registry := IdentityDictionary new] ifFalse: [Registry]. ! ! !TTCFont class methodsFor: 'other' stamp: 'yo 3/17/2005 10:53'! unregister: symbolName self registry removeKey: symbolName ifAbsent: []. ! ! !WideSymbol class methodsFor: 'instance creation' stamp: 'tak 9/14/2005 11:07'! newFromStream: s "Use WideString rather than 'super' to avoid making multiple instance of WideSymbol" ^ self intern: (WideString newFromStream: s)! ! NaturalLanguageTranslator class removeSelector: #current! NaturalLanguageTranslator class removeSelector: #isoLanguage:! NaturalLanguageTranslator class removeSelector: #isoLanguage:isoCountry:! LocaleID class removeSelector: #default! Locale initialize! Object subclass: #LanguageEnvironment instanceVariableNames: 'id' classVariableNames: 'ClipboardInterpreterClass Current FileNameConverterClass InputInterpreterClass KnownEnvironments SystemConverterClass' poolDictionaries: '' category: 'Multilingual-Languages'! ISOLanguageDefinition class removeSelector: #convertISOCountriesFrom:! ISOLanguageDefinition class removeSelector: #isoCountries! ISOLanguageDefinition class removeSelector: #isoCountryString! ISOLanguageDefinition class removeSelector: #readISOCountriesFrom:! Object subclass: #ISOLanguageDefinition instanceVariableNames: 'iso3 iso2 iso3Alternate language' classVariableNames: 'ISO2Countries ISO2Table ISO3Countries ISO3Table' poolDictionaries: '' category: 'System-Localization'! "Postscript: " ISOLanguageDefinition initISOCountries. ! 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 2 March 2006 at 4:13:34 pm'! "Change Set: percentEncodingFix Date: 22 September 2005 Author: Korakurider + When Squeak is launched by openning .pr file, passed filename is systemString (shift-jis on windows for instance). That has to be converted to Squeak-native string. + reimplementation of decoding percent-encoded-string has to be modified to support utf8 based encoding. "! Object subclass: #GetTextInterchange instanceVariableNames: 'language stream' classVariableNames: '' poolDictionaries: '' category: 'Babel-Kernel'! GetTextInterchange subclass: #GetTextExporter instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Babel-Kernel'! GetTextInterchange subclass: #GetTextImporter instanceVariableNames: 'msgId msgStr' classVariableNames: '' poolDictionaries: '' category: 'Babel-Kernel'! KeyboardInputInterpreter subclass: #MacUnicodeInputInterpreter instanceVariableNames: 'keyValueIndex ' classVariableNames: '' poolDictionaries: '' category: 'Multilingual-TextConversion'! !ButtonProperties methodsFor: 'accessing' stamp: 'yo 11/30/2005 14:20'! establishEtoyLabelWording "Set the label wording, unless it has already been manually edited" | itsName | self isTileScriptingElement ifFalse: [^self]. itsName _ target externalName. self addTextToButton: itsName, ' ', arguments first. visibleMorph setBalloonText: ('click to run the script "{1}" in player named "{2}"' translated format: {arguments first. itsName}). ! ! !CharacterScanner methodsFor: 'scanning' stamp: 'tak 11/8/2005 11:25'! scanCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta | startEncoding selector | (sourceString isByteString) ifTrue: [^ self basicScanCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta.]. (sourceString isWideString) ifTrue: [ startIndex > stopIndex ifTrue: [lastIndex _ stopIndex. ^ stops at: EndOfRun]. startEncoding _ (sourceString at: startIndex) leadingChar. selector _ EncodedCharSet scanSelectorAt: startEncoding. ^ self perform: selector withArguments: (Array with: startIndex with: stopIndex with: sourceString with: rightX with: stopConditions with: kernDelta). ]. ^ stops at: EndOfRun ! ! !EncodedCharSet class methodsFor: 'class methods' stamp: 'tak 11/5/2005 18:14'! charFromUnicode: unicode | table index | unicode < 128 ifTrue: [^ Character value: unicode]. table _ self ucsTable. index _ table indexOf: unicode. index = 0 ifTrue: [ ^ nil. ]. ^ Character leadingChar: self leadingChar code: index - 1. ! ! !EncodedCharSet class methodsFor: 'class methods' stamp: 'tak 11/8/2005 11:19'! scanSelectorAt: encoding | charset | charset := self charsetAt: encoding. ^ charset ifNil: [LanguageEnvironment scanSelector] ifNotNil: [charset scanSelector]! ! !EncodedCharSet class methodsFor: 'accessing - displaying' stamp: 'tak 11/8/2005 11:26'! scanSelector ^ #scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:! ! !GetTextInterchange methodsFor: 'as yet unclassified'! defaultFileName ^ language displayLanguage , '.po'! ! !GetTextInterchange methodsFor: 'as yet unclassified'! formatReplacements | t1 | t1 := OrderedCollection new. ^ t1! ! !GetTextInterchange methodsFor: 'as yet unclassified'! formatString: t1 | t2 | t2 := t1. self formatReplacements do: [:t3 | t2 := t2 copyReplaceAll: t3 key with: t3 value]. ^ t2! ! !GetTextExporter methodsFor: 'as yet unclassified'! createHeaders | t1 | t1 := OrderedCollection new. t1 add: 'Project-Id-Version' -> 'Small-Land'. t1 add: 'POT-Creation-Date' -> self currentDateAndTime. t1 add: 'PO-Revision-Date' -> self currentDateAndTime. t1 add: 'Last-Translator' -> ''. t1 add: 'Language-Team' -> ''. t1 add: 'MIME-Version' -> '1.0'. t1 add: 'Content-Type' -> 'text/plain; charset=ISO-8859-1'. t1 add: 'Content-Transfer-Encoding' -> '8bit'. ^ t1! ! !GetTextExporter methodsFor: 'as yet unclassified'! currentDateAndTime ^ String streamContents: [:t1 | t1 nextPutAll: Date today yyyymmdd; space. Time now print24: true showSeconds: false on: t1. t1 nextPutAll: '-0000']! ! !GetTextExporter methodsFor: 'as yet unclassified'! exportHeader self exportMsgId: ''. self exportMsgStr: ''. self createHeaders do: [:t1 | self exportHeaderLineKey: t1 key value: t1 value]. stream cr; cr! ! !GetTextExporter methodsFor: 'as yet unclassified'! exportHeaderLineKey: t1 value: t2 stream nextPut: $"; nextPutAll: t1; nextPut: $:; space; nextPutAll: t2; nextPutAll: '\n'; nextPut: $"; cr! ! !GetTextExporter methodsFor: 'as yet unclassified'! exportMsgId: t1 stream nextPutAll: 'msgid'; space; nextPut: $"; nextPutAll: (self formatString: t1); nextPut: $"; cr! ! !GetTextExporter methodsFor: 'as yet unclassified'! exportMsgStr: t1 stream nextPutAll: 'msgstr'; space; nextPut: $"; nextPutAll: (self formatString: t1); nextPut: $"; cr! ! !GetTextExporter methodsFor: 'as yet unclassified'! exportPhrase: t1 translation: t2 t1 isEmpty ifTrue: [^ self]. self exportMsgId: t1. self exportMsgStr: t2. stream cr! ! !GetTextExporter methodsFor: 'as yet unclassified'! exportTranslations language translations keysAndValuesDo: [:t1 :t2 | self exportPhrase: t1 translation: t2]! ! !GetTextExporter methodsFor: 'as yet unclassified'! exportUntranslated language untranslated do: [:t1 | self exportPhrase: t1 translation: '']! ! !GetTextExporter methodsFor: 'as yet unclassified'! export: t1 language := t1. [stream := CrLfFileStream forceNewFileNamed: self defaultFileName. stream lineEndConvention: #lf. stream converter: Latin1TextConverter new. self exportHeader. self exportTranslations. self exportUntranslated] ensure: [stream close]! ! !GetTextExporter methodsFor: 'as yet unclassified'! formatReplacements | t1 | t1 := super formatReplacements. t1 add: '\' -> '\\'. t1 add: String cr -> '\n'. t1 add: String tab -> '\t'. t1 add: '"' -> '\"'. ^ t1! ! !GetTextImporter methodsFor: 'as yet unclassified'! formatReplacements | t1 | t1 := super formatReplacements. t1 add: '\\' -> '\'. t1 add: '\n' -> String cr. t1 add: '\t' -> String tab. t1 add: '\"' -> '"'. ^ t1! ! !GetTextImporter methodsFor: 'as yet unclassified'! import: t1 language := t1. [stream := StandardFileStream oldFileNamed: self defaultFileName. stream text. self parse] ensure: [stream notNil ifTrue: [stream close]]! ! !GetTextImporter methodsFor: 'as yet unclassified'! parse | t1 | [stream atEnd] whileFalse: [t1 := stream upTo: Character linefeed. self parseLine: t1]! ! !GetTextImporter methodsFor: 'as yet unclassified'! parseLine: t1 (t1 beginsWith: 'msgid') ifTrue: [self parseMsgId: t1. ^ self]. (t1 beginsWith: 'msgstr') ifTrue: [self parseMsgStr: t1. ^ self]. self storeTranslation! ! !GetTextImporter methodsFor: 'as yet unclassified'! parseMsgId: t1 msgId := self parseMsgSection: 'msgid' line: t1! ! !GetTextImporter methodsFor: 'as yet unclassified'! parseMsgSection: t1 line: t2 | t3 t4 t5 | t3 := t2 withBlanksTrimmed. t4 := (t3 allButFirst: t1 size) withBlanksTrimmed. t5 := t4 allButFirst allButLast. ^ t5! ! !GetTextImporter methodsFor: 'as yet unclassified'! parseMsgStr: t1 msgStr := self parseMsgSection: 'msgstr' line: t1! ! !GetTextImporter methodsFor: 'as yet unclassified'! storeTranslation msgId isNil | msgStr isNil ifTrue: [^ self]. msgId isEmpty ifTrue: [^ self]. NaturalLanguageTranslator registerPhrase: msgId. msgStr isEmpty ifFalse: [language phrase: msgId translation: (self formatString: msgStr)]. msgId := nil. msgStr := nil! ! !HTTPDownloadRequest methodsFor: 'initialize' stamp: 'KR 9/4/2005 10:33'! for: aUrl in: aLoader url _ aUrl. loader _ aLoader. semaphore _ Semaphore new.! ! !LanguageEditor methodsFor: 'gui methods' stamp: 'yo 11/29/2005 11:20'! codeSelectedTranslationAsMimeString | keys code tmpStream s2 gzs cont | keys := selectedTranslations collect: [:key | self translations at: key]. code := String streamContents: [:aStream | self translator fileOutOn: aStream keys: keys]. tmpStream _ MultiByteBinaryOrTextStream on: ''. tmpStream converter: UTF8TextConverter new. translator fileOutHeaderOn: tmpStream. tmpStream nextPutAll: code. s2 _ RWBinaryOrTextStream on: ''. gzs := GZipWriteStream on: s2. tmpStream reset. gzs nextPutAll: (tmpStream binary contentsOfEntireFile asString) contents. gzs close. s2 reset. cont _ String streamContents: [:strm | strm nextPutAll: '"Gzip+Base64 encoded translation for;'; cr. strm nextPutAll: '#('. keys do: [:each | strm nextPutAll: '''', each, ''' '.]. strm nextPutAll: ')"'; cr; cr. strm nextPutAll: 'NaturalLanguageTranslator loadForLocaleIsoString: '. strm nextPut: $'. strm nextPutAll: translator localeID isoString. strm nextPut: $'. strm nextPutAll: ' fromGzippedMimeLiteral: '. strm nextPut: $'. strm nextPutAll: (Base64MimeConverter mimeEncode: s2) contents. strm nextPutAll: '''.'. strm cr. ]. (StringHolder new contents: cont) openLabel: 'exported codes in Gzip+Base64 encoding'! ! !LanguageEditor methodsFor: 'initialization - toolbar' stamp: 'AB 3/2/2006 15:55'! createMainToolbar "create a toolbar for the receiver" | toolbar | toolbar := self createRow. "" " toolbar addMorphBack: (self createUpdatingButtonWording: #debugWording action: #switchDebug help: 'Switch the debug flag')." toolbar addTransparentSpacerOfSize: 5 @ 0. "" toolbar addMorphBack: (self createButtonLabel: 'new' action: #newTranslations help: 'Create translations for new language.'). toolbar addMorphBack: (self createButtonLabel: 'save' action: #saveToFile help: 'Save the translations to a file'). toolbar addMorphBack: (self createButtonLabel: 'load' action: #loadFromFile help: 'Load the translations from a file'). toolbar addMorphBack: (self createButtonLabel: 'merge' action: #mergeFromFile help: 'Merge the current translations with the translations in a file'). "" toolbar addTransparentSpacerOfSize: 5 @ 0. toolbar addMorphBack: (self createButtonLabel: 'apply' action: #applyTranslations help: 'Apply the translations as much as possible.'). "" toolbar addTransparentSpacerOfSize: 5 @ 0. toolbar addMorphBack: (self createButtonLabel: 'check translations' action: #check help: 'Check the translations and report the results.'). toolbar addMorphBack: (self createButtonLabel: 'report' action: #report help: 'Create a report.'). toolbar addMorphBack: (self createButtonLabel: 'gettext' action: #getText help: 'Interface with gettext.'). "" ^ toolbar! ! !LanguageEditor methodsFor: 'initialization' stamp: 'AB 3/2/2006 16:07'! initializeOn: aLanguage "initialize the receiver on aLanguage" "" selectedTranslation := 0. selectedUntranslated := 0. selectedTranslations := IdentitySet new. "" translator := aLanguage. "" self model: aLanguage. self setLabel: 'Language editor for: ' translated , self translator name. "" self initializeToolbars. self initializePanels. self initializeStatusbar. self initializeNewerKeys. ! ! !LanguageEditor methodsFor: 'as yet unclassified'! getText | t1 | t1 := MenuMorph new defaultTarget: self. t1 add: 'gettext export' translated target: self selector: #getTextExport. t1 lastItem setBalloonText: 'Exports the translations to GetText format.' translated. t1 add: 'gettext import' translated target: self selector: #getTextImport. t1 lastItem setBalloonText: 'Imports the translations from GetText format.' translated. t1 popUpInWorld! ! !LanguageEditor methodsFor: 'as yet unclassified'! getTextImport self withUnboundModelDo: [:t1 | Cursor wait showWhile: [GetTextImporter new import: t1]]! ! !LanguageEditor methodsFor: 'as yet unclassified'! withUnboundModelDo: t1 | t2 | t2 := self model. self model: nil. [t1 value: t2] ensure: [self model: t2]! ! !LanguageEnvironment methodsFor: 'utilities' stamp: 'tak 11/28/2005 17:28'! setupSqueaklandSpecifics "Write language specific settings here"! ! !JapaneseEnvironment methodsFor: 'utilities' stamp: 'KR 1/30/2006 22:28'! setupSqueaklandSpecifics | server | ChangeSet current name: 'Unnamed' translated , '1'. ServerDirectory resetServers. server := SuperSwikiServer new type: #http; server: 'squeakland.jp'; directory: '/super/SuperSwikiProj'; acceptsUploads: (Preferences eToyFriendly not); encodingName: 'shift_jis'. ServerDirectory servers at: 'Squeakland.JP' put: server. Smalltalk garbageCollect! ! !LanguageEnvironment class methodsFor: 'private' stamp: 'yo 11/29/2005 13:33'! initKnownEnvironments "LanguageEnvironment initKnownEnvironments" | env known id | known := Dictionary new. self allSubclassesDo: [:subClass | subClass supportedLanguages do: [:language | env := subClass new. id _ LocaleID isoString: language. env localeID: id. known at: id put: env]]. ^known! ! !Locale class methodsFor: 'accessing' stamp: 'tak 10/18/2005 22:33'! currentPlatform: locale during: aBlock "Alter current language platform during a block" | backupPlatform | backupPlatform := self currentPlatform. [self currentPlatform: locale. aBlock value] ensure: [self currentPlatform: backupPlatform]! ! !MacUnicodeInputInterpreter methodsFor: 'keyboard' stamp: 'tetha 11/22/2005 21:49'! nextCharFrom: sensor firstEvt: evtBuf | keyValue mark | keyValue := evtBuf at: self keyValueIndex. mark := self japaneseSpecialMark: keyValue. mark notNil ifTrue: [^ mark]. keyValue < 256 ifTrue: [^ (Character value: keyValue) squeakToIso]. "Smalltalk systemLanguage charsetClass charFromUnicode: keyValue." ^ Unicode value: keyValue! ! !MacUnicodeInputInterpreter methodsFor: 'initialization' stamp: 'ts 10/29/2005 10:22'! initialize | satisfiesVersion | satisfiesVersion := self majorMinorBuildFrom: SmalltalkImage current vmVersion satisfies: [:major :minor :build | major >= 3 and: [minor >= 8 and: [build >= 7]]]. satisfiesVersion ifTrue: [keyValueIndex := 6] ifFalse: [keyValueIndex := 3]! ! !MacUnicodeInputInterpreter methodsFor: 'accessing' stamp: 'ts 10/29/2005 10:23'! keyValueIndex ^ keyValueIndex! ! !MacUnicodeInputInterpreter methodsFor: 'version check' stamp: 'ts 10/29/2005 10:17'! majorMinorBuildFrom: aString satisfies: aBlock | v | v := aString ifNil: [^ false]. v := ((v copyAfter: $]) findTokens: $ ) last findTokens: $.. v size = 3 ifFalse: [^ false]. v := v collect: [:s | s initialIntegerOrNil ifNil: [^ false]]. ^ aBlock valueWithArguments: v asArray! ! !MacUnicodeInputInterpreter methodsFor: 'conversion' stamp: 'tetha 11/22/2005 22:05'! japaneseSpecialMark: anInteger "For japanese special marks. This method converts 'YEN SIGN' (16rA5) to 'REVERSE SOLIDUS' (16r5C) and use Japanese leading characters instead of Unicode for below characters. 'CENT SIGN' (16rA2) 'POUND SIGN' (16rA3) 'SECTION SIGN' (16rA7) 'DIAERESIS' (16rA8) 'NOT SIGN' (16rAC) 'DEGREE SIGN' (16rB0) 'PLUS-MINUS SIGN (16rB1) 'ACUTE ACCENT' (16rB4) 'PILCROW SIGN' (16rB6) 'MULTIPLICATION SIGN' (16rD7) 'DIVISION SIGN' (16rF7) " Project current localeID = (LocaleID isoLanguage: 'ja') ifTrue: [anInteger = 16rA5 ifTrue: [^ Character value: 16r5C]. (#(16rA2 16rA3 16rA7 16rA8 16rAC 16rB0 16rB1 16rB4 16rB6 16rD7 16rF7) includes: anInteger) ifTrue: [^ Character leadingChar: JapaneseEnvironment leadingChar code: anInteger]]. ^ nil! ! !MultiCharacterScanner methodsFor: 'scanning' stamp: 'tak 11/8/2005 11:25'! scanCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta | startEncoding selector | (sourceString isByteString) ifTrue: [^ self basicScanCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta.]. (sourceString isWideString) ifTrue: [ startIndex > stopIndex ifTrue: [lastIndex _ stopIndex. ^ stops at: EndOfRun]. startEncoding _ (sourceString at: startIndex) leadingChar. selector _ EncodedCharSet scanSelectorAt: startEncoding. ^ self perform: selector withArguments: (Array with: startIndex with: stopIndex with: sourceString with: rightX with: stopConditions with: kernDelta). ]. ^ stops at: EndOfRun ! ! !NaturalLanguageTranslator methodsFor: 'fileIn/fileOut' stamp: 'yo 11/29/2005 11:19'! fileOutOn: aStream "self current fileOutOn: Transcript. Transcript endEntry" self fileOutHeaderOn: aStream. self fileOutOn: aStream keys: nil! ! !NaturalLanguageTranslator methodsFor: 'fileIn/fileOut' stamp: 'yo 11/29/2005 11:19'! fileOutOn: aStream keys: keys "self current fileOutOn: Transcript. Transcript endEntry" (keys ifNil: [generics keys asSortedCollection]) do: [:key | self nextChunkPut: (generics associationAt: key) on: aStream]. keys ifNil: [self untranslated do: [:each | self nextChunkPut: each -> '' on: aStream]]. aStream nextPut: $!!; cr! ! !PasteUpMorph methodsFor: 'event handling' stamp: 'tak 11/6/2005 23:24'! dropFiles: anEvent "Handle a number of dropped files from the OS. TODO: - use a more general mechanism for figuring out what to do with the file (perhaps even offering a choice from a menu) - remember the resource location or (when in browser) even the actual file handle " | numFiles stream handler | numFiles _ anEvent contents. 1 to: numFiles do: [:i | stream _ FileStream requestDropStream: i. stream ifNotNil: [ handler _ ExternalDropHandler lookupExternalDropHandler: stream. [handler ifNotNil: [handler handle: stream in: self dropEvent: anEvent]] ensure: [stream close]]].! ! !ProjectLauncher methodsFor: 'running' stamp: 'KR 8/30/2005 17:41'! startUpAfterLogin | scriptName loader isUrl | self setupFlaps. Preferences readDocumentAtStartup ifTrue: [ HTTPClient isRunningInBrowser ifTrue:[ self setupFromParameters. scriptName _ self parameterAt: 'src'. CodeLoader defaultBaseURL: (self parameterAt: 'Base'). ] ifFalse:[ scriptName _ (SmalltalkImage current getSystemAttribute: 2) ifNil:['']. scriptName _ scriptName convertFromSystemString. scriptName isEmpty ifFalse:[ "figure out if script name is a URL by itself" isUrl _ (scriptName asLowercase beginsWith:'http://') or:[ (scriptName asLowercase beginsWith:'file://') or:[ (scriptName asLowercase beginsWith:'ftp://')]]. isUrl ifFalse:[scriptName _ 'file:',scriptName]]. ]. ] ifFalse: [ scriptName := '' ]. scriptName isEmptyOrNil ifTrue:[^Preferences eToyFriendly ifTrue: [self currentWorld addGlobalFlaps]]. loader _ CodeLoader new. loader loadSourceFiles: (Array with: scriptName). (scriptName asLowercase endsWith: '.pr') ifTrue:[self installProjectFrom: loader] ifFalse:[loader installSourceFiles]. ! ! !ReleaseBuilderSqueakland methodsFor: 'utilities' stamp: 'tak 11/28/2005 17:25'! setupLanguageSpecifics "ReleaseBuilderSqueakland new setupLanguageSpecifics" Locale |
>>> [Is] there is a way to track sources of such a widely >>> intersring topic like traslations in consitent or affordable way? do >>> you >>> publish your sources somewhere guys? >> >> >> >> NOTE: this is all positve critisism - i love squeak and admire all >> tricks >> you guys perfom... ;) >> > > It wants to be positive also from me, but sadly no one answered :-/ > along to kids in different countries, then there should be an easy and transparent way to localize it to different languages. Maybe there could be a separate team to solve this problem? Elod |
In reply to this post by Alberto Berti
Alberto,
> I've made some other steps... :) > I've prepared two changesets with changes coming from the SqueakLand-dev > image and from the SmallLand's one. > Nice work! Ill try the patches will reprt the results . - Jeroen |
In reply to this post by Elod Kironsky
Please do
> This is indeed a very important issue. If Squeak should be spread > widely along to kids in different countries, then > there should be an easy and transparent way to localize it to > different languages. Maybe there could be a > separate team to solve this problem? We got some problem translating the 3.8 to french and I'm sure that hilaire can sahre with you his knowledge. What we will need is a per package translation system. Stef |
In reply to this post by Alberto Berti
Alberto,
> To load them, save them on disk, open a vanilla 3.8 image, take a Filelist > from the tools flap and "install" them in order. > Ive tried this in a 3.8 basic and 3.9 image. The sets both load without errors. However, after loading the 2nd changeset the system gets unworkable sluggish - so i have to bail out and throw that image away. After loading only 1st changeset, the Languagetranslator seems to work (with new save button) though. - Jeroen "Alberto Berti" <[hidden email]> wrote in message news:[hidden email]... > Jeroen van Hilst wrote: > > Best Alberto, > > > > Im a squeak newbie too ... > > > > I wholehartedly agree with your post. I also have tried to (start) with > > translating to my native language (dutch) so squeak > > would be more accessable to my kids, but i have not come very far. > > > > Ik think the NaturalLanguageTranslator/Editor in images 3.7 - 3.9 is > > it not seems so to me. There are some glitches though. > > > And doing the translation with the Editor is not very handy process... (no > > offense). > > > > yes, it's true, a fillInTheBlank isn't really so comfortable, especially > for long sentences. > I must say however that the Small-Land image is in a much better shape from > the point of translation support. Also the different and much more readable > font it uses by default helps. > > > Since squeak and Smalltalk are still mazes to me, i havent found out how to > > work with this. > > > > If you know ways to make this process better (gettext method sounds very > > good), i would be glad to help / assist in any way i can. > > I've made some other steps... :) > I've prepared two changesets with changes coming from the SqueakLand-dev > image and from the SmallLand's one. > > To load them, save them on disk, open a vanilla 3.8 image, take a Filelist > from the tools flap and "install" them in order. > > If all goes well, you should be able to open a LanguageEditor which let > insert a new LocaleID via the "new" button (just like the Squeakland-dev > image) and export/import translation to/from gettext format using the > "gettext" button backported from the SmallLand image. > > Tell me how it work. > Still no news on how to "package" translations, but it's not a so urgent > question if we have gettext. > > Please pay attention that this is my first try at changeset preparing:) So > there can be mistakes and bugs. But it seems to do its job > > It seems that there are still some encoding problems on the exported file, > but it may be a problem of my platform. > > I've started doing some translation. > > It seems that when a LaguageEditor is open now the execution slows down.. > don't know if it will happen also to you, let me know. As soon as you close > the LanguageEditor, the slow down ends.. > > Maybe someone with better insights can review my changesets? > > >>[Is] there is a way to track sources of such a widely > >>intersring topic like traslations in consitent or affordable way? do you > >>publish your sources somewhere guys? > > > > > > NOTE: this is all positve critisism - i love squeak and admire all > > you guys perfom... ;) > > > > It wants to be positive also from me, but sadly no one answered :-/ > > > cheers, > > Alberto > ---------------------------------------------------------------------------- ---- > 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 2 March 2006 at 4:13:29 pm'! > "Change Set: nihongo7Language > Date: 22 July 2005 > Author: Takashi Yamamiya, Noose Toru, and Yoshiki Ohshima > > The changes related to language features. These are: > > * LanguageEditor and NaturalLanguageTranslator for better saving and usability. > * Better multi byte true type font handling with project saving. > * JapaneseEnvironment and MultiByteBinaryOrTextStream default changes. > * SecurityManager knows the interpreted path name. > > "! > > Object subclass: #ISOLanguageDefinition > instanceVariableNames: 'iso3 iso2 iso3Alternate language ' > classVariableNames: 'ISO2Table ISO3Table ISOCountries ISO3Countries ISO2Countries ' > poolDictionaries: '' > category: 'System-Localization'! > Object subclass: #LanguageEnvironment > instanceVariableNames: 'id translator ' > classVariableNames: 'ClipboardInterpreterClass Current FileNameConverterClass InputInterpreterClass KnownEnvironments SystemConverterClass ' > poolDictionaries: '' > category: 'Multilingual-Languages'! > > !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 14:06'! > buildIso3166CodesTables > "ISOLanguageDefinition buildIso3166CodesTables" > | rawdata stream country isoa2 isoa3 unNumeric macName macCode windowsName windowsCode empty table | > rawdata := self iso3166Codes. > table := OrderedCollection new: 200. > stream := rawdata readStream. > empty := 160 asCharacter asString. > [stream atEnd] whileFalse: > [country := stream nextLine. > isoa2 := stream nextLine. > isoa3 := stream nextLine. > unNumeric := stream nextLine. > windowsName := stream nextLine. > windowsName = empty ifTrue: [windowsName := nil]. > windowsCode := stream nextLine. > windowsCode = empty ifTrue: [windowsCode := nil]. > macName := stream nextLine. > macName = empty ifTrue: [macName := nil]. > macCode := stream nextLine. > macCode = empty ifTrue: [macCode := nil]. > table add: { country. isoa2. isoa3. unNumeric. windowsName. > ^table! ! > > !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 14:14'! > extraCountryDefinitions > ^{ > {'Kids'. 'KIDS'. 'KIDS'.}. > }! ! > > !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 14:12'! > initISOCountries > "ISOLanguageDefinition initISOCountries" > | iso3166Table | > iso3166Table := ISOLanguageDefinition buildIso3166CodesTables. > ISO2Countries := Dictionary new. > ISO3Countries := Dictionary new. > iso3166Table do: [:entry | > ISO2Countries at: (entry at: 2) put: (entry at: 1). > ISO3Countries at: (entry at: 3) put: (entry at: 1)]. > self extraCountryDefinitions do: [:entry | > ISO2Countries at: (entry at: 2) put: (entry at: 1). > ISO3Countries at: (entry at: 3) put: (entry at: 1)]! ! > > !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 > iso2Countries > "ISOLanguageDefinition iso2Countries" > "ISO2Countries := nil. ISO3Countries := nil" > > ISO2Countries ifNil: [self initISOCountries]. > ^ISO2Countries! ! > > !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 13:57'! > iso3166Codes > "http://www.unicode.org/onlinedat/countries.html" > > ^'Ã.LAND ISLANDS > AX > > >  >  >  >  > AFGHANISTAN > AF > AFG > 004 >  >  >  >  > ALBANIA > AL > ALB > 008 > CTRY_ALBANIA > 355 >  >  > ALGERIA > DZ > DZA > 012 > CTRY_ALGERIA > 213 > verArabic > 16 > AMERICAN SAMOA > AS > ASM > 016 >  >  >  >  > ANDORRA > AD > AND > 020 >  >  >  >  > ANGOLA > AO > AGO > 024 >  >  >  >  > ANGUILLA > AI > AIA > 660 >  >  >  >  > ANTARCTICA > AQ > ATA > 010 >  >  >  >  > ANTIGUA AND BARBUDA > AG > ATG > 028 >  >  >  >  > ARGENTINA > AR > ARG > 032 > CTRY_ARGENTINA > 54 >  >  > ARMENIA > AM > ARM > 051 > CTRY_ARMENIA > 374 > verArmenian > 84 > ARUBA > AW > ABW > 533 >  >  >  >  > AUSTRALIA > AU > AUS > 036 > CTRY_AUSTRALIA > 61 > verAustralia > 15 > AUSTRIA > AT > AUT > 040 > CTRY_AUSTRIA > 43 > verAustria > 92 > AZERBAIJAN > AZ > AZE > 031 > CTRY_AZERBAIJAN > 994 >  >  > BAHAMAS > BS > BHS > 044 >  >  >  >  > BAHRAIN > BH > BHR > 048 > CTRY_BAHRAIN > 973 >  >  > BANGLADESH > BD > BGD > 050 >  >  > verBengali > 60 > BARBADOS > BB > BRB > 052 >  >  >  >  > BELARUS > BY > BLR > 112 > CTRY_BELARUS > 375 >  >  > BELGIUM > BE > BEL > 056 > CTRY_BELGIUM > 32 > verFrBelgium, verFlemish > 98 > BELIZE > BZ > BLZ > 084 > CTRY_BELIZE > 501 >  >  > BENIN > BJ > BEN > 204 >  >  >  >  > BERMUDA > BM > BMU > 060 >  >  >  >  > BHUTAN > BT > BTN > 064 >  >  > verBhutan > 83 > BOLIVIA > BO > BOL > 068 > CTRY_BOLIVIA > 591 >  >  > BOSNIA AND HERZEGOVINA > BA > BIH > 070 >  >  >  >  > BOTSWANA > BW > BWA > 072 >  >  >  >  > BOUVET ISLAND > BV > BVT > 074 >  >  >  >  > BRAZIL > BR > BRA > 076 > CTRY_BRAZIL > 55 > verBrazil > 71 > BRITISH INDIAN OCEAN TERRITORY > IO > IOT > 086 >  >  >  >  > BRUNEI DARUSSALAM > BN > BRN > 096 > CTRY_BRUNEI_DARUSSALAM > 673 >  >  > BULGARIA > BG > BGR > 100 > CTRY_BULGARIA > 359 > verBulgaria > 72 > BURKINA FASO > BF > BFA > 854 >  >  >  >  > BURUNDI > BI > BDI > 108 >  >  >  >  > CAMBODIA > KH > KHM > 116 >  >  >  >  > CAMEROON > CM > CMR > 120 >  >  >  >  > CANADA > CA > CAN > 124 > CTRY_CANADA > 2 > verFrCanada, verEndCanada > 82 > CAPE VERDE > CV > CPV > 132 >  >  >  >  > CAYMAN ISLANDS > KY > CYM > 136 >  >  >  >  > CENTRAL AFRICAN REPUBLIC > CF > CAF > 140 >  >  >  >  > CHAD > TD > TCD > 148 >  >  >  >  > CHILE > CL > CHL > 152 > CTRY_CHILE > 56 >  >  > CHINA > CN > CHN > 156 > CTRY_PRCHINA > 86 > verChina > 52 > CHRISTMAS ISLAND > CX > CXR > 162 >  >  >  >  > COCOS (KEELING) ISLANDS > CC > CCK > 166 >  >  >  >  > COLOMBIA > CO > COL > 170 > CTRY_COLOMBIA > 57 >  >  > COMOROS > KM > COM > 174 >  >  >  >  > CONGO > CG > COG > 178 >  >  >  >  > CONGO, THE DEMOCRATIC REPUBLIC OF THE > CD > > >  >  >  >  > COOK ISLANDS > CK > COK > 184 >  >  >  >  > COSTA RICA > CR > CRI > 188 > CTRY_COSTA_RICA > 506 >  >  > COTE D''IVOIRE > CI > CIV > 384 >  >  >  >  > CROATIA (local name: Hrvatska) > HR > HRV > 191 > CTRY_CROATIA > 385 > verCroatia, verYugoCroatian > 68 (c), 25 (y) > CUBA > CU > CUB > 192 >  >  >  >  > CYPRUS > CY > CYP > 196 >  >  > verCyprus > 23 > CZECH REPUBLIC > CZ > CZE > 203 > CTRY_CZECH > 420 > verCzech > 56 > DENMARK > DK > DNK > 208 > CTRY_DENMARK > 45 > verDenmark(da), verFaeroeIsl(fo) > 9(da), 47(fo) > DJIBOUTI > DJ > DJI > 262 >  >  >  >  > DOMINICA > DM > DMA > 212 >  >  >  >  > DOMINICAN REPUBLIC > DO > DOM > 214 > CTRY_DOMINICAN_REPUBLIC > 1 >  >  > EAST TIMOR > TL > TLS > 626 >  >  >  >  > ECUADOR > EC > ECU > 218 > CTRY_ECUADOR > 593 >  >  > EGYPT > EG > EGY > 818 > CTRY_EGYPT > 20 > verArabic > 16 > EL SALVADOR > SV > SLV > 222 > CTRY_EL_SALVADOR > 503 >  >  > EQUATORIAL GUINEA > GQ > GNQ > 226 >  >  >  >  > ERITREA > ER > ERI > 232 >  >  >  >  > ESTONIA > EE > EST > 233 > CTRY_ESTONIA > 372 > verEstonia > 44 > ETHIOPIA > ET > ETH > 210 >  >  >  >  > FALKLAND ISLANDS (MALVINAS) > FK > FLK > 238 >  >  >  >  > FAROE ISLANDS > FO > FRO > 234 > CTRY_FAEROE_ISLANDS > 298 >  >  > FIJI > FJ > FJI > 242 >  >  >  >  > FINLAND > FI > FIN > 246 > CTRY_FINLAND > 358 > verFinland > 17 > FRANCE > FR > FRA > 250 > CTRY_FRANCE > 33 > verFrance > 1 > FRANCE, METROPOLITAN > FX > FXX > 249 >  >  >  >  > FRENCH GUIANA > GF > GUF > 254 >  >  >  >  > FRENCH POLYNESIA > PF > PYF > 258 >  >  >  >  > FRENCH SOUTHERN TERRITORIES > TF > ATF > 260 >  >  >  >  > GABON > GA > GAB > 266 >  >  >  >  > GAMBIA > GM > GMB > 270 >  >  >  >  > GEORGIA > GE > GEO > 268 > CTRY_GEORGIA > 995 > verGeorgian > 85 > GERMANY > DE > DEU > 276 > CTRY_GERMANY > 49 > verGermany > 3 > GHANA > GH > GHA > 288 >  >  >  >  > GIBRALTAR > GI > GIB > 292 >  >  >  >  > GREECE > GR > GRC > 300 > CTRY_GREECE > 30 > verGreece, verGreecePoly > 20, 40 > GREENLAND > GL > GRL > 304 >  >  > verGreenland > 107 > GRENADA > GD > GRD > 308 >  >  >  >  > GUADELOUPE > GP > GLP > 312 >  >  >  >  > GUAM > GU > GUM > 316 >  >  >  >  > GUATEMALA > GT > GTM > 320 > CTRY_GUATEMALA > 502 >  >  > GUINEA > GN > GIN > 324 >  >  >  >  > GUINEA-BISSAU > GW > GNB > 624 >  >  >  >  > GUYANA > GY > GUY > 328 >  >  >  >  > HAITI > HT > HTI > 332 >  >  >  >  > HEARD ISLAND & MCDONALD ISLANDS > HM > HMD > 334 >  >  >  >  > HONDURAS > HN > HND > 340 > CTRY_HONDURAS > 504 >  >  > HONG KONG > HK > HKG > 344 > CTRY_HONG_KONG > 852 >  >  > HUNGARY > HU > HUN > 348 > CTRY_HUNGARY > 36 > verHungary > 43 > ICELAND > IS > ISL > 352 > CTRY_ICELAND > 354 > verIceland > 21 > INDIA > IN > IND > 356 > CTRY_INDIA > 91 > verIndiaHindi(hi) > 33 > INDONESIA > ID > IDN > 360 > CTRY_INDONESIA > 62 >  >  > IRAN, ISLAMIC REPUBLIC OF > IR > IRN > 364 > CTRY_IRAN > 981 > verIran > 48 > IRAQ > IQ > IRQ > 368 > CTRY_IRAQ > 964 > verArabic > 16 > IRELAND > IE > IRL > 372 > CTRY_IRELAND > 353 > verIreland > 50 > ISRAEL > IL > ISR > 376 > CTRY_ISRAEL > 972 > verIsrael > 13 > ITALY > IT > ITA > 380 > CTRY_ITALY > 39 > verItaly > 4 > JAMAICA > JM > JAM > 388 > CTRY_JAMAICA > 1 >  >  > JAPAN > JP > JPN > 392 > CTRY_JAPAN > 81 > verJapan > 14 > JORDAN > JO > JOR > 400 > CTRY_JORDAN > 962 >  >  > KAZAKHSTAN > KZ > KAZ > 398 > CTRY_KAZAKSTAN > 7 >  >  > KENYA > KE > KEN > 404 > CTRY_KENYA > 254 >  >  > KIRIBATI > KI > KIR > 296 >  >  >  >  > KOREA, DEMOCRATIC PEOPLE''S REPUBLIC OF > KP > PRK > 408 >  >  > verKorea > 51 > KOREA, REPUBLIC OF > KR > KOR > 410 > CTRY_SOUTH_KOREA > 82 > verKorea >  > KUWAIT > KW > KWT > 414 > CTRY_KUWAIT > 965 >  >  > KYRGYZSTAN > KG > KGZ > 417 > CTRY_KYRGYZSTAN > 996 >  >  > LAO PEOPLE''S DEMOCRATIC REPUBLIC > LA > LAO > 418 >  >  >  >  > LATVIA > LV > LVA > 428 > CTRY_LATVIA > 371 > verLatvia > 45 > LEBANON > LB > LBN > 422 > CTRY_LEBANON > 961 >  >  > LESOTHO > LS > LSO > 426 >  >  >  >  > LIBERIA > LR > LBR > 430 >  >  >  >  > LIBYAN ARAB JAMAHIRIYA > LY > LBY > 434 > CTRY_LIBYA > 218 > verArabic > 16 > LIECHTENSTEIN > LI > LIE > 438 > CTRY_LIECHTENSTEIN > 41 >  >  > LITHUANIA > LT > LTU > 440 > CTRY_LITHUANIA > 370 > verLithuania > 41 > LUXEMBOURG > LU > LUX > 442 > CTRY_LUXEMBOURG > 352 > verFrBelgiumLux > 6 > MACAU > MO > MAC > 446 > CTRY_MACAU > 853 >  >  > MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF > MK > MKD > 807 > CTRY_MACEDONIA > 389 > verMacedonian >  > MADAGASCAR > MG > MDG > 450 >  >  >  >  > MALAWI > MW > MWI > 454 >  >  >  >  > MALAYSIA > MY > MYS > 458 > CTRY_MALAYSIA > 60 >  >  > MALDIVES > MV > MDV > 462 > CTRY_MALDIVES > 960 >  >  > MALI > ML > MLI > 466 >  >  >  >  > MALTA > MT > MLT > 470 >  >  > verMalta > 22 > MARSHALL ISLANDS > MH > MHL > 584 >  >  >  >  > MARTINIQUE > MQ > MTQ > 474 >  >  >  >  > MAURITANIA > MR > MRT > 478 >  >  >  >  > MAURITIUS > MU > MUS > 480 >  >  >  >  > MAYOTTE > YT > MYT > 175 >  >  >  >  > MEXICO > MX > MEX > 484 > CTRY_MEXICO > 52 >  >  > MICRONESIA, FEDERATED STATES OF > FM > FSM > 583 >  >  >  >  > MOLDOVA, REPUBLIC OF > MD > MDA > 498 >  >  >  >  > MONACO > MC > MCO > 492 > CTRY_MONACO > 33 >  >  > MONGOLIA > MN > MNG > 496 > CTRY_MONGOLIA > 976 >  >  > MONTSERRAT > MS > MSR > 500 >  >  >  >  > MOROCCO > MA > MAR > 504 > CTRY_MOROCCO > 212 > verArabic > 16 > MOZAMBIQUE > MZ > MOZ > 508 >  >  >  >  > MYANMAR > MM > MMR > 104 >  >  >  >  > NAMIBIA > NA > NAM > 516 >  >  >  >  > NAURU > NR > NRU > 520 >  >  >  >  > NEPAL > NP > NPL > 524 >  >  > verNepal > 106 > NETHERLANDS > NL > NLD > 528 > CTRY_NETHERLANDS > 31 > verNetherlands > 5 > NETHERLANDS ANTILLES > AN > ANT > 530 >  >  >  >  > NEW CALEDONIA > NC > NCL > 540 >  >  >  >  > NEW ZEALAND > NZ > NZL > 554 > CTRY_NEW_ZEALAND > 64 >  >  > NICARAGUA > NI > NIC > 558 > CTRY_NICARAGUA > 505 >  >  > NIGER > NE > NER > 562 >  >  >  >  > NIGERIA > NG > NGA > 566 >  >  >  >  > NIUE > NU > NIU > 570 >  >  >  >  > NORFOLK ISLAND > NF > NFK > 574 >  >  >  >  > NORTHERN MARIANA ISLANDS > MP > MNP > 580 >  >  >  >  > NORWAY > NO > NOR > 578 > CTRY_NORWAY > 47 > verNorway > 12 > OMAN > OM > OMN > 512 > CTRY_OMAN > 968 >  >  > PAKISTAN > PK > PAK > 586 > CTRY_PAKISTAN > 92 > verPakistanUrdu, verPunjabi > 34 (U), 95 (P) > PALAU > PW > PLW > 585 >  >  >  >  > PANAMA > PA > PAN > 591 > CTRY_PANAMA > 507 >  >  > PALESTINIAN TERRITORY, OCCUPIED > PS > > > > >  >  > PAPUA NEW GUINEA > PG > PNG > 598 >  >  >  >  > PARAGUAY > PY > PRY > 600 > CTRY_PARAGUAY > 595 >  >  > PERU > PE > PER > 604 > CTRY_PERU > 51 >  >  > PHILIPPINES > PH > PHL > 608 > CTRY_PHILIPPINES > 63 >  >  > PITCAIRN > PN > PCN > 612 >  >  >  >  > POLAND > PL > POL > 616 > CTRY_POLAND > 48 > verPoland > 42 > PORTUGAL > PT > PRT > 620 > CTRY_PORTUGAL > 351 > verPortugal > 10 > PUERTO RICO > PR > PRI > 630 > CTRY_PUERTO_RICO > 1 >  >  > QATAR > QA > QAT > 634 > CTRY_QATAR > 974 >  >  > REUNION > RE > REU > 638 >  >  >  >  > ROMANIA > RO > ROU* > 642 > CTRY_ROMANIA > 40 > verRomania > 39 > RUSSIAN FEDERATION > RU > RUS > 643 > CTRY_RUSSIA > 7 > verRussia > 49 > RWANDA > RW > RWA > 646 >  >  >  >  > SAINT KITTS AND NEVIS > KN > KNA > 659 >  >  >  >  > SAINT LUCIA > LC > LCA > 662 >  >  >  >  > SAINT VINCENT AND THE GRENADINES > VC > VCT > 670 >  >  >  >  > SAMOA > WS > WSM > 882 >  >  >  >  > SAN MARINO > SM > SMR > 674 >  >  >  >  > SAO TOME AND PRINCIPE > ST > STP > 678 >  >  >  >  > SAUDI ARABIA > SA > SAU > 682 > CTRY_SAUDI_ARABIA > 966 > verArabic > 16 > SENEGAL > SN > SEN > 686 >  >  >  >  > SERBIA AND MONTENEGRO > CS >  >  > CTRY_SERBIA > 381 >  >  > SEYCHELLES > SC > SYC > 690 >  >  >  >  > SIERRA LEONE > SL > SLE > 694 >  >  >  >  > SINGAPORE > SG > SGP > 702 > CTRY_SINGAPORE > 65 > verSingapore > 100 > SLOVAKIA (Slovak Republic) > SK > SVK > 703 > CTRY_SLOVAK > 421 > verSlovak > 57 > SLOVENIA > SI > SVN > 705 > CTRY_SLOVENIA > 386 > verSlovenian > 66 > SOLOMON ISLANDS > SB > SLB > 90 >  >  >  >  > SOMALIA > SO > SOM > 706 >  >  >  >  > SOUTH AFRICA > ZA > ZAF > 710 > CTRY_SOUTH_AFRICA > 27 >  >  > SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS > GS > > > > >  >  > SPAIN > ES > ESP > 724 > CTRY_SPAIN > 34 > verSpain > 8 > SRI LANKA > LK > LKA > 144 >  >  >  >  > SAINT HELENA > SH > SHN > 654 >  >  >  >  > SAINT PIERRE AND MIQUELON > PM > SPM > 666 >  >  >  >  > SUDAN > SD > SDN > 736 >  >  >  >  > SURINAME > SR > SUR > 740 >  >  >  >  > SVALBARD AND JAN MAYEN ISLANDS > SJ > SJM > 744 >  >  >  >  > SWAZILAND > SZ > SWZ > 748 >  >  >  >  > SWEDEN > SE > SWE > 752 > CTRY_SWEDEN > 46 > verSweden > 7 > SWITZERLAND > CH > CHE > 756 > CTRY_SWITZERLAND > 41 > verFrSwiss(fr), verGrSwiss(de) > 18(fr), 19(de) > SYRIAN ARAB REPUBLIC > SY > SYR > 760 > CTRY_SYRIA > 963 >  >  > TAIWAN, PROVINCE OF CHINA > TW > TWN > 158 > CTRY_TAIWAN > 886 > verTaiwan > 53 > TAJIKISTAN > TJ > TJK > 762 >  >  >  >  > TANZANIA, UNITED REPUBLIC OF > TZ > TZA > 834 >  >  >  >  > TATARSTAN > > >  > CTRY_TATARSTAN > 7 >  >  > THAILAND > TH > THA > 764 > CTRY_THAILAND > 66 > verThailand > 54 > TIMOR-LESTE > TL > > >  >  >  >  > TOGO > TG > TGO > 768 >  >  >  >  > TOKELAU > TK > TKL > 772 >  >  >  >  > TONGA > TO > TON > 776 >  >  > verTonga > 88 > TRINIDAD AND TOBAGO > TT > TTO > 780 > CTRY_TRINIDAD_Y_TOBAGO > 1 >  >  > TUNISIA > TN > TUN > 788 > CTRY_TUNISIA > 216 > verArabic > 16 > TURKEY > TR > TUR > 792 > CTRY_TURKEY > 90 > verTurkey > 24 > TURKMENISTAN > TM > TKM > 795 >  >  >  >  > TURKS AND CAICOS ISLANDS > TC > TCA > 796 >  >  >  >  > TUVALU > TV > TUV > 798 >  >  >  >  > UGANDA > UG > UGA > 800 >  >  >  >  > UKRAINE > UA > UKR > 804 > CTRY_UKRAINE > 380 > verUkraine > 62 > UNITED ARAB EMIRATES > AE > ARE > 784 > CTRY_UAE > 971 >  >  > UNITED KINGDOM > GB > GBR > 826 > CTRY_UNITED_KINGDOM > 44 > verBritain > 2 > UNITED STATES > US > USA > 840 > CTRY_UNITED_STATES > 1 > verUS > 0 > UNITED STATES MINOR OUTLYING ISLANDS > UM > UMI > 581 >  >  >  >  > URUGUAY > UY > URY > 858 > CTRY_URUGUAY > 598 >  >  > UZBEKISTAN > UZ > UZB > 860 > CTRY_UZBEKISTAN > 7 >  >  > VANUATU > VU > VUT > 548 >  >  >  >  > VATICAN CITY STATE (HOLY SEE) > VA > VAT > 336 >  >  >  >  > VENEZUELA > VE > VEN > 862 > CTRY_VENEZUELA > 58 >  >  > VIET NAM > VN > VNM > 704 > CTRY_VIET_NAM > 84 > verVietnam >  > VIRGIN ISLANDS (BRITISH) > VG > VGB > 92 >  >  >  >  > VIRGIN ISLANDS (U.S.) > VI > VIR > 850 >  >  >  >  > WALLIS AND FUTUNA ISLANDS > WF > WLF > 876 >  >  >  >  > WESTERN SAHARA > EH > ESH > 732 >  >  >  >  > YEMEN > YE > YEM > 887 > CTRY_YEMEN > 967 >  >  > YUGOSLAVIA > YU > YUG > 891 >  >  >  >  > ZAIRE > ZR > ZAR > 180 >  >  >  >  > ZAMBIA > ZM > ZMB > 894 >  >  >  >  > ZIMBABWE > ZW > ZWE > 716 > CTRY_ZIMBABWE > 263 >  >  > '! ! > > !ISOLanguageDefinition class methodsFor: 'private' stamp: 'mir 9/1/2005 > iso3Countries > "ISOLanguageDefinition iso3Countries" > "ISO2Countries := nil. ISO3Countries := nil" > > ISO3Countries ifNil: [self initISOCountries]. > ^ISO3Countries! ! > > > !LanguageEditor methodsFor: 'gui methods' stamp: 'yo 11/29/2005 11:20'! > codeSelectedTranslationAsMimeString > | keys code tmpStream s2 gzs cont | > keys := selectedTranslations > collect: [:key | self translations at: key]. > code := String > streamContents: [:aStream | self translator fileOutOn: aStream keys: > > tmpStream _ MultiByteBinaryOrTextStream on: ''. > tmpStream converter: UTF8TextConverter new. > translator fileOutHeaderOn: tmpStream. > tmpStream nextPutAll: code. > s2 _ RWBinaryOrTextStream on: ''. > gzs := GZipWriteStream on: s2. > tmpStream reset. > gzs nextPutAll: (tmpStream binary contentsOfEntireFile asString) contents. > gzs close. > s2 reset. > > cont _ String streamContents: [:strm | > strm nextPutAll: '"Gzip+Base64 encoded translation for;'; cr. > strm nextPutAll: '#('. > keys do: [:each | strm nextPutAll: '''', each, ''' '.]. > strm nextPutAll: ')"'; cr; cr. > strm nextPutAll: 'NaturalLanguageTranslator loadForLocaleIsoString: '. > strm nextPut: $'. > strm nextPutAll: translator localeID isoString. > strm nextPut: $'. > strm nextPutAll: ' fromGzippedMimeLiteral: '. > strm nextPut: $'. > strm nextPutAll: (Base64MimeConverter mimeEncode: s2) contents. > strm nextPutAll: '''.'. > strm cr. > ]. > > (StringHolder new contents: cont) > openLabel: 'exported codes in Gzip+Base64 encoding'! ! > > !LanguageEditor methodsFor: 'gui methods' stamp: 'tak 9/14/2005 10:42'! > newTranslations > "private - try to apply the translations as much as possible all > over the image" > | result newID | > result := FillInTheBlank request: 'New locale ID string?' initialAnswer: > result isEmpty > ifTrue: ["Do nothing" > ^ self]. > newID := LocaleID isoString: result. > NaturalLanguageTranslator > newLocaleID: (LocaleID isoString: result). > self class openOn: newID! ! > > !LanguageEditor methodsFor: 'initialization - toolbar' stamp: 'AB 3/2/2006 15:55'! > createMainToolbar > "create a toolbar for the receiver" > | toolbar | > toolbar := self createRow. > "" > " toolbar > addMorphBack: (self > createUpdatingButtonWording: #debugWording > action: #switchDebug > help: 'Switch the debug flag')." > toolbar addTransparentSpacerOfSize: 5 @ 0. > "" > toolbar > addMorphBack: (self > createButtonLabel: 'new' > action: #newTranslations > help: 'Create translations for new language.'). > toolbar > addMorphBack: (self > createButtonLabel: 'save' > action: #saveToFile > help: 'Save the translations to a file'). > toolbar > addMorphBack: (self > createButtonLabel: 'load' > action: #loadFromFile > help: 'Load the translations from a file'). > toolbar > addMorphBack: (self > createButtonLabel: 'merge' > action: #mergeFromFile > help: 'Merge the current translations with the translations in a file'). > "" > toolbar addTransparentSpacerOfSize: 5 @ 0. > toolbar > addMorphBack: (self > createButtonLabel: 'apply' > action: #applyTranslations > help: 'Apply the translations as much as possible.'). > "" > toolbar addTransparentSpacerOfSize: 5 @ 0. > toolbar > addMorphBack: (self > createButtonLabel: 'check translations' > action: #check > help: 'Check the translations and report the results.'). > toolbar > addMorphBack: (self > createButtonLabel: 'report' > action: #report > help: 'Create a report.'). > toolbar > addMorphBack: (self > createButtonLabel: 'gettext' > action: #getText > help: 'Interface with gettext.'). > "" > ^ toolbar! ! > > > !LanguageEditor class methodsFor: 'instance creation' stamp: 'tak 9/7/2005 > on: localeID > "answer an instance of the receiver on aLanguage" > (NaturalLanguageTranslator availableLanguageLocaleIDs includes: localeID) > ifFalse: [self > error: ('Translator for {1} is not found' translated format: {localeID})]. > ^ self new > initializeOn: (NaturalLanguageTranslator availableForLocaleID: localeID)! ! > > !LanguageEditor class methodsFor: 'opening' stamp: 'TN 4/8/2005 01:13'! > openOnDefault > "open the receiver on the default language" > self openOn: LocaleID current! ! > > > !LanguageEnvironment class methodsFor: 'accessing' stamp: 'tak 9/14/2005 10:43'! > localeID: localeID > "LanguageEnvironment localeID: (LocaleID isoString: 'ja-kid')" > "LanguageEnvironment localeID: (LocaleID isoString: 'xx')" > ^ self knownEnvironments > at: localeID > ifAbsent: [localeID hasParent > ifTrue: [self knownEnvironments > at: localeID parent > ifAbsent: [self > localeID: (LocaleID isoLanguage: 'en')]] > ifFalse: [self > localeID: (LocaleID isoLanguage: 'en')]]! ! > > !LanguageEnvironment class methodsFor: 'private' stamp: 'yo 11/29/2005 > initKnownEnvironments > "LanguageEnvironment initKnownEnvironments" > > | env known id | > known := Dictionary new. > self allSubclassesDo: [:subClass | > subClass supportedLanguages do: [:language | > env := subClass new. > id _ LocaleID isoString: language. > env localeID: id. > known at: id put: env]]. > ^known! ! > > > !JapaneseEnvironment class methodsFor: 'subclass responsibilities' stamp: > inputInterpreterClass > | platformName osVersion encoding | > platformName := SmalltalkImage current platformName. > osVersion := SmalltalkImage current getSystemAttribute: 1002. > (platformName = 'Win32' > and: [osVersion = 'CE']) > ifTrue: [^ MacRomanInputInterpreter]. > platformName = 'Win32' > ifTrue: [^ WinShiftJISInputInterpreter]. > platformName = 'Mac OS' > ifTrue: [^ (('10*' match: SmalltalkImage current osVersion) > and: [(SmalltalkImage current getSystemAttribute: 3) isNil]) > ifTrue: [MacUnicodeInputInterpreter] > ifFalse: [MacShiftJISInputInterpreter]]. > platformName = 'unix' > ifTrue: [encoding := X11Encoding encoding. > (EUCJPTextConverter encodingNames includes: encoding) > ifTrue: [^ UnixEUCJPInputInterpreter]. > (UTF8TextConverter encodingNames includes: encoding) > ifTrue: [^ UnixUTF8JPInputInterpreter]. > (ShiftJISTextConverter encodingNames includes: encoding) > ifTrue: [^ MacShiftJISInputInterpreter]]. > ^ MacRomanInputInterpreter! ! > > > !Locale methodsFor: 'system primitives' stamp: 'mir 8/31/2005 17:36'! > primCountry > "Returns string with country tag according to ISO 639" > <primitive: 'primitiveCountry' module: 'LocalePlugin'> > ^nil! ! > > !Locale methodsFor: 'system primitives' stamp: 'mir 8/17/2005 15:53'! > primLanguage > "returns string with language tag according to ISO 639" > <primitive:'primitiveLanguage' module: 'LocalePlugin'> > ^nil! ! > > !Locale methodsFor: 'accessing' stamp: 'mir 8/31/2005 17:03'! > determineLocale > self localeID: self determineLocaleID! ! > > !Locale methodsFor: 'accessing' stamp: 'tak 9/8/2005 01:45'! > determineLocaleID > "Locale current determineLocaleID" > | isoLang isoCountry | > isoLang := self fetchISO2Language > ifNil: [^ self localeID]. > isoCountry := self fetchISOCountry > ifNil: [^ LocaleID isoLanguage: isoLang]. > ^ LocaleID isoLanguage: isoLang isoCountry: isoCountry! ! > > !Locale methodsFor: 'private' stamp: 'mir 8/31/2005 17:36'! > fetchISO2Language > "Locale current fetchISO2Language" > | lang isoLang | > lang := self primLanguage. > lang ifNil: [^nil]. > lang := lang copyUpTo: 0 asCharacter. > lang size == 2 > ifTrue: [^lang]. > isoLang := ISOLanguageDefinition iso3LanguageDefinition: lang. > ^isoLang > ifNil: [nil] > ifNotNil: [isoLang iso2]! ! > > !Locale methodsFor: 'private' stamp: 'tak 9/8/2005 01:47'! > fetchISOCountry > "Locale current fetchISOCountry" > | countryCode | > countryCode := self primCountry > ifNil: [^ nil]. > ^ countryCode copyUpTo: 0 asCharacter! ! > > > !Locale class methodsFor: 'accessing' stamp: 'mir 8/31/2005 17:36'! > current > "Current := nil" > Current ifNil: [ > Current := self determineCurrentLocale. > "Transcript show: 'Current locale: ' , Current localeID asString; cr"]. > ^Current! ! > > !Locale class methodsFor: 'accessing' stamp: 'tak 9/7/2005 23:24'! > switchTo: locale > "Locale switchTo: (Locale isoLanguage: 'de')" > | availableID | > availableID := (NaturalLanguageTranslator availableForLocaleID: locale > Current localeID = availableID > ifFalse: [CurrentPlatform := Current := Locale localeID: availableID. > self localeChanged]! ! > > !Locale class methodsFor: 'private' stamp: 'mir 7/28/2005 00:24'! > determineCurrentLocale > "For now just return the default locale. > A smarter way would be to determine the current platforms default locale." > "Locale determineCurrentLocale" > > ^self new determineLocale! ! > > !Locale class methodsFor: 'class initialization' stamp: 'mir 8/31/2005 > initialize > "Locale initialize" > > Smalltalk addToStartUpList: Locale. > Preferences addPreference: #useLocale > categories: #('general') default: false > balloonHelp: 'Use the system locale to set the system language etc at startup'.! ! > > !Locale class methodsFor: 'system startUp' stamp: 'tak 9/2/2005 15:06'! > startUp: resuming > | newID | > resuming ifFalse: [^self]. > (Preferences valueOfFlag: #useLocale) > ifTrue: [ > newID := self current determineLocaleID. > newID ~= LocaleID current > ifTrue: [self switchAndInstallFontToID: newID]]! ! > > > !LocaleID methodsFor: 'accessing' stamp: 'mir 9/1/2005 14:17'! > displayCountry > ^(ISOLanguageDefinition iso2Countries at: self isoCountry asUppercase > > > !MultiByteBinaryOrTextStream class methodsFor: 'defaults' stamp: 'yo 2/25/2005 20:04'! > defaultConverter > ^ Latin1TextConverter new. > ! ! > > > !NaturalLanguageTranslator methodsFor: 'translation' stamp: 'tak 9/7/2005 23:45'! > translate: aString > ^ self generics > at: aString > ifAbsent: [self class registeredPhraseFor: aString. > self changed: #untranslated. > self localeID hasParent > ifTrue: [self class translate: aString to: self localeID parent] > ifFalse: [aString]]! ! > > !NaturalLanguageTranslator methodsFor: 'user interface' stamp: 'yo > fileOutHeaderOn: aStream > aStream binary. > UTF8TextConverter writeBOMOn: aStream. > aStream text. > aStream nextChunkPut: self fileOutHeader; > cr. > aStream timeStamp; cr. > aStream nextPut: $!!. > aStream nextChunkPut: '(' , self class name , ' localeID: ' , id storeString , ')'. > aStream cr! ! > > !NaturalLanguageTranslator methodsFor: 'fileIn/fileOut' stamp: 'yo 2/25/2005 09:37'! > writeAsMimeString > > | fileName fileStream tmpStream s2 gzs | > tmpStream _ MultiByteBinaryOrTextStream on: ''. > tmpStream converter: UTF8TextConverter new. > self fileOutOn: tmpStream. > s2 _ RWBinaryOrTextStream on: ''. > gzs := GZipWriteStream on: s2. > tmpStream reset. > gzs nextPutAll: (tmpStream binary contentsOfEntireFile asString) contents. > gzs close. > s2 reset. > > fileName _ id isoString, '.translation.gz.mime'. > fileStream _ FileStream newFileNamed: fileName. > fileStream nextPutAll: (Base64MimeConverter mimeEncode: s2) contents. > fileStream close. > ! ! > > > !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak > availableForLocaleID: localeID > "Answer available locale ID. > If translator is not found for correct locale ID, then isoLanguage is > attempted for the key." > ^ self cachedTranslations > at: localeID > ifAbsent: [localeID hasParent > ifTrue: [self cachedTranslations > at: localeID parent > ifAbsent: [self default]] > ifFalse: [self default]]! ! > > !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak > default > "Answer translator for backstop" > "self default translate: 'test'" > ^ self new > localeID: (LocaleID isoLanguage: 'en')! ! > > !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/15/2005 02:08'! > localeID: localeID > "For backward compatibility, see NaturalLanguageTranslator >> fileOutHeaderOn:." > ^ self newLocaleID: localeID! ! > > !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/7/2005 23:17'! > newLocaleID: localeID > ^ self cachedTranslations > at: localeID > ifAbsentPut: [self new localeID: localeID]! ! > > !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/8/2005 00:39'! > removeLocaleID: localeID > "self removeLocaleID: (LocaleID isoString: 'ja-kids')" > ^ self cachedTranslations > removeKey: localeID > ifAbsent: []! ! > > !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 9/7/2005 21:53'! > translate: aString to: localeID > ^ (self availableForLocaleID: localeID) > translate: aString! ! > > !NaturalLanguageTranslator class methodsFor: 'class initialization' stamp: 'tak 9/8/2005 00:56'! > startUp: resuming > resuming > ifFalse: [^ self]. > self loadAvailableExternalLocales! ! > > !NaturalLanguageTranslator class methodsFor: 'file-services' stamp: 'tak 3/14/2005 15:51'! > loadForLocaleIsoString: localeString fromGzippedMimeLiteral: mimeString > "merge the translation from the mime literal." > | stream localeID translator gs rbStream s currentPlatform | > s := Base64MimeConverter mimeDecodeToBytes: mimeString readStream. > s reset. > gs := GZipReadStream on: s. > rbStream := MultiByteBinaryOrTextStream with: gs contents asString. > rbStream converter: UTF8TextConverter new. > rbStream reset. > localeID := LocaleID isoString: localeString. > currentPlatform := Locale currentPlatform. > [Locale > currentPlatform: (Locale localeID: localeID). > stream := ReadStream on: rbStream contents] > ensure: [Locale currentPlatform: currentPlatform]. > translator := self localeID: localeID. > translator loadFromStream: stream. > LanguageEnvironment resetKnownEnvironments! ! > > !NaturalLanguageTranslator class methodsFor: 'private loading' stamp: 'tak > loadTranslatorForIsoLanguage: isoLanguage isoCountry: isoCountry > "private - load the translations from <prefs>/locale/ directory > the procedure is to assure the existence of a translator for the > given language/country and then load the external translations for this translator" > > | translator | > translator := self newLocaleID: (LocaleID isoLanguage: isoLanguage isoCountry: isoCountry). > > self loadExternalTranslationsFor: translator! ! > > !NaturalLanguageTranslator class methodsFor: 'private' stamp: 'mir 8/31/2005 16:55'! > cleanUpCache > "NaturalLanguageTranslator cleanUpCache" > > self cachedTranslations keys do: [:key | > key isoLanguage size > 2 ifTrue: [self cachedTranslations removeKey: key]]! ! > > > !Project methodsFor: 'language' stamp: 'mir 9/1/2005 00:37'! > localeID > "Answer the natural language for the project" > > | prev | > ^ self projectParameterAt: #localeID > ifAbsentPut: [ > (prev _ self previousProject) > ifNotNil: [prev projectParameterAt: #localeID ifAbsent: [LocaleID > ifNil: [LocaleID current]]! ! > > > !SecurityManager methodsFor: 'accessing' stamp: 'tak 3/15/2005 00:45'! > primSecureUserDirectory > <primitive: 'primitiveGetSecureUserDirectory' module: 'SecurityPlugin'> > ^ nil! ! > > !SecurityManager methodsFor: 'accessing' stamp: 'tak 3/15/2005 00:46'! > secureUserDirectory > "SecurityManager default secureUserDirectory" > | dir | > dir := self primSecureUserDirectory. > ^ dir > ifNil: [FileDirectory default pathName] > ifNotNil: [(FilePath pathName: dir isEncoded: true) asSqueakPathName]! ! > > > !String methodsFor: 'translating' stamp: 'tak 9/7/2005 23:00'! > translated > "answer the receiver translated to the default language" > ^ self translatedTo: LocaleID current! ! > > !String methodsFor: 'translating' stamp: 'tak 9/7/2005 12:07'! > translatedTo: localeID > "answer the receiver translated to the given locale id" > ^ NaturalLanguageTranslator translate: self to: localeID! ! > > > !ByteString methodsFor: 'comparing' stamp: 'tak 11/6/2005 22:38'! > primitiveFindSubstring: key in: body startingAt: start matchTable: > "Answer the index in the string body at which the substring key first occurs, at or beyond start. The match is determined using matchTable, which can be used to effect, eg, case-insensitive matches. If no match is found, zero will be returned. > > The algorithm below is not optimum -- it is intended to be translated to C which will go so fast that it wont matter." > | index | > <primitive: 'primitiveFindSubstring' module: 'MiscPrimitivePlugin'> > self var: #key declareC: 'unsigned char *key'. > self var: #body declareC: 'unsigned char *body'. > self var: #matchTable declareC: 'unsigned char *matchTable'. > > key size = 0 ifTrue: [^ 0]. > start to: body size - key size + 1 do: > [:startIndex | > index _ 1. > [(matchTable at: (body at: startIndex+index-1) asciiValue + 1) > = (matchTable at: (key at: index) asciiValue + 1)] > whileTrue: > [index = key size ifTrue: [^ startIndex]. > index _ index+1]]. > ^ 0 > " > ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 1 matchTable: > ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 2 matchTable: CaseSensitiveOrder 7 > ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 8 matchTable: CaseSensitiveOrder 0 > ' ' findSubstring: 'abc' in: 'abcdefABcd' startingAt: 2 matchTable: CaseSensitiveOrder 0 > ' ' findSubstring: 'abc' in: 'abcdefABcd' startingAt: 2 matchTable: CaseInsensitiveOrder 7 > "! ! > > > !TextStyle methodsFor: 'fonts and font indexes' stamp: 'yo 3/17/2005 11:10'! > addNewFontSize: pointSize > "Add a font in specified size to the array of fonts." > | f d newArray t isSet fallbackStyle | > fontArray first emphasis ~= 0 ifTrue: [ > t _ TextConstants at: self fontArray first familyName asSymbol. > t fonts first emphasis = 0 ifTrue: [ > ^ t addNewFontSize: pointSize. > ]. > ]. > > pointSize <= 0 ifTrue: [^ nil]. > fontArray do: [:s | > s pointSize = pointSize ifTrue: [^ s]. > ]. > > (isSet _ fontArray first isKindOf: TTCFontSet) > ifTrue:[ > | fonts | > fonts _ fontArray first fontArray collect: [ :font | > | newFont | > (font isNil) > ifTrue: [newFont _ nil] > ifFalse: [ > newFont _ (font ttcDescription size > 256) > ifTrue: [MultiTTCFont new initialize] > ifFalse: [TTCFont new initialize]. > newFont ttcDescription: font ttcDescription. > newFont pixelSize: pointSize * 96 // 72. > font derivativeFonts notEmpty ifTrue: [font derivativeFonts do: [ :proto | > proto ifNotNil: [ > d _ proto class new initialize. > d ttcDescription: proto ttcDescription. > d pixelSize: newFont pixelSize. > newFont derivativeFont: d]]]. > ]. > newFont]. > f _ TTCFontSet newFontArray: fonts] > ifFalse: [ > f _ TTCFont new initialize. > f ttcDescription: fontArray first ttcDescription. > f pointSize: pointSize. > fontArray first derivativeFonts do: [:proto | > proto ifNotNil: [ > d _ TTCFont new initialize. > d ttcDescription: proto ttcDescription. > d pointSize: f pointSize. > f derivativeFont: d. > ]. > ]. > ]. > isSet ifFalse: [ > fallbackStyle _ TextStyle named: (fontArray first fallbackFont > ]. > newArray _ ((fontArray copyWith: f) asSortedCollection: [:a :b | a pointSize <= b pointSize]) asArray. > self newFontArray: newArray. > isSet ifTrue: [ > TTCFontSet register: newArray at: newArray first familyName asSymbol. > ]. > isSet ifFalse: [ > f setupDefaultFallbackFontTo: fallbackStyle. > f derivativeFonts do: [:g | g setupDefaultFallbackFontTo: fallbackStyle]. > ]. > ^ self fontOfPointSize: pointSize > ! ! > > > !TTCFont methodsFor: 'objects from disk' stamp: 'yo 3/17/2005 11:21'! > objectForDataStream: refStrm > | dp | > "I am about to be written on an object file. Write a > reference to a known FontSet in the other system instead." > > "a path to me" > dp _ DiskProxy global: #TTCFont selector: #familyName:pointSize:emphasis: > args: {self familyName. self pointSize. self emphasis}. > refStrm replace: self with: dp. > ^ dp. > ! ! > > > !TTCFont class methodsFor: 'instance creation' stamp: 'yo 8/1/2005 15:06'! > familyName: n pointSize: s emphasis: code > > "(TTCFont familyName: 'BitstreamVeraSans' pointSize: 12 emphasis: 0)" > | t ret index | > t _ self registry at: n asSymbol ifAbsent: [#()]. > t isEmpty ifTrue: [ > t _ (TextConstants at: #DefaultTextStyle) fontArray. > ret _ t first. > ret pointSize >= s ifTrue: [^ ret emphasis: code]. > index _ 2. > [index <= t size and: [(t at: index) pointSize <= s]] whileTrue: [ > ret _ t at: index. > index _ index + 1. > ]. > ^ ret emphasis: code. > ]. > ^ ((TextStyle named: n) addNewFontSize: s) emphasis: code. > ! ! > > !TTCFont class methodsFor: 'other' stamp: 'yo 3/17/2005 11:11'! > registerAll > " > TTCFont registerAll > " > > TextStyle allInstancesDo: [:e | > (e fontArray first isMemberOf: TTCFont) ifTrue: [ > self register: e fontArray at: e fontArray first familyName asSymbol. > ]. > ]. > ! ! > > !TTCFont class methodsFor: 'other' stamp: 'yo 3/17/2005 10:52'! > register: anObject at: symbolName > > self registry at: symbolName put: anObject. > ! ! > > !TTCFont class methodsFor: 'other' stamp: 'yo 3/17/2005 10:52'! > registry > > ^ Registry isNil > ifTrue: [Registry := IdentityDictionary new] > ifFalse: [Registry]. > ! ! > > !TTCFont class methodsFor: 'other' stamp: 'yo 3/17/2005 10:53'! > unregister: symbolName > > self registry removeKey: symbolName ifAbsent: []. > ! ! > > > !WideSymbol class methodsFor: 'instance creation' stamp: 'tak 9/14/2005 > newFromStream: s > "Use WideString rather than 'super' to avoid making multiple instance of WideSymbol" > ^ self > intern: (WideString newFromStream: s)! ! > > NaturalLanguageTranslator class removeSelector: #current! > NaturalLanguageTranslator class removeSelector: #isoLanguage:! > NaturalLanguageTranslator class removeSelector: #isoLanguage:isoCountry:! > LocaleID class removeSelector: #default! > Locale initialize! > Object subclass: #LanguageEnvironment > instanceVariableNames: 'id' > classVariableNames: 'ClipboardInterpreterClass Current SystemConverterClass' > poolDictionaries: '' > category: 'Multilingual-Languages'! > ISOLanguageDefinition class removeSelector: #convertISOCountriesFrom:! > ISOLanguageDefinition class removeSelector: #isoCountries! > ISOLanguageDefinition class removeSelector: #isoCountryString! > ISOLanguageDefinition class removeSelector: #readISOCountriesFrom:! > Object subclass: #ISOLanguageDefinition > instanceVariableNames: 'iso3 iso2 iso3Alternate language' > classVariableNames: 'ISO2Countries ISO2Table ISO3Countries ISO3Table' > poolDictionaries: '' > category: 'System-Localization'! > "Postscript: > " > ISOLanguageDefinition initISOCountries. > ! > > ---------------------------------------------------------------------------- ---- > 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 2 March 2006 at 4:13:34 pm'! > "Change Set: percentEncodingFix > Date: 22 September 2005 > Author: Korakurider > > + When Squeak is launched by openning .pr file, passed filename is systemString > (shift-jis on windows for instance). That has to be converted to Squeak-native string. > + reimplementation of decoding percent-encoded-string has to be modified to support > utf8 based encoding. > "! > > Object subclass: #GetTextInterchange > instanceVariableNames: 'language stream' > classVariableNames: '' > poolDictionaries: '' > category: 'Babel-Kernel'! > GetTextInterchange subclass: #GetTextExporter > instanceVariableNames: '' > classVariableNames: '' > poolDictionaries: '' > category: 'Babel-Kernel'! > GetTextInterchange subclass: #GetTextImporter > instanceVariableNames: 'msgId msgStr' > classVariableNames: '' > poolDictionaries: '' > category: 'Babel-Kernel'! > KeyboardInputInterpreter subclass: #MacUnicodeInputInterpreter > instanceVariableNames: 'keyValueIndex ' > classVariableNames: '' > poolDictionaries: '' > category: 'Multilingual-TextConversion'! > > !ButtonProperties methodsFor: 'accessing' stamp: 'yo 11/30/2005 14:20'! > establishEtoyLabelWording > "Set the label wording, unless it has already been manually edited" > > | itsName | > > self isTileScriptingElement ifFalse: [^self]. > itsName _ target externalName. > self addTextToButton: itsName, ' ', arguments first. > visibleMorph setBalloonText: > ('click to run the script "{1}" in player named "{2}"' translated format: > ! ! > > > !CharacterScanner methodsFor: 'scanning' stamp: 'tak 11/8/2005 11:25'! > scanCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta > > | startEncoding selector | > (sourceString isByteString) ifTrue: [^ self basicScanCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta.]. > > (sourceString isWideString) ifTrue: [ > startIndex > stopIndex ifTrue: [lastIndex _ stopIndex. ^ stops at: EndOfRun]. > startEncoding _ (sourceString at: startIndex) leadingChar. > selector _ EncodedCharSet scanSelectorAt: startEncoding. > ^ self perform: selector withArguments: (Array with: startIndex with: stopIndex with: sourceString with: rightX with: stopConditions with: kernDelta). > ]. > > ^ stops at: EndOfRun > ! ! > > > !EncodedCharSet class methodsFor: 'class methods' stamp: 'tak 11/5/2005 18:14'! > charFromUnicode: unicode > > | table index | > unicode < 128 ifTrue: [^ Character value: unicode]. > > table _ self ucsTable. > index _ table indexOf: unicode. > index = 0 ifTrue: [ > ^ nil. > ]. > > ^ Character leadingChar: self leadingChar code: index - 1. > > ! ! > > !EncodedCharSet class methodsFor: 'class methods' stamp: 'tak 11/8/2005 > scanSelectorAt: encoding > | charset | > charset := self charsetAt: encoding. > ^ charset > ifNil: [LanguageEnvironment scanSelector] > ifNotNil: [charset scanSelector]! ! > > !EncodedCharSet class methodsFor: 'accessing - displaying' stamp: 'tak 11/8/2005 11:26'! > scanSelector > ^ #scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:! ! > > > !GetTextInterchange methodsFor: 'as yet unclassified'! > defaultFileName > ^ language displayLanguage , '.po'! ! > > !GetTextInterchange methodsFor: 'as yet unclassified'! > formatReplacements > | t1 | > t1 := OrderedCollection new. > ^ t1! ! > > !GetTextInterchange methodsFor: 'as yet unclassified'! > formatString: t1 > | t2 | > t2 := t1. > self formatReplacements > do: [:t3 | t2 := t2 copyReplaceAll: t3 key with: t3 value]. > ^ t2! ! > > > !GetTextExporter methodsFor: 'as yet unclassified'! > createHeaders > | t1 | > t1 := OrderedCollection new. > t1 add: 'Project-Id-Version' -> 'Small-Land'. > t1 add: 'POT-Creation-Date' -> self currentDateAndTime. > t1 add: 'PO-Revision-Date' -> self currentDateAndTime. > t1 add: 'Last-Translator' -> ''. > t1 add: 'Language-Team' -> ''. > t1 add: 'MIME-Version' -> '1.0'. > t1 add: 'Content-Type' -> 'text/plain; charset=ISO-8859-1'. > t1 add: 'Content-Transfer-Encoding' -> '8bit'. > ^ t1! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > currentDateAndTime > ^ String > streamContents: [:t1 | > t1 nextPutAll: Date today yyyymmdd; > space. > Time now > print24: true > showSeconds: false > on: t1. > t1 nextPutAll: '-0000']! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > exportHeader > self exportMsgId: ''. > self exportMsgStr: ''. > self createHeaders > do: [:t1 | self exportHeaderLineKey: t1 key value: t1 value]. > stream cr; cr! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > exportHeaderLineKey: t1 value: t2 > stream nextPut: $"; > nextPutAll: t1; > nextPut: $:; > space; > nextPutAll: t2; > nextPutAll: '\n'; > nextPut: $"; > cr! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > exportMsgId: t1 > stream nextPutAll: 'msgid'; > space; > nextPut: $"; > > nextPutAll: (self formatString: t1); > nextPut: $"; > cr! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > exportMsgStr: t1 > stream nextPutAll: 'msgstr'; > space; > nextPut: $"; > > nextPutAll: (self formatString: t1); > nextPut: $"; > cr! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > exportPhrase: t1 translation: t2 > t1 isEmpty > ifTrue: [^ self]. > self exportMsgId: t1. > self exportMsgStr: t2. > stream cr! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > exportTranslations > language translations > keysAndValuesDo: [:t1 :t2 | self exportPhrase: t1 translation: t2]! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > exportUntranslated > language untranslated > do: [:t1 | self exportPhrase: t1 translation: '']! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > export: t1 > language := t1. > [stream := CrLfFileStream forceNewFileNamed: self defaultFileName. > stream lineEndConvention: #lf. > stream converter: Latin1TextConverter new. > self exportHeader. > self exportTranslations. > self exportUntranslated] > ensure: [stream close]! ! > > !GetTextExporter methodsFor: 'as yet unclassified'! > formatReplacements > | t1 | > t1 := super formatReplacements. > t1 add: '\' -> '\\'. > t1 add: String cr -> '\n'. > t1 add: String tab -> '\t'. > t1 add: '"' -> '\"'. > ^ t1! ! > > > !GetTextImporter methodsFor: 'as yet unclassified'! > formatReplacements > | t1 | > t1 := super formatReplacements. > t1 add: '\\' -> '\'. > t1 add: '\n' -> String cr. > t1 add: '\t' -> String tab. > t1 add: '\"' -> '"'. > ^ t1! ! > > !GetTextImporter methodsFor: 'as yet unclassified'! > import: t1 > language := t1. > [stream := StandardFileStream oldFileNamed: self defaultFileName. > stream text. > self parse] > ensure: [stream notNil > ifTrue: [stream close]]! ! > > !GetTextImporter methodsFor: 'as yet unclassified'! > parse > | t1 | > [stream atEnd] > whileFalse: [t1 := stream upTo: Character linefeed. > self parseLine: t1]! ! > > !GetTextImporter methodsFor: 'as yet unclassified'! > parseLine: t1 > (t1 beginsWith: 'msgid') > ifTrue: [self parseMsgId: t1. > ^ self]. > (t1 beginsWith: 'msgstr') > ifTrue: [self parseMsgStr: t1. > ^ self]. > self storeTranslation! ! > > !GetTextImporter methodsFor: 'as yet unclassified'! > parseMsgId: t1 > msgId := self parseMsgSection: 'msgid' line: t1! ! > > !GetTextImporter methodsFor: 'as yet unclassified'! > parseMsgSection: t1 line: t2 > | t3 t4 t5 | > t3 := t2 withBlanksTrimmed. > t4 := (t3 allButFirst: t1 size) withBlanksTrimmed. > t5 := t4 allButFirst allButLast. > ^ t5! ! > > !GetTextImporter methodsFor: 'as yet unclassified'! > parseMsgStr: t1 > msgStr := self parseMsgSection: 'msgstr' line: t1! ! > > !GetTextImporter methodsFor: 'as yet unclassified'! > storeTranslation > msgId isNil | msgStr isNil > ifTrue: [^ self]. > msgId isEmpty > ifTrue: [^ self]. > NaturalLanguageTranslator registerPhrase: msgId. > msgStr isEmpty > ifFalse: [language > phrase: msgId > translation: (self formatString: msgStr)]. > msgId := nil. > msgStr := nil! ! > > > !HTTPDownloadRequest methodsFor: 'initialize' stamp: 'KR 9/4/2005 10:33'! > for: aUrl in: aLoader > url _ aUrl. > loader _ aLoader. > semaphore _ Semaphore new.! ! > > > !LanguageEditor methodsFor: 'gui methods' stamp: 'yo 11/29/2005 11:20'! > codeSelectedTranslationAsMimeString > | keys code tmpStream s2 gzs cont | > keys := selectedTranslations > collect: [:key | self translations at: key]. > code := String > streamContents: [:aStream | self translator fileOutOn: aStream keys: > > tmpStream _ MultiByteBinaryOrTextStream on: ''. > tmpStream converter: UTF8TextConverter new. > translator fileOutHeaderOn: tmpStream. > tmpStream nextPutAll: code. > s2 _ RWBinaryOrTextStream on: ''. > gzs := GZipWriteStream on: s2. > tmpStream reset. > gzs nextPutAll: (tmpStream binary contentsOfEntireFile asString) contents. > gzs close. > s2 reset. > > cont _ String streamContents: [:strm | > strm nextPutAll: '"Gzip+Base64 encoded translation for;'; cr. > strm nextPutAll: '#('. > keys do: [:each | strm nextPutAll: '''', each, ''' '.]. > strm nextPutAll: ')"'; cr; cr. > strm nextPutAll: 'NaturalLanguageTranslator loadForLocaleIsoString: '. > strm nextPut: $'. > strm nextPutAll: translator localeID isoString. > strm nextPut: $'. > strm nextPutAll: ' fromGzippedMimeLiteral: '. > strm nextPut: $'. > strm nextPutAll: (Base64MimeConverter mimeEncode: s2) contents. > strm nextPutAll: '''.'. > strm cr. > ]. > > (StringHolder new contents: cont) > openLabel: 'exported codes in Gzip+Base64 encoding'! ! > > !LanguageEditor methodsFor: 'initialization - toolbar' stamp: 'AB 3/2/2006 > createMainToolbar > "create a toolbar for the receiver" > | toolbar | > toolbar := self createRow. > "" > " toolbar > addMorphBack: (self > createUpdatingButtonWording: #debugWording > action: #switchDebug > help: 'Switch the debug flag')." > toolbar addTransparentSpacerOfSize: 5 @ 0. > "" > toolbar > addMorphBack: (self > createButtonLabel: 'new' > action: #newTranslations > help: 'Create translations for new language.'). > toolbar > addMorphBack: (self > createButtonLabel: 'save' > action: #saveToFile > help: 'Save the translations to a file'). > toolbar > addMorphBack: (self > createButtonLabel: 'load' > action: #loadFromFile > help: 'Load the translations from a file'). > toolbar > addMorphBack: (self > createButtonLabel: 'merge' > action: #mergeFromFile > help: 'Merge the current translations with the translations in a file'). > "" > toolbar addTransparentSpacerOfSize: 5 @ 0. > toolbar > addMorphBack: (self > createButtonLabel: 'apply' > action: #applyTranslations > help: 'Apply the translations as much as possible.'). > "" > toolbar addTransparentSpacerOfSize: 5 @ 0. > toolbar > addMorphBack: (self > createButtonLabel: 'check translations' > action: #check > help: 'Check the translations and report the results.'). > toolbar > addMorphBack: (self > createButtonLabel: 'report' > action: #report > help: 'Create a report.'). > toolbar > addMorphBack: (self > createButtonLabel: 'gettext' > action: #getText > help: 'Interface with gettext.'). > "" > ^ toolbar! ! > > !LanguageEditor methodsFor: 'initialization' stamp: 'AB 3/2/2006 16:07'! > initializeOn: aLanguage > "initialize the receiver on aLanguage" > "" > selectedTranslation := 0. > selectedUntranslated := 0. > selectedTranslations := IdentitySet new. > "" > translator := aLanguage. > "" > self model: aLanguage. > self setLabel: 'Language editor for: ' translated , self translator name. > "" > self initializeToolbars. > self initializePanels. > self initializeStatusbar. > self initializeNewerKeys. > ! ! > > !LanguageEditor methodsFor: 'as yet unclassified'! > getText > | t1 | > t1 := MenuMorph new defaultTarget: self. > t1 > add: 'gettext export' translated > target: self > selector: #getTextExport. > t1 lastItem setBalloonText: 'Exports the translations to GetText format.' > t1 > add: 'gettext import' translated > target: self > selector: #getTextImport. > t1 lastItem setBalloonText: 'Imports the translations from GetText format.' translated. > t1 popUpInWorld! ! > > !LanguageEditor methodsFor: 'as yet unclassified'! > getTextImport > self > withUnboundModelDo: [:t1 | Cursor wait > showWhile: [GetTextImporter new import: t1]]! ! > > !LanguageEditor methodsFor: 'as yet unclassified'! > withUnboundModelDo: t1 > | t2 | > t2 := self model. > self model: nil. > [t1 value: t2] > ensure: [self model: t2]! ! > > > !LanguageEnvironment methodsFor: 'utilities' stamp: 'tak 11/28/2005 > setupSqueaklandSpecifics > "Write language specific settings here"! ! > > > !JapaneseEnvironment methodsFor: 'utilities' stamp: 'KR 1/30/2006 22:28'! > setupSqueaklandSpecifics > | server | > ChangeSet current name: 'Unnamed' translated , '1'. > ServerDirectory resetServers. > server := SuperSwikiServer new type: #http; > server: 'squeakland.jp'; > directory: '/super/SuperSwikiProj'; > acceptsUploads: (Preferences eToyFriendly not); > encodingName: 'shift_jis'. > ServerDirectory servers at: 'Squeakland.JP' put: server. > Smalltalk garbageCollect! ! > > > !LanguageEnvironment class methodsFor: 'private' stamp: 'yo 11/29/2005 > initKnownEnvironments > "LanguageEnvironment initKnownEnvironments" > > | env known id | > known := Dictionary new. > self allSubclassesDo: [:subClass | > subClass supportedLanguages do: [:language | > env := subClass new. > id _ LocaleID isoString: language. > env localeID: id. > known at: id put: env]]. > ^known! ! > > > !Locale class methodsFor: 'accessing' stamp: 'tak 10/18/2005 22:33'! > currentPlatform: locale during: aBlock > "Alter current language platform during a block" > | backupPlatform | > backupPlatform := self currentPlatform. > [self currentPlatform: locale. > aBlock value] > ensure: [self currentPlatform: backupPlatform]! ! > > > !MacUnicodeInputInterpreter methodsFor: 'keyboard' stamp: 'tetha > nextCharFrom: sensor firstEvt: evtBuf > | keyValue mark | > keyValue := evtBuf at: self keyValueIndex. > mark := self japaneseSpecialMark: keyValue. > mark notNil > ifTrue: [^ mark]. > keyValue < 256 > ifTrue: [^ (Character value: keyValue) squeakToIso]. > "Smalltalk systemLanguage charsetClass charFromUnicode: keyValue." > ^ Unicode value: keyValue! ! > > !MacUnicodeInputInterpreter methodsFor: 'initialization' stamp: 'ts > initialize > | satisfiesVersion | > satisfiesVersion := self > majorMinorBuildFrom: SmalltalkImage current vmVersion > satisfies: [:major :minor :build | major >= 3 > and: [minor >= 8 > and: [build >= 7]]]. > satisfiesVersion > ifTrue: [keyValueIndex := 6] > ifFalse: [keyValueIndex := 3]! ! > > !MacUnicodeInputInterpreter methodsFor: 'accessing' stamp: 'ts 10/29/2005 > keyValueIndex > ^ keyValueIndex! ! > > !MacUnicodeInputInterpreter methodsFor: 'version check' stamp: 'ts 10/29/2005 10:17'! > majorMinorBuildFrom: aString satisfies: aBlock > | v | > v := aString > ifNil: [^ false]. > v := ((v copyAfter: $]) > findTokens: $ ) last findTokens: $.. > v size = 3 > ifFalse: [^ false]. > v := v > collect: [:s | s initialIntegerOrNil > ifNil: [^ false]]. > ^ aBlock valueWithArguments: v asArray! ! > > !MacUnicodeInputInterpreter methodsFor: 'conversion' stamp: 'tetha > japaneseSpecialMark: anInteger > "For japanese special marks. > This method converts 'YEN SIGN' (16rA5) to 'REVERSE SOLIDUS' (16r5C) > and use Japanese leading characters instead of Unicode for below > characters. > 'CENT SIGN' (16rA2) |
In reply to this post by Alberto Berti
Hi Alberto,
Perhaps I am a part of responsible for this inconvenience... When I started to integrate Diego's original Language Editor and Yoshiki's m17n, I have just ignored gettext support because the source code was missing and I knew nothing about gettext. But I realized the importance of standard way when I tried to use gettext tool today. > I've made some other steps... :) > I've prepared two changesets with changes coming from the SqueakLand-dev > image and from the SmallLand's one. > > To load them, save them on disk, open a vanilla 3.8 image, take a > Filelist from the tools flap and "install" them in order. > > If all goes well, you should be able to open a LanguageEditor which let you > insert a new LocaleID via the "new" button (just like the Squeakland-dev > image) and export/import translation to/from gettext format using the > "gettext" button backported from the SmallLand image. Actually that's a great job. By the way, where can I get latest SmallLand image and source? I'm willing to help you to improve translation issue. Cheers, - Takashi |
Hi Takashi,
> Actually that's a great job. By the way, where can I get latest > SmallLand image and source? I'm willing to help you to improve > translation issue. You can get the developer's small-land image (one with sources and changes) downloading this image: http://www.small-land.org/squeak38/DEVELOPER-SqueakSmallLand38-0324-1226.zip And updating it. Remember to switch to English using the option "poner el idioma" (set language) under the menu "Configuración" (Configuration). Then you'll find the option "update from server" in the very same menu. Cheers, -- Diego > Cheers, > - Takashi > > > > -- ========================================== Diego Gomez Deck ------------------------------------------ http://www.consultar.com/DiegoGomezDeck/ http://diegogomezdeck.blogspot.com/ http://smalltalk.consultar.com/ ========================================== |
In reply to this post by Takashi Yamamiya
Takashi Yamamiya wrote:
> Hi Alberto, > > Perhaps I am a part of responsible for this inconvenience... When I > started to integrate Diego's original Language Editor and Yoshiki's > m17n, I have just ignored gettext support because the source code was > missing and I knew nothing about gettext. But I realized the > importance of standard way when I tried to use gettext tool today. yeah, gettext is the de-facto standard on open source (and mostly unix based) software projects. I works very well. > >> I've made some other steps... :) >> I've prepared two changesets with changes coming from the >> SqueakLand-dev image and from the SmallLand's one. >> If all goes well, you should be able to open a LanguageEditor which >> let you >> insert a new LocaleID via the "new" button (just like the >> Squeakland-dev image) and export/import translation to/from gettext >> format using the "gettext" button backported from the SmallLand image. > > > Actually that's a great job. By the way, where can I get latest > SmallLand image and source? I'm willing to help you to improve > translation issue. Very good! :-) For Small-Land, i've used this http://squeak.linex.org/W32/Squeak38-SmallLand-Imagen-1226.zip image. I don't know if there is newer version somewhere. I does contain all the needed stuff however. The remaining problem i'm facing right now it's the slow down of the image when a language editor is open (after installing my backport changesets). I tried to profile LanguageEditor's execution, but still without any real success due to my poor knowledge of all the m17n infrastructure which involves some very important pieces of code of the image ( stuff around String class implementation, charset decoders/encoders and so on). One problem that i've encountered while debugging the slow down is that it doesn't happen as soon as a new LanguageEditor is istantiated but some seconds after that. Maybe it is some code started by some kind of timer, but i haven't any insight. However, now i do use LanguageEditor just to import from gettext so i don't need it to be always opened, i kill it as soon as the import process ends. Another minor problem is that gettext files are exported encoded in iso-8859-1 ( for my language, italian) i would be much better to have them exported as utf-8 files, but i still don't have figured out how to do that. Maybe there are other problems dealing with languages so different from english like yours. Please, take a look at the changesets and try them by yourself, and report your experience. Any report also from other languages is more than welcome! cheers Alberto |
In reply to this post by Diego Gomez Deck
Hi Diego,
Diego Gomez Deck wrote: > You can get the developer's small-land image (one with sources and > changes) downloading this image: > > http://www.small-land.org/squeak38/DEVELOPER-SqueakSmallLand38-0324-1226.zip Thanks, it helps me a lot! > And updating it. > > Remember to switch to English using the option "poner el idioma" (set > language) under the menu "Configuracio'n" (Configuration). > > Then you'll find the option "update from server" in the very same menu. That was important point. Additionally, "Configuration - switch to expert mode" was significant. At first, I didn't notice this menu, and got lost. But now, I am happily playing around in it. Thank you, - Takashi |
In reply to this post by Alberto Berti
Hi Alberto,
> The remaining problem i'm facing right now it's the slow down of the > image when a language editor is open (after installing my backport > changesets). I tried to profile LanguageEditor's execution, but still > without any real success due to my poor knowledge of all the m17n > infrastructure which involves some very important pieces of code of the > image ( stuff around String class implementation, charset > decoders/encoders and so on). One problem that i've encountered while > debugging the slow down is that it doesn't happen as soon as a new > LanguageEditor is istantiated but some seconds after that. Maybe it is > some code started by some kind of timer, but i haven't any insight. surprisingly faster. But this code is less tested, and please beware it. > However, now i do use LanguageEditor just to import from gettext so i > don't need it to be always opened, i kill it as soon as the import > process ends. I think this is a smart way to make translations. > Another minor problem is that gettext files are exported encoded in > iso-8859-1 ( for my language, italian) i would be much better to have > them exported as utf-8 files, but i still don't have figured out how to > do that. Maybe I can try it next weekend. Cheers, - Takashi fastLanguageEditor-tak.cs.gz (2K) Download Attachment |
From our personnal experience to translate a lot of Squeak in French
with .po file I will say: . To translate in French, we exported the translation file in a .po file. Later we cut this .po in small pieces to get several translators involved. The first problem came from the translation encoding, althought we state about outputting to iso-8859-1 (it was pre-utf8 time with Squeak3.7), we got translation with several different encoding. It is not a big deal because we can use enconding conversion tools as iconv (althought it does not deal with the macroman encoding) . Then the big bad point, is about the lost of context when dealing with translation. When using .po file to translate you are totally blind, you don't know the context of the message, then the translation may not be accurate (and well it is not accurate) Now I think that the best way to deal for translation is to split the translation effort in department: one person to translate E-toys, another one for the menu, another one for a specific package (connectors, kedema, ...) In this case the translation can be done directly from Squeak, with the language editor and the application to translate open. INDEED doing that way we take advantage of the Smalltalk living system idea (one thing that make it interesting). Later each translator can export it .translation file, then all these files can be merge back in the LanguageEditor. The point to be carefull with is when merging the different .translation files in the LanguageEditor. But it has been said to be ok. Good luck. Hilaire Fernandes Takashi Yamamiya a écrit : >> However, now i do use LanguageEditor just to import from gettext so i >> don't need it to be always opened, i kill it as soon as the import >> process ends. > > > I think this is a smart way to make translations. > >> Another minor problem is that gettext files are exported encoded in >> iso-8859-1 ( for my language, italian) i would be much better to have >> them exported as utf-8 files, but i still don't have figured out how >> to do that. > > > Maybe I can try it next weekend. > > Cheers, > - Takashi > > > ------------------------------------------------------------------------ > > -- ADD R0,R1,R2,LSL #2 |
Hi guys
would it be possible that we capitalize and share (using squeaksource for example) all the enh of the translation tools? Stef |
In reply to this post by Alberto Berti
Alberto and Jeroen,
I should mention one important thing. We at Viewpoints Research are always interested in providing more language support for eToys in Squeakland version. If you are interested in providing a (relatively) complete set of translations for eToys, please send the .translation file to us. The translations can be merged into the mainstream Squeak image, but Squeakland is packaged in a way that the school use in mind. The user can download it from www.squeakland.org and instantly use it at schools and homes. -- Yoshiki |
In reply to this post by Takashi Yamamiya
Hello All,
I im giving some feeback on the language translations. When i import Alberto's 2 changesets, i get a full working LanguageTranslator with new button and gettext import/export. But - this is a 'known' issue - it slows the system down to unworkable speed. After the Translator is closed, things speed up again. When i apply Takashi's changes over that and i start the LanguageEditor - the system freezes. Please note that im a beginning sqeaker, so i cant tell what the cause of all this is. I've looked through the changesets and compareed the code of the different images (smalland, squeakbase and squeakplugin-dev) and understand that there are two (or maybe more) differente branches of development ... But i dont understand (yet) what and why exactly is different in these solutions. If somebody could explain (a bit) it would be very helpfull (at least to me). If worth anything this helps me a lot to discover squak better and i've learned a great deal already by just trying to grasp all changes etc. For now Ill just concentrate on translating some of the obvious things to Dutch. When i have some more or less complete translation i could post (to squeakland). Maybe it would be a good idea to make some kind of repository of all done translations (if any) ? Keep up the good work, ill try to kick in where i can ! Greetings - Jeroen "Takashi Yamamiya" <[hidden email]> wrote in message news:[hidden email]... > Hi Alberto, > > I post a patch for speed up. Your Language Editor might become > surprisingly faster. But this code is less tested, and please beware > it. > > Cheers, > - Takashi > |
Hi Jeroen,
> When i apply Takashi's changes over that and i start the LanguageEditor - > the system freezes. Thank you for the feedback. I have tested the patch on Squeak3.9a-7006.image with 01LanguageBackport.1.cs and 02LanguageBackport.1.cs. Could you tell me which version did you try? In any case, if you have a file named SqueakDebug.log in your directory, please send me as it is helpful for debugging. > I've looked through the changesets and compareed the code of the different > images (smalland, squeakbase and squeakplugin-dev) and understand that there > are two (or maybe more) differente branches of development ... > But i dont understand (yet) what and why exactly is different in these > solutions. If somebody could explain (a bit) it would be very helpfull (at > least to me). If worth anything this helps me a lot to discover squak better > and i've learned a great deal already by just trying to grasp all changes > etc. SmallLand have been made from Squeak3.7 (correct me if it is wrong). Squeakplugin-dev is from Squeak3.8. The result is Squeakplugin will be merged into mainstream as Squeak3.8.1 and 3.9(?), but have not finished yet. I think maintaining small patches of translation is good idea meanwhile 3.8.1 is comming. > Maybe it would be a good idea to make some kind of repository of all done > translations (if any) ? That's great idea! Cheers, - Takashi |
Takashi,
Thanks for your kind reply. To recap: I have installed the 3 patches in sequence in a plain Squeak3.8-6665.image. After the first 2 patches i have a working editor, but very slow. After applying yours the systems freeezes, does not respond, and squeakdebug.log is not written. I can only quit by Alt-F4. (Im on a windows 2000 prof system). I have been thinking about the following too: The comment from Hillaire about the context, makes very much sense to me: ----- Original Message ----- From: "Hilaire Fernandes" <[hidden email]>: >. Then the big bad point, is about the lost of context when dealing with >translation. When using .po file to translate you are totally blind, you >don't know the context of the message, then the translation may not be >accurate (and well it is not accurate) So i was wildly thinking: Would it be possible to do something like: Activating some kind of 'translation mode' (say by pressing a button in the language editor). While in this mode, i would be able to select any string i see and be able to call the translate function on that... (I dont know how - from the menu or by placing mouse over and press special key?) That would give me a translate fillInTheBlank. Like now in the editor, but called from the spot where the actual string is, ie visible in its own context.I have no idea if this is possible or how, but it seemed like a nice option to me. That way i could just translate what comes to me first. Because as is obvious translating all from the editor or .po is not done easilly / quickly. I appreciate all comments/suggestions etc Thanks again! - Jeroen ----- Original Message ----- From: "Takashi Yamamiya" <[hidden email]> Newsgroups: gmane.comp.lang.smalltalk.squeak.general Sent: Thursday, March 16, 2006 6:40 AM Subject: Re: about translations > Hi Jeroen, > > > When i apply Takashi's changes over that and i start the LanguageEditor - > > the system freezes. > > Thank you for the feedback. I have tested the patch on > Squeak3.9a-7006.image with 01LanguageBackport.1.cs and > 02LanguageBackport.1.cs. Could you tell me which version did you try? > In any case, if you have a file named SqueakDebug.log in your > directory, please send me as it is helpful for debugging. > > > I've looked through the changesets and compareed the code of the different > > images (smalland, squeakbase and squeakplugin-dev) and understand that there > > are two (or maybe more) differente branches of development ... > > But i dont understand (yet) what and why exactly is different in these > > solutions. If somebody could explain (a bit) it would be very helpfull (at > > least to me). If worth anything this helps me a lot to discover squak better > > and i've learned a great deal already by just trying to grasp all changes > > etc. > > SmallLand have been made from Squeak3.7 (correct me if it is > wrong). Squeakplugin-dev is from Squeak3.8. The result is Squeakplugin > will be merged into mainstream as Squeak3.8.1 and 3.9(?), but have not > finished yet. I think maintaining small patches of translation is good > idea meanwhile 3.8.1 is comming. > > > Maybe it would be a good idea to make some kind of repository of all done > > translations (if any) ? > > That's great idea! > > Cheers, > - Takashi > > > > |
Hi Jeroen,
These are another change sets. (I should upload these fixes on some website as stéphane said...) - 01LanguageBackport.2.cs.gz almost same as Alberto's patch, I added a preamble and merged 0473LocaleRefactoring-tak.cs - 02LanguageBackport.2.cs.gz almost same as Alberto's patch, I added a preamble. - 03fastLanguageEditor-tak.2.cs.gz fix NaturalLanguageTranslator >> translated: - 04GetTextUTF8.1.cs.gz export gettext file in UTF-8 Maybe, your problem will be solved with these change sets. I guess the problem was untranslated phrases are registered in a dictionary whenever untranslated phrases are found in String>>translated. > ----- Original Message ----- > From: "Hilaire Fernandes" <[hidden email]>: > >>. Then the big bad point, is about the lost of context when dealing with >>translation. When using .po file to translate you are totally blind, you >>don't know the context of the message, then the translation may not be >>accurate (and well it is not accurate) > > So i was wildly thinking: > > Would it be possible to do something like: > Activating some kind of 'translation mode' (say by pressing a button in the > language editor). While in this mode, i would be able to select any string i > see and be able to call the translate function on that... (I dont know how - > from the menu or by placing mouse over and press special key?) That would > give me a translate fillInTheBlank. Like now in the editor, but called from > the spot where the actual string is, ie visible in its own context.I have no > idea if this is possible or how, but it seemed like a nice option to me. > That way i could just translate what comes to me first. Because as is > obvious translating all from the editor or .po is not done easilly / > quickly. sophisticated enough to do such trick (although, current simplicity is an advantage in programmer's point of view). And I think we should start to more easy goal. Hilaire Fernandes wrote: > Now I think that the best way to deal for translation is to split the > translation effort in department: one person to translate E-toys, > another one for the menu, another one for a specific package > (connectors, kedema, ...) I agree. It is useful if a translation file can be separated in each package (PackageInfo). I think we need a keyword like gettext_noop to mark untranslated phrase, because sometimes #translated is called indirectly and it does not help to find a word. Cheers, - Takashi 01LanguageBackport.2.cs.gz (24K) Download Attachment 02LanguageBackport.2.cs.gz (8K) Download Attachment 03fastLanguageEditor-tak.2.cs.gz (3K) Download Attachment 04GetTextUTF8.1.cs.gz (3K) Download Attachment |
Takashi Yamamiya wrote:
> Hi Jeroen, > > These are another change sets. (I should upload these fixes on some website > as stéphane said...) > > - 01LanguageBackport.2.cs.gz > almost same as Alberto's patch, I added a preamble and merged > 0473LocaleRefactoring-tak.cs > > - 02LanguageBackport.2.cs.gz > almost same as Alberto's patch, I added a preamble. > > - 03fastLanguageEditor-tak.2.cs.gz > fix NaturalLanguageTranslator >> translated: > - 04GetTextUTF8.1.cs.gz > export gettext file in UTF-8 > > Maybe, your problem will be solved with these change sets. I guess the > problem was untranslated phrases are registered in a dictionary > whenever untranslated phrases are found in String>>translated. well, well done Takashi! thanks! I'll wait for you to implement also an UTF-8 import:) I'm going to publish the italian translation along with a howto about how to load it into the image and maybe contribute back. I think to publish also these changesets, i we don't find a better place for them. Another issue i'm facing right now is phrases duplication. Inside the exported .po i find many duplicated phrases which differ only for the number of escapes ( \ characters) that they contain. Here is an example: msgid "\"EToy\" is a vocabulary that provides the equivalent of the 1997-2000 etoy prototype" and then msgid "\\\"EToy\\\" is a vocabulary that provides the equivalent of the 1997-2000 etoy prototype" msgid "\\\\\\\"EToy\\\\\\\" is a vocabulary that provides the equivalent of the 1997-2000 etoy prototype" Such duplication confuses the translator and pollutes the file. I suspect that the guilty piece of the framework may be the GetTextImporter class or some other code involved during po's reparsing. Probably the escapes aren't evaluated correctly and instead they are read as is. Do you have any clue? Anyone has a similar experience? Alberto |
Free forum by Nabble | Edit this page |