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?
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?
By modifying a little the example, I noticed that if I send the "translated" message to strings they get added to the .pot file and indeed it generates the template.
But shouldn't it be the translate: function for that so I don't need to put translated everywhere?
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.
seaside@lists.squeakfoundation.org