Development

#3122 (Allow i18n labels in the Symfony 1.1 forms framework)

You must first sign up to be able to contribute.

Ticket #3122 (closed enhancement: fixed)

Opened 9 months ago

Last modified 8 months ago

Allow i18n labels in the Symfony 1.1 forms framework

Reported by: nicolas Assigned to: fabien
Priority: major Milestone: 1.1.0 beta3
Component: form Version: 1.1.0 DEV
Keywords: i18n Cc:
Qualification: Unreviewed

Description

In order to use the forms framework provided with Symfony 1.1 on internationalized applications, we should be able to handle easily label translations, ideally in the view part of the framework or at least in the application templates.

In a classical template, this could be by allowing some additional view-related configuration parameters to the render*() methods family, eg. :

<?php
$form->render(array('labels' => array('username' => __('Username'),
                                      'email'    => __('Email address'))))

Change History

03/15/08 21:30:19 changed by fabien

  • milestone set to 1.1.0.

04/07/08 11:38:53 changed by nicolas

  • milestone changed from 1.1.0 to 1.1.0 beta3.

04/11/08 09:39:59 changed by nicolas

  • status changed from new to closed.
  • resolution set to fixed.

(In [8408]) Fixed #3122:

Now the forms framework labels, error messages and help texts can be easily translated setting a php callable (or a sfCallable instance) for this purpose. In a symfony context (remember that the new forms framework can be used without symfony), the callable (__()) is automatically set through the default factories configuration process.

  • Added a constructor to the sfWidgetFormSchemaFormatter, which from now must must have an instance of sfWidgetFormSchema instance passed as a parameter,
  • Added a way to statically get and set a translation callable in sfWidgetFormSchemaFormatter,
  • Moved html label generation methods from sfWidgetFormSchema to sfWidgetFormSchemaFormatter (but this won't break BC),
  • Added translation callable declaration in default factories.yml symfony i18n configuration,
  • Created according unit and functional tests.