[Seaside] Re: Seaside and gettext not exporting domain strings
David Carlos Manuelda
stormbyte at gmail.com
Tue Jan 27 21:07:21 UTC 2015
David Carlos Manuelda wrote:
> I am following guide from https://code.google.com/p/seaside/wiki/Gettext,
> and also, downloaded Seaside-Gettext-Examples-pmm.4.mcz from monticello
> source http://www.squeaksource.com/Seaside30Addons.
>
> It seems a good source of learning gettext integration into seaside.
>
> To test the example, I just doit: WAGettextExample register, and enter to
> localhost:8080/gettext.
>
> It displays good, but when I try to export the domain strings, via
> evaluating WAGettextExample export, I only get pharo strings, and not the
> gettext domain strings present there.
>
> As it is an autoconfigurable example, and little enough, can someone point
> me in the right direction about what is happening?
I am answering my own post to the list, because I spent some hours into
looking at why it is failing to work with translations despite it should.
I want to share with you all, in case someone finds this seaside gettext
example useful in order to help others running into the same problem.
WAGettextExample has a class side method called register, which registers
itself as a seaside application and tries to configure gettext.
The original method is as follows:
WAGettextExample class>>register
| application |
application := WAAdmin
register: self
asApplicationAt: 'gettext'.
application preferenceAt: #sessionClass put: WAGettextExampleSession.
application configuration addParent: WAGetTextConfiguration instance.
application configuration at: #gettextDomain put: 'gettext'.
TextDomainManager registerCategoryPrefix: 'Seaside-Gettext-Examples'
domain: 'gettext'.
That will lead to incomplete application registration, because it do not
register gettext domain into seaside-gettext.
The corrected method I found it to work is as follows:
WAGettextExample class>>register
| application |
application := WAAdmin
register: self
asApplicationAt: 'gettext'.
application preferenceAt: #sessionClass put: WAGettextExampleSession.
application configuration addParent: WAGetTextConfiguration instance.
application configuration at: #gettextDomain put: 'gettext'.
"TextDomainManager registerCategoryPrefix: 'Seaside-Gettext-Examples'
domain: 'gettext'."
"The commented line above is a mistake in WAGettext example"
I hope it could be updated to prevent new users like me to get confused by
seing things not working, and to help others :)
David.
More information about the seaside
mailing list