Skip to content

[translator] use the new fallbacks option. #4834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2015
Merged

Conversation

aitboudad
Copy link
Contributor

Q A
Doc fix? yes
New docs? no
Applies to all
Fixed tickets symfony/symfony#13376

@aitboudad aitboudad changed the title Update framework.rst [FrameworkBundle][config] allow multiple fallback locales. Jan 14, 2015
@xabbuh xabbuh added the On hold label Jan 14, 2015
@aitboudad aitboudad force-pushed the patch-2 branch 2 times, most recently from 6d66322 to 192883b Compare January 18, 2015 20:41
fabpot added a commit to symfony/symfony that referenced this pull request Jan 25, 2015
… (aitboudad)

This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle][config] allow multiple fallback locales.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets  | #13373
| Doc PR        | symfony/symfony-docs#4834
| Tests pass?   | yes
| License       | MIT

Commits
-------

1251f0e [FrameworkBundle][config] allow multiple fallback locales.

**type**: ``string`` **default**: ``en``
**type**: ``array`` **default**: ``en``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it allows both a string and an array. Can you please update it to string|array ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should also add a versionadded directive:

fallbacks
.........

.. versionadded:: 2.7
    The ``fallbacks`` option was introduced in Symfony 2.7. Prior
    to Symfony 2.7, it was called ``fallback`` and only allowed one
    fallback language defined as a string.

**type**: ``string|array`` **default**: ``en``

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wouterj but it also available in 2.3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry. I missed that, in that case I think you should still add a versionadded (since it still is new behaviour), but then using 2.3.x (where x is the first release version it is included in (unless @xabbuh or others disagree with me)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also explain that the old option name still works so that people don't get worried about BC breaks when reading this?

@wouterj
Copy link
Member

wouterj commented Jan 25, 2015

The PR is merged, congratz @aitboudad!

I've left two minor comments before this can be merged as well.

@@ -526,10 +526,10 @@ enabled

Whether or not to enable the ``translator`` service in the service container.

fallback
........
fallbacks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a label for the old name before the headline:

.. _fallback:

@aitboudad
Copy link
Contributor Author

done !

@stof
Copy link
Member

stof commented Jan 26, 2015

the Translation chapter of the book needs to be updated too

@aitboudad aitboudad changed the title [FrameworkBundle][config] allow multiple fallback locales. [translator] use the new fallbacks option. Jan 26, 2015
@aitboudad
Copy link
Contributor Author

the translation chapter has been updated.

@@ -82,10 +84,10 @@ enable the ``translator`` in your configuration:

// app/config/config.php
$container->loadFromExtension('framework', array(
'translator' => array('fallback' => 'en'),
'translator' => array('fallbacks' => 'en'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use array('en') here instead to indicate that you can provide more than one fallback?

@aitboudad
Copy link
Contributor Author

@xabbuh done.
Thank you for your feedback

to Symfony 2.3.25, it was called ``fallback`` and only allowed one fallback
language defined as a string.
Please note that you can still use the old ``fallback`` option if you want
define only one fallback.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @aitboudad. I missed this first. Can you please move the versionadded below the next line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain more ? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "type: string|array default: array('en')" line should just be before the versionadded directive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done !

@xabbuh
Copy link
Member

xabbuh commented Mar 8, 2015

I just left another minor comment. I really think that this will be my last remark. :)

@xabbuh
Copy link
Member

xabbuh commented Mar 8, 2015

Thank you very much, @aitboudad. This is ready to be merged now. And sorry for the delay when reviewing your pull request.

@weaverryan
Copy link
Member

Very nice work with this feature/fix and the docs for it. It looks really solid to me - thanks @aitboudad!

@weaverryan weaverryan merged commit 92194f2 into symfony:2.3 Mar 13, 2015
weaverryan added a commit that referenced this pull request Mar 13, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

[translator] use the new fallbacks option.

| Q             | A
| ------------- | ---
| Doc fix?        | yes
| New docs?   | no
| Applies to     | all
| Fixed tickets | symfony/symfony#13376

Commits
-------

92194f2 [config][translator] use the new fallbacks option.
@aitboudad aitboudad deleted the patch-2 branch March 13, 2015 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants