Skip to content
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

[BUG]: Phalcon\Translate\Adapter\Gettext:setLocale doesn't allow multiple locales #14764

Closed
ruudboon opened this issue Jan 23, 2020 · 7 comments · Fixed by #15454
Closed

[BUG]: Phalcon\Translate\Adapter\Gettext:setLocale doesn't allow multiple locales #14764

ruudboon opened this issue Jan 23, 2020 · 7 comments · Fixed by #15454
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: low Low

Comments

@ruudboon
Copy link
Member

In our docs we mention that setLocale in Phalcon\Translate\Adapter\Gettext allows multiple arguments just like the native setLocale

The logic to handle this is there but our method doesn't allow it and will return a wrong number of parameters.

Phalcon: 4.0.2
Php: 7.4

@ruudboon ruudboon added bug A bug report status: low Low labels Jan 23, 2020
@niden
Copy link
Member

niden commented Jan 23, 2020

Doesn't the func_get_args() offer it or is this coming from the method signature?

@ruudboon
Copy link
Member Author

@niden That's what I meant. I think the implementation is there but we are unable to do:

$gettextObject->setLocale(LC_ALL, "de_DE@euro", "de_DE", "de", "ge");

Only this allowed:

$gettextObject->setLocale(LC_ALL, "de_DE@euro");

@niden
Copy link
Member

niden commented Jan 23, 2020

We will probably need to remove the parameters from the signature so that func_get_args can work. I will need to test this

@ruudboon
Copy link
Member Author

ruudboon commented Jan 23, 2020

@niden Maybe we should be fully compatible with setLocale. Second argument can hold an array as well.

@ruudboon ruudboon added the 4.0.4 label Feb 7, 2020
@Jeckerson Jeckerson added 4.0.5 and removed 4.0.4 labels Feb 15, 2020
@niden
Copy link
Member

niden commented Feb 23, 2020

This will have to be moved to 4,1 or 5.0.

If we move it to 4.1 we can create a second method (setLocaleNative or something like that), that will have no parameters but will use function_get_args to get everything passed in the setlocale.

Alternatively, wait for v5 when we can change the method signature

@niden niden added 4.0.6 and removed 4.0.5 labels Mar 8, 2020
@niden
Copy link
Member

niden commented Mar 10, 2020

Moved to 4.1 to introduce temporarily a new method that will allow this functionality. We can clean things up with v5

@Jeckerson Jeckerson added 4.1.1 The issues we want to solve in the 4.1.1 release and removed 4.1.0 labels Dec 14, 2020
@Jeckerson Jeckerson added 5.0 The issues we want to solve in the 5.0 release and removed 4.1.1 The issues we want to solve in the 4.1.1 release labels Mar 26, 2021
@niden niden mentioned this issue Apr 12, 2021
5 tasks
@niden niden linked a pull request Apr 12, 2021 that will close this issue
5 tasks
@niden niden mentioned this issue May 3, 2021
5 tasks
@niden niden linked a pull request May 3, 2021 that will close this issue
5 tasks
@niden
Copy link
Member

niden commented May 3, 2021

Resolved in #15454

@niden niden closed this as completed May 3, 2021
@niden niden moved this to Released in Phalcon v5 Aug 25, 2022
@niden niden added this to Phalcon v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: low Low
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants