-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[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
Conversation
aitboudad
commented
Jan 14, 2015
Q | A |
---|---|
Doc fix? | yes |
New docs? | no |
Applies to | all |
Fixed tickets | symfony/symfony#13376 |
6d66322
to
192883b
Compare
… (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`` |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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``
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?
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 |
There was a problem hiding this comment.
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:
done ! |
the Translation chapter of the book needs to be updated too |
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'), |
There was a problem hiding this comment.
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?
@xabbuh done. |
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain more ? :)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done !
I just left another minor comment. I really think that this will be my last remark. :) |
Thank you very much, @aitboudad. This is ready to be merged now. And sorry for the delay when reviewing your pull request. |
Very nice work with this feature/fix and the docs for it. It looks really solid to me - thanks @aitboudad! |
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.