Search code examples
phpsymfony1symfony-1.4sfguard

sfGuardAuth signin form i18n translation


I am having difficulties with properly translating the sfGuardAuth signin form without "breaking it down". In the built-in template the form is rendered like this:

<?php echo $form ?>

And I would like to keep it that way.

When the default culture is set to Polish the results look like this:

Login form

Only the "Password" is translated to "Hasło", the rest remains in English. Making new custom translation file - sf_guard.pl.xml or editing the base one directly in the plugin folder by adding:

<trans-unit id="32">
  <source>Username or E-Mail</source>
  <source>Nazwa użytkownika lub E-Mail</source>
</trans-unit>
<trans-unit id="33">
  <source>Remember</source>
  <source>Zapamiętaj mnie</source>
</trans-unit>

Doesn't have any effect. Is there a way to translate those fields without rewriting the template?


Solution

  • You have to change tags in this way (and then clear the cache):

    <trans-unit id="32">
      <source>Username or E-Mail</source>
      <target>Nazwa użytkownika lub E-Mail</target>
    </trans-unit>
    <trans-unit id="33">
      <source>Remember</source>
      <target>Zapamiętaj mnie</target>
    </trans-unit>