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

Allow use of TranslatorInterface as Translator #224

Merged
merged 10 commits into from
Jun 12, 2024
Merged

Allow use of TranslatorInterface as Translator #224

merged 10 commits into from
Jun 12, 2024

Conversation

mimmi20
Copy link
Contributor

@mimmi20 mimmi20 commented Jan 13, 2024

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

This PR wants to allow the use of Laminas\I18n\Translator\TranslatorInterface if 'MvcTranslator' is not available.
This is related to #194.

@froschdesign
Copy link
Member

@mimmi20
Please note: Laminas\Validator\Translator\TranslatorInterface !== Laminas\I18n\Translator\TranslatorInterface

namespace Laminas\Validator\Translator;
interface TranslatorInterface
{
/**
* @param string $message
* @param string $textDomain
* @param string $locale
* @return string
*/
public function translate($message, $textDomain = 'default', $locale = null);
}

vs.

https://github.com/laminas/laminas-i18n/blob/99c7f8a2e1b286db71bee80f39f78b7d3c53d5d1/src/Translator/TranslatorInterface.php#L3-L18

@froschdesign froschdesign marked this pull request as draft January 13, 2024 13:23
@froschdesign
Copy link
Member

@mimmi20
I have marked this pull request as a draft in order to find a good and suitable solution.

Thanks for help! 👍🏻

@mimmi20 mimmi20 marked this pull request as ready for review January 25, 2024 14:53
mimmi20 added 3 commits May 18, 2024 14:18
Signed-off-by: Thomas Müller <mimmi20@live.de>
Signed-off-by: Thomas Müller <mimmi20@live.de>
Signed-off-by: Thomas Müller <mimmi20@live.de>
@mimmi20 mimmi20 changed the base branch from 2.47.x to 2.55.x May 18, 2024 12:31
Copy link
Member

@froschdesign froschdesign left a comment

Choose a reason for hiding this comment

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

The general process looks good.

I have added some comments to simplify maintenance.

@froschdesign froschdesign requested a review from gsteel May 18, 2024 16:22
@froschdesign froschdesign added the Bug Something isn't working label May 18, 2024
mimmi20 added 2 commits May 18, 2024 19:37
Signed-off-by: Thomas Müller <mimmi20@live.de>
Signed-off-by: Thomas Müller <mimmi20@live.de>
Signed-off-by: Thomas Müller <mimmi20@live.de>
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Thanks @mimmi20 - anywhere we can get away with adding native parameter and return types will help with future maintenance on new code 👍

mimmi20 added 4 commits May 21, 2024 21:43
Signed-off-by: Thomas Müller <mimmi20@live.de>
Signed-off-by: Thomas Müller <mimmi20@live.de>
Signed-off-by: Thomas Müller <mimmi20@live.de>
Signed-off-by: Thomas Müller <mimmi20@live.de>
@mimmi20 mimmi20 requested review from froschdesign and gsteel May 21, 2024 20:11
@gsteel gsteel changed the title allow use of TranslatorInterface as Translator Allow use of TranslatorInterface as Translator May 21, 2024
@gsteel gsteel added this to the 2.55.0 milestone May 21, 2024
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Thank you @mimmi20 👍

@gsteel
Copy link
Member

gsteel commented May 21, 2024

@froschdesign
I'll leave it to you to merge and release if you're happy

@gsteel
Copy link
Member

gsteel commented Jun 6, 2024

@froschdesign Is this one good to go? LMK and I'll merge and release - then I can cut a 3.0.x branch in the hope that we can get SMv4 happening here soon 🤞

@gsteel gsteel merged commit dc3f260 into laminas:2.55.x Jun 12, 2024
11 checks passed
@gsteel gsteel assigned gsteel and unassigned froschdesign Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator plugin manager requires a MvcTranslator for translation - in any context
4 participants