[etoys-dev] Etoys Inbox: Etoys-Richo.138.mcz

Bert Freudenberg bert at freudenbergs.de
Mon Jun 4 05:25:43 EDT 2012


If both are in the same package, then there is no problem as far as gettext is concerned.

But your hunch is right that this is a "code smell". Violates the OAOO principle.

It might be better to factor out the labeling into, say, a setLabels method, and call it from both places. Or (a bit more hacky) call your localeChanged method in the setup code as well.

Given that it's rather unlikely these labels ever change, I'm not overly concerned with them getting out of sync. Judge on your own ;)

Btw, in general I think it would have been okay if you just published to the main repo, and then voiced your concerns on the list. It does fix an immediate problem, doesn't have obviously bad side effects, so the system is better with it than without. Everybody sees the commit message and is expected to speak up if they perceive a problem. Like, the problem I saw was that this was not committed to the actual repository ;)

- Bert -

On 04.06.2012, at 05:07, Ricardo Moran wrote:

> Oh, yes... I forgot to send my question about this :P.
> 
> I was worried about having two different places where the same string would be exported for translations and I wasn't sure how the exporter would behave. But I just checked the code and the implementation seems safe so I'll commit in a minute :).
> 
> Cheers,
> Richo
> 
> On Fri, Jun 1, 2012 at 12:14 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> Assuming this works, why not commit to Etoys properly? ;)
> 
> - Bert -
> 
> On 29.05.2012, at 21:12, commits at source.squeak.org wrote:
> 
> > A new version of Etoys was added to project Etoys Inbox:
> > http://source.squeak.org/etoysinbox/Etoys-Richo.138.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Etoys-Richo.138
> > Author: Richo
> > Time: 29 May 2012, 6:12:30 pm
> > UUID: 779e51cb-669f-db44-a7f1-f5aaefe9e6ca
> > Ancestors: Etoys-kfr.137
> >
> > * The times repeat tile wasn't updating when changing language. Fixed by adding TimesRepeatTile>>localeChanged.
> >
> > =============== Diff against Etoys-kfr.137 ===============
> >
> > Item was added:
> > + ----- Method: TimesRepeatTile>>localeChanged (in category 'localization') -----
> > + localeChanged
> > +     "Hack to allow the times repeat to update when locale changes"
> > +     self labelMorphs first contents: 'Repeat' translated.
> > +     self labelMorphs second contents: (' ', ('times' translated), ' ').
> > +     self labelMorphs third contents: 'Do' translated
> > + !




More information about the etoys-dev mailing list