Skip to content

[Translation] marked getFallbackLocales() as internal #28626

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
Oct 3, 2018
Merged

[Translation] marked getFallbackLocales() as internal #28626

merged 1 commit into from
Oct 3, 2018

Conversation

boscho87
Copy link
Contributor

@boscho87 boscho87 commented Sep 27, 2018

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #28579
License MIT
Doc PR

Added the deprication trigger error function to getFallbackLocales in the Translation component.

(Its my first PR, please tell me if i need to change something)

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Thanks for starting this. Would you mind having a look at where this method is used in the code base and remove/replace them?

CHANGELOG-4.1.md Outdated
@@ -8,7 +8,7 @@ To get the diff for a specific change, go to https://github.com/symfony/symfony/
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.1.0...v4.1.1

* 4.1.4 (2018-08-28)

* deprecation #28579 [Translator] set the getFallbackLocales() method as deprecated (boscho87)
Copy link
Member

Choose a reason for hiding this comment

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

This file is autogenerated so all changes should be reverted. But the changelog in the component itself should be updated instead.

Copy link
Member

Choose a reason for hiding this comment

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

thus, a PR to master would not change the existing 4.1.4 release

Copy link
Member

@stof stof left a comment

Choose a reason for hiding this comment

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

The file mode change on the different php files must be reverted too.

If you are on Windows, here is the way to go:

# configure git to avoid doing such mess in the future
git config --global core.fileMode false

# change the mode back for these files
git update-index --chmod=-x path/to/file.ext

public function getFallbackLocales()
{
@trigger_error('getFallbackLocales() is deprecated since version 4.1 and will be removed in 5.0.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

deprecation is in 4.2, not in 4.1. We cannot deprecate it in 4.1 as it is already released since 4 months.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stof tahnk you for your effort to teaching me! (i will work on this tomorrow 👍 )

@stof stof added this to the next milestone Sep 28, 2018
@boscho87
Copy link
Contributor Author

@nicolas-grekas i do not find any usages...
@stof i changed the files (i use linux not Windows)

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Sep 29, 2018

Running grep getFallbackLocales src/ -rl on the repository spots the usages, that's where we should start.
On Linux, you should use chmod 644 with the name of each file (honestly, I don't know how you ended up changing the mode of these files, maybe some unusual configuration like @stof hinted about?)

@boscho87
Copy link
Contributor Author

Idk i never before had such problems with changing file permisssions

CHANGELOG-4.1.md Outdated
@@ -331,7 +330,7 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
* feature #24778 [BrowserKit] add a way to switch to ajax for one request (Simperfit)
* feature #25605 [PropertyInfo] Added support for extracting type from constructor (lyrixx)
* feature #24763 [Process] Allow writing portable "prepared" command lines (Simperfit)
* feature #25218 [Serializer] add a constructor arguement to return csv always as collection (Simperfit)
* feature #25218 [Serializer] add a constructor argument to return csv always as collection (Simperfit)
Copy link
Member

Choose a reason for hiding this comment

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

The changes in this file should be reverted as it is auto-generated.

@boscho87 boscho87 changed the title added deprication to getFallbackLocales added deprecation to getFallbackLocales Sep 30, 2018
@boscho87
Copy link
Contributor Author

Maybe i should not have started this PR... im a bit confused what is need to be done exactly..

e.g https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php#L321 here ... should this whole method all so be removed and all the stuff who uses tha catalouges too https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php#L200

@nicolas-grekas
Copy link
Member

I think there is an easy way to finish this PR, which is reverting the deprecation and add @internal since Symfony 4.2 on the method instead. This would provide the same.

@nicolas-grekas nicolas-grekas changed the title added deprecation to getFallbackLocales [Translation] marked getFallbackLocales() as internal Oct 2, 2018
@fabpot
Copy link
Member

fabpot commented Oct 3, 2018

Thank you @boscho87.

@fabpot fabpot merged commit 9d67a68 into symfony:master Oct 3, 2018
fabpot added a commit that referenced this pull request Oct 3, 2018
…(boscho87)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[Translation] marked getFallbackLocales() as internal

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #28579
| License       | MIT
| Doc PR        |

Added the deprication trigger error function to getFallbackLocales in the Translation component.

(Its my first PR, please tell me if i need to change something)

Commits
-------

9d67a68 [Translation] marked getFallbackLocales() as internal
@boscho87
Copy link
Contributor Author

boscho87 commented Oct 3, 2018

@fabpot @nicolas-grekas
Thanks for support

Was a small one but my first

Hope i can do „bigger things“ in the future

@boscho87 boscho87 deleted the deprication/getFallbackLocales branch October 4, 2018 13:10
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
@fabpot fabpot mentioned this pull request Nov 3, 2018
@fabpot fabpot mentioned this pull request Nov 3, 2018
fabpot added a commit that referenced this pull request Feb 28, 2019
This PR was merged into the 4.2 branch.

Discussion
----------

Drop spurious execution bit

| Q             | A
| ------------- | ---
| Branch?       | 4.2 for bug fixes
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

The execution bit seems to have been added by mistake in #28626.

Commits
-------

93dab5c Drop spurious execution bit
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