Recently I have been struggling with the sfDoctrineGuardPlugin available for Symfony. The issue is with translation of the plugin.
The people behind sfDoctrineGuardPlugin have obviously thought about i18n, as they have provided some translations in the proper directory in their project. The problem however, is that not all text-elements are translated. More specificly the login / signin-form is only partially translated.
I have added a translation file for Norwegian (and for simplicity) placed it inside the plugins i18n-directory. I will move it out of there as soon as I get all the items properly translated, but that's another story.
My login-form (the default one for sfDoctrineGuardPlugin) looks like this when rendered (styles removed for simplicity):
As you can see the header-element as well as the signin-button get translated, but fields for username/email and password does not.
In sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardFormSignin.class.php the following code is present:
if (sfConfig::get('app_sf_guard_plugin_allow_login_with_email', true))
{
$this->widgetSchema['username']->setLabel('Username or E-Mail');
}
This is one of the text-elements that are not translated. In my sg_guard.nb.xml I have translated all the strings that can be found in the example translations in sfDoctrineGuardPlugins svn-repository. For the abovementioned label I have the following:
<trans-unit>
<source>Username or E-Mail</source>
<target>Brukernavn eller epost</target>
</trans-unit>
My guess is that the use of setLabel two sections up ensures that the i18n-system is unable to insert my translation where it should.
Is sfDoctrineGuardPlugin set to have text replaced from some other catalog than sf_guard.XX.xml?
What have you done to get translations working? I really do not want to modify the sfDoctrineGuardPlugin source if it can be avoided (so I have clean dependencies).
Any pointers are appreciated.