Closed fzipi closed 10 years ago
Thank you, but I have a couple of questions. For one I do not use gettext files right now for translation. Does it mix with ZF2 if you use multiple different adapters? And how is the textdomain set? If I would have different modules with this structure, would it work out of the box?
Also I would remove the setting of the locale from this module. That is application specific and should go into your own application module.
On 06/12/13 06:34, Philipp Dobrigkeit wrote:
Thank you, but I have a couple of questions. For one I do not use gettext files right now for translation.
Using gettext is practically unobtrusive. You just add '_' whenever you want a string translated (well, at least in simple modules). If you want to do the full stuff, you must consider plurals, and right to left languages... but again, not for this simple stuff.
Does it mix with ZF2 if you use multiple different adapters?
I didn't had any problems (yet). I think is fully supported.
And how is the textdomain set? If I would have different modules with this structure, would it work out of the box?
See this tutorial from Manuel Stosic: http://samminds.com/2012/09/zend-framework-2-translate-i18n-locale/
My experience is that it works out of the box. But you must have sane defaults.. that's why I put initialization onBoostrap. But could be made declaratively at the module config. I'm uploading these changes as you requested.
Also I would remove the setting of the locale from this module. That is application specific and should go into your own application module.
Done.
— Reply to this email directly or view it on GitHub https://github.com/goalio/GoalioForgotPassword/pull/19#issuecomment-29971768.
using _() is the wrong way to translate form labels. the form label view helper itself is aware of the translator and can translate them.
See the code at https://github.com/zendframework/zf2/blob/master/library/Zend/Form/View/Helper/AbstractHelper.php#L13
On 06/12/13 11:58, Stefan Kleff wrote:
using _() is the wrong way to translate form labels. the form label view helper itself is aware of the translator and can translate them
Well, you're right in that. But, tools aren't always aware... i.e. you should copy your strings to another file in which xgettext could parse, or do some hack like a function with does nothing (like http://stackoverflow.com/questions/15961628/how-to-translate-form-labels-in-zend-framework-2). I any case, I've taken out all ''.
See the code at
Thanks!
— Reply to this email directly or view it on GitHub https://github.com/goalio/GoalioForgotPassword/pull/19#issuecomment-29995873.
Personaly in think evey module needs to have the basi tranaltion files and settings. So the modules can be used without need from custom(language files).
Closed? Will it be merged or not?
Sorry, I am just working on an update. Was cleaning up some stuff. Will merge your fixes. Thank you and apologies for the long delay
so it will be merged later on ?
Yes, will be included in the next update
hmm update was just before my comment. Thank you.
Localization is a must for a generic module like this one.