status of i18n for Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

status of i18n for Pharo

hilaire
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

Henrik Sperre Johansen

On Apr 28, 2010, at 2:49 53PM, Hilaire Fernandes wrote:

> Are there any work in progress of i18n?
> I need it for DrGeo or I will have to write message in French in the code.
>
> Hilaire
>
Not sure what you mean with work in progress, but an existing alternative is the String>>translated method, which works the same in Squeak and Pharo.

Squeak still contains and entry in the world menu for the tool used to edit language translations (Open -> Language Editor), while in Pharo you have to evaluate LanguageEditor open manually.
To create a new locale entry you want to translate to, you'd use NaturalLanguageTranslator isoLanguage:isoCountry:.

Cheers,
Henry
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

hilaire
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

Stéphane Ducasse
if you extract the code from Etoy ....
we are open you know :)

On Apr 28, 2010, at 10:35 PM, Hilaire Fernandes wrote:

> I was thinking more about something like the Gettext support as found in Etoys.
>
> Hilaire
>
> Henrik Johansen a écrit :
>> On Apr 28, 2010, at 2:49 53PM, Hilaire Fernandes wrote:
>>> Are there any work in progress of i18n?
>>> I need it for DrGeo or I will have to write message in French in the code.
>>>
>>> Hilaire
>>>
>> Not sure what you mean with work in progress, but an existing alternative is the String>>translated method, which works the same in Squeak and Pharo.
>> Squeak still contains and entry in the world menu for the tool used to edit language translations (Open -> Language Editor), while in Pharo you have to evaluate LanguageEditor open manually.
>> To create a new locale entry you want to translate to, you'd use NaturalLanguageTranslator isoLanguage:isoCountry:.
>> Cheers,
>> Henry
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

Henrik Sperre Johansen
  On 28.04.2010 23:08, Stéphane Ducasse wrote:
> if you extract the code from Etoy ....
> we are open you know :)
>
> On Apr 28, 2010, at 10:35 PM, Hilaire Fernandes wrote:
>
>> I was thinking more about something like the Gettext support as found in Etoys.
>>
>> Hilaire
I *think* I remember Bert mentioning interest in extracting the code for
inclusion in Squeak some time ago, not 100% sure though.
There hasn't been a mention of it on the Pharo list so far though, so I
wouldn't sit around and wait for someone else to port it if I really
wanted it... :)

i.e. The main reason it's not in Pharo is probably more of a lack of
interest than anything against having such functionality.

Cheers,
Henry

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

Stéphane Ducasse
:)
no time is a better qualification. When I see the list of bugs and the list of items I would like to work on :(

Stef
On Apr 28, 2010, at 11:42 PM, Henrik Sperre Johansen wrote:

> On 28.04.2010 23:08, Stéphane Ducasse wrote:
>> if you extract the code from Etoy ....
>> we are open you know :)
>>
>> On Apr 28, 2010, at 10:35 PM, Hilaire Fernandes wrote:
>>
>>> I was thinking more about something like the Gettext support as found in Etoys.
>>>
>>> Hilaire
> I *think* I remember Bert mentioning interest in extracting the code for inclusion in Squeak some time ago, not 100% sure though.
> There hasn't been a mention of it on the Pharo list so far though, so I wouldn't sit around and wait for someone else to port it if I really wanted it... :)
>
> i.e. The main reason it's not in Pharo is probably more of a lack of interest than anything against having such functionality.
>
> Cheers,
> Henry
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

hilaire
In reply to this post by Henrik Sperre Johansen
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

hilaire
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

hilaire
In reply to this post by Stéphane Ducasse
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

hilaire
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

Stéphane Ducasse
In reply to this post by hilaire
can it be package as a package?


> How should I proceed?
>
> Do I update directly the related package in PharoInbox?
>
> I have this 7 changesets, some are newly created classes, other modified class or modified method
>
> support/GetTextTranslator.st
> support/InternalTranslator.st
> support/MOFile.st
> support/NaturalLanguageTranslator.st
> support/String-translated.st
> support/TextDomainInfo.st
> support/TextDomainManager.st
>
> Hilaire
>
>
>
> Stéphane Ducasse a écrit :
>> if you extract the code from Etoy ....
>> we are open you know :)
>> On Apr 28, 2010, at 10:35 PM, Hilaire Fernandes wrote:
>>> I was thinking more about something like the Gettext support as found in Etoys.
>>>
>>> Hilaire
>>>
>>> Henrik Johansen a écrit :
>>>> On Apr 28, 2010, at 2:49 53PM, Hilaire Fernandes wrote:
>>>>> Are there any work in progress of i18n?
>>>>> I need it for DrGeo or I will have to write message in French in the code.
>>>>>
>>>>> Hilaire
>>>>>
>>>> Not sure what you mean with work in progress, but an existing alternative is the String>>translated method, which works the same in Squeak and Pharo.
>>>> Squeak still contains and entry in the world menu for the tool used to edit language translations (Open -> Language Editor), while in Pharo you have to evaluate LanguageEditor open manually.
>>>> To create a new locale entry you want to translate to, you'd use NaturalLanguageTranslator isoLanguage:isoCountry:.
>>>> Cheers,
>>>> Henry
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

Stéphane Ducasse
In reply to this post by hilaire
try to identify the problem so that we fix it
Setf

On Apr 29, 2010, at 5:50 PM, Hilaire Fernandes wrote:

> Hilaire Fernandes a écrit :
>> How should I proceed?
>> Do I update directly the related package in PharoInbox?
>>
>
> In latest 1.1, I started to file in NaturalLanguageTranslator.st as it looks like a root class.  The image frooze.
>
> I guess it is related to Smalltalk registry or so...
>
> How should I proceed?
>
> Hilaire
>
> PS: File in attachment
> 'From etoys4.0 of 9 October 2008 [dernière mise à jour: #2336] on 29 April 2010 at 5:02:21 pm'!
> Object subclass: #NaturalLanguageTranslator
> instanceVariableNames: 'id'
> classVariableNames: 'Translators'
> poolDictionaries: ''
> category: 'System-Localization'!
> !NaturalLanguageTranslator commentStamp: '<historical>' prior: 0!
> abstract class of natural language translator.
> Class side manages and holds loaded instances of concrete classes.!
>
>
> !NaturalLanguageTranslator methodsFor: 'accessing' stamp: 'yo 8/27/2008 13:10'!
> atRandom
>
> self subclassResponsibility.
> ! !
>
> !NaturalLanguageTranslator methodsFor: 'accessing' stamp: 'KR 10/23/2007 18:40'!
> domainRegistered: aDomainName
> "notify that new TextDomain is registered.  Concrete subclass can responds to this event if needed"! !
>
> !NaturalLanguageTranslator methodsFor: 'accessing' stamp: 'KR 10/23/2007 18:40'!
> domainUnregistered: aDomainName
> "notify that new TextDomain is unregistered.  Concrete subclass can responds to this event if needed"! !
>
> !NaturalLanguageTranslator methodsFor: 'accessing' stamp: 'KR 10/30/2007 18:41'!
> isDomainLoaded: aDomainName
> "ask if translation dictionary for the domain has been loaded and available now for use"
> self subclassResponsibility.! !
>
> !NaturalLanguageTranslator methodsFor: 'accessing' stamp: 'KR 10/15/2007 12:48'!
> localeID
> ^id! !
>
> !NaturalLanguageTranslator methodsFor: 'accessing' stamp: 'KR 10/15/2007 12:50'!
> localeID: anID
> id := anID! !
>
>
> !NaturalLanguageTranslator methodsFor: 'language switching' stamp: 'KR 10/17/2007 01:57'!
> setCurrent
> "notify locale of the translator become current"
> ! !
>
>
> !NaturalLanguageTranslator methodsFor: 'printing' stamp: 'tak 10/19/2007 13:59'!
> printOn: aStream
> aStream nextPutAll: self class name; nextPut: $(; print: self localeID; nextPut: $)! !
>
>
> !NaturalLanguageTranslator methodsFor: 'translation' stamp: 'KR 10/17/2007 01:34'!
> translate: aString
> ^self translate: aString
> inDomain: TextDomainManager defaultDomain! !
>
> !NaturalLanguageTranslator methodsFor: 'translation' stamp: 'tak 10/19/2007 13:38'!
> translate: aString inDomain: aDomainName
> ^ aString! !
>
> "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
> NaturalLanguageTranslator class
> instanceVariableNames: ''!
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 10/19/2007 11:20'!
> availableForLocaleID: localeID
> "Answer available locale ID.
> If translator is not found for correct locale ID, then isoLanguage is
> attempted for the key."
> ^ self translators
> at: localeID
> ifAbsent: [localeID hasParent
> ifTrue: [self translators
> at: localeID parent
> ifAbsent: [self default]]
> ifFalse: [self default]]! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 10/19/2007 13:47'!
> availableLanguageLocaleIDs
> "Return the locale ids for the currently available languages.  
> Meaning those which either internally or externally have  
> translations available."
> "NaturalLanguageTranslator availableLanguageLocaleIDs"
> ^ self translators values collect:[:each | each localeID]! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'KR 10/15/2007 12:58'!
> current
> ^ self availableForLocaleID: LocaleID current! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'KR 10/15/2007 12:59'!
> default
> "Answer translator for backstop"
> "self default translate: 'test'"
> ^ self new
> localeID: (LocaleID isoLanguage: 'en')! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'KR 10/23/2007 18:41'!
> domainRegistered: aDomainName
> "notify that new TextDomain is registered"
> self translators do: [:each | each domainRegistered: aDomainName]! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'KR 10/23/2007 18:41'!
> domainUnregistered: aDomainName
> "notify that new TextDomain is unregistered"
> self translators do: [:each | each domainUnregistered: aDomainName]! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'KR 10/23/2007 19:42'!
> localeChanged
> "notify some project starts to use this locale.
> this facility may use the event to load translation data dynamically"
> self current setCurrent
> ! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 10/19/2007 11:21'!
> removeLocaleID: localeID
> "self removeLocaleID: (LocaleID isoString: 'ja-kids')"
> ^ self translators
> removeKey: localeID
> ifAbsent: []! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 10/19/2007 11:18'!
> resetCaches
> Translators := nil.! !
>
> !NaturalLanguageTranslator class methodsFor: 'accessing' stamp: 'tak 10/19/2007 11:15'!
> translators
> ^ Translators ifNil: [Translators := Dictionary new] ! !
>
>
> !NaturalLanguageTranslator class methodsFor: 'class initialization' stamp: 'tak 10/19/2007 15:25'!
> initialize
> Smalltalk addToStartUpList: NaturalLanguageTranslator after: FileDirectory.
> ! !
>
> !NaturalLanguageTranslator class methodsFor: 'class initialization' stamp: 'KR 10/23/2007 19:43'!
> privateStartUp
> self resetCaches.
> GetTextTranslator privateStartUp.
> InternalTranslator privateStartUp.
> self localeChanged.! !
>
> !NaturalLanguageTranslator class methodsFor: 'class initialization' stamp: 'tak 10/19/2007 15:29'!
> startUp: resuming
> resuming
> ifFalse: [^ self].
> self privateStartUp.! !
>
>
> !NaturalLanguageTranslator class methodsFor: 'translation' stamp: 'KR 10/30/2007 18:59'!
> translateWithoutLoading: aString toLocaleID: localeID
> "translate for default domain"
> ^self translateWithoutLoading: aString toLocaleID: localeID inDomain: TextDomainManager defaultDomain.
> ! !
>
> !NaturalLanguageTranslator class methodsFor: 'translation' stamp: 'KR 10/30/2007 18:50'!
> translateWithoutLoading: aString toLocaleID: localeID inDomain: aDomainName
> "try to translate with small footprint:
> if GetTextTranslator hasn't loaded MO, try to use InternalTranslator.
> if InternalTranslator isn't available, then actually load MO and use it"
> | translator |
> translator := self availableForLocaleID: localeID.
> (translator isDomainLoaded: aDomainName) ifFalse: [
> (InternalTranslator availableLanguageLocaleIDs includes: localeID)
> ifTrue:  [translator := InternalTranslator localeID: localeID].
> ].
> ^translator translate: aString inDomain: aDomainName! !
>
> !NaturalLanguageTranslator class methodsFor: 'translation' stamp: 'KR 10/30/2007 18:33'!
> translate: aString toLocaleID: localeID
> "translate for default domain"
> ^ (self availableForLocaleID: localeID)
> translate: aString! !
>
> !NaturalLanguageTranslator class methodsFor: 'translation' stamp: 'KR 10/15/2007 14:00'!
> translate: aString toLocaleID: localeID inDomain: aDomainName
> ^ (self availableForLocaleID: localeID)
> translate: aString inDomain: aDomainName! !
>
>
> NaturalLanguageTranslator initialize!
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

hilaire
In reply to this post by Stéphane Ducasse
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: status of i18n for Pharo

hilaire
In reply to this post by Stéphane Ducasse
CONTENTS DELETED
The author has deleted this message.