2014-09-15 12:38 GMT-03:00 Johan Brichau <jo...@inceptive.be>:

> On 15 Sep 2014, at 12:27, p...@highoctane.be wrote:
> A question: without looking at the code of i18n, I notice the assumption
> that each ‘UI string’ is identified by a symbol. Is that correct or just how
> the example is presented?

As I understood it, I18N uses the selectors as keys in a dictionary,
as if it were a constant.
What I don't like about this approach is it gets really convoluted as
soon as you have a lot of entries in your table, with very similar
names.
In the long run it causes some codification for the strings, like the
one used by VisualAge Smalltalk. Stuff like: getMRI:
AbtMsgBase::MsgBaseFooMessage group: 'AbtMsgBase'

> In most cases, you construct ‘UI strings’ in your code as follows:
>
> ‘The user {name} clicked on item {number}’ translatedWith: { name -> self
> username . number -> self number }

+1

In my experience this is the best approach to translate UIs, because
the source code is legible in the original language (whatever it is,
usually english).

> I also agree 100% with Hilaire: Gettext is a standard where plenty of
> external tools can work with. Though it’s nice to have translation tools in
> the image, you will have to do everything yourself. Just take a look at
> everyhting that is done by poedit [1]. Do we really want to implement
> everything ourselves?

Yes please, let's stick with a proven and used solution with external
support such as Gettext.
Also, saying Pharo supports Gettext is a sales point.


Regards!

Reply via email to