Hi again...
For my project, I need to have an application in french and spanish.
Do you have advice for simple translation mechanism (only strings).
I wanted to intercept the rendering of strings in seaside and then choose the proper one according to the session language. If missing I was thinking of opening a new component asking for the translation.
Are there any patterns to know about translating ?
Thanks for all
Cédrick
ps: Lukas told me once they use a special class TranslatedString that have the same interface as Strings, but consists of a collection of translated strings. I imagine there is a collection in a class variable, but how to create strings after ? explicitly like TranslatedString: 'default' french: 'defaut' spanish:...
You can send asTranslated to the strings and using the language editor you can provide a translation. This is not really application specific but this is working. I think that in the future an application should holds its own translation.
Stef
On 8 mai 06, at 14:30, cdrick wrote:
Hi again...
For my project, I need to have an application in french and spanish.
Do you have advice for simple translation mechanism (only strings).
I wanted to intercept the rendering of strings in seaside and then choose the proper one according to the session language. If missing I was thinking of opening a new component asking for the translation.
Are there any patterns to know about translating ?
Thanks for all
Cédrick
ps: Lukas told me once they use a special class TranslatedString that have the same interface as Strings, but consists of a collection of translated strings. I imagine there is a collection in a class variable, but how to create strings after ? explicitly like TranslatedString: 'default' french: 'defaut' spanish:... _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Cédrick,
For my project, I need to have an application in french and spanish.
Do you have advice for simple translation mechanism (only strings).
What version of Squeak are you using? There is a sort of end-user tool called LanguageEditor, that lets you enter the original phrase and the translated phrase. Once you provide these translations, it is stored an in-image dictionary and if you put #translated message after the original string, the result (based on the current locale setting) is returned. LanguageEditor is available from the 'open...' menu. Choose 'Language Editor for...' and the langauge you would like.
Unfortunately, it does work in some variations but not all of them. Notably, the one in Squeak 3.8 doesn't work. I have an impression that it works in Squeak 3.9 beta.
Are there any patterns to know about translating ?
Yes. #translated (or #translatedTo:) are the common pattern.
-- Yoshiki
I'm using 3.8....
I'll see on how to integrate that... but there is a little drawback... we have to specify everywhere it is needed 'a string...' translated ? or can it be done in an "automatic" manner ?
Was I was hoping to do was changing the way string are displayed (all) (might be dangerous) by sending a translated message automatically...(that returns self is no translation...).
First I don't know if it is possible and second it is probably dangerous... Maybe, it could be possible in all string rendering in seaside
I'll investigate on that later (stuck in other problems right now :) :)
Thanks
Cédrick
beginners@lists.squeakfoundation.org