International application

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

International application

Bojan Fabijan-2
Hi !

 I develop a nice application in Dolphin and now I get interest from
customer from Poland - another language.
 Has anyone any experiences how to handle this issue in Dolphin. The
main problem are GUI - Static text fields and menus. In my database I
plan to have table with text fields for different languages - now 2,
latter maybe more.

Bojan Fabijan ORIA d.o.o.


Reply | Threaded
Open this post in threaded view
|

Re: International application

Christopher J. Demers
"Bojan Fabijan" <[hidden email]> wrote in message
news:[hidden email]...
>  I develop a nice application in Dolphin and now I get interest from
> customer from Poland - another language.
>  Has anyone any experiences how to handle this issue in Dolphin. The
> main problem are GUI - Static text fields and menus. In my database I
> plan to have table with text fields for different languages - now 2,
> latter maybe more.

I just did something like this not too long ago.  Do a google search of this
group to find a previous discussion about it.

I ended up with a translator object that uses a Dictionary of phrases that
map to translated phrases.  I can have different translator objects for
different languages.  Look into the #viewOpened: Presenter class event.  You
can register your Dialogs and Shells with your translator.  Then they can
ask to be translated when they are opened.  Controls are a piece of cake,
just iterate over all the sub-views translating as needed.  The menus are a
little trickier.  I had to actually remove and re-add them after translation
to get them to change.  I feel like I was able to put together a very nice
translation system.

I had the program add un-translated text to the translation dictionary as it
encountered it.  However I also wrote some tools to support to automatic
scanning of views and method parse trees for text  that would need to be
translated.  I also added a way to help me see what text would be
translatable, I could enter a test mode that would just do a mIxEd cAsE
translation.  I thought adding translation support would be a real pain, but
it turned out to be rather fun, and gave me a chance to use some neat
tricks.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: International application

Ian Bartholomew-19
Christopher,

>                  The menus are a little trickier.  I
> had to actually remove and re-add them after translation to get them
> to change.

Wouldn't it be easier to use the #commandQuery: mechanism to do this?
Something like ...

queryCommand: aCommandQuery
    aCommandQuery text: (self textForCommand: aCommandQuery command).
    ^super queryCommand: aCommandQuery

textForCommand: aSymbol
    ^(self commandLookupTableFor: self currentLanguage) at: aSymbol

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: International application

Christopher J. Demers
"Ian Bartholomew" <[hidden email]> wrote in message
news:O66tc.7715$[hidden email]...

> Christopher,
>
> >                  The menus are a little trickier.  I
> > had to actually remove and re-add them after translation to get them
> > to change.
>
> Wouldn't it be easier to use the #commandQuery: mechanism to do this?
> Something like ...
>
> queryCommand: aCommandQuery
>     aCommandQuery text: (self textForCommand: aCommandQuery command).
>     ^super queryCommand: aCommandQuery
>
> textForCommand: aSymbol
>     ^(self commandLookupTableFor: self currentLanguage) at: aSymbol

That is a good idea.  If one wants to change or add code in the Shell
classes, then what you suggest would be a better approach.  My approach was
designed to be very generic, so it could work on any Shell that one threw at
it without requiring any code changes in the original class.  I wanted to
change as little code in the "normal" non-translation enabled program as
possible to lessen any impact on existing users.  As I have it, if
translation is not used then very little new code runs.

Chris