Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Make I18n component completely optional for Mvc #5406

Merged
merged 5 commits into from
Jan 3, 2014
Merged

Make I18n component completely optional for Mvc #5406

merged 5 commits into from
Jan 3, 2014

Conversation

DASPRiD
Copy link
Member

@DASPRiD DASPRiD commented Nov 2, 2013

Should be fully functional by now. Closes #5108

@ghost ghost assigned weierophinney Nov 2, 2013
@@ -12,6 +12,23 @@
use Zend\I18n\Translator\Translator as I18nTranslator;
use Zend\Validator\Translator\TranslatorInterface as ValidatorTranslatorInterface;

class Translator extends I18nTranslator implements ValidatorTranslatorInterface
class Translator implements ValidatorTranslatorInterface
Copy link
Member

Choose a reason for hiding this comment

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

The problem with this change is it means that the MvcTranslator can no longer be dropped in when you need a Translator instance.

I'm honestly not sure how to proceed, however -- if you create an interface in the Zend\I18n\Translator namespace, we then have the problem of PHP <= 5.3.8 not being able to allow implementing two interfaces with the same signature.

This begs a question, then: should we up our minimum required version starting with 2.3.0 to PHP 5.3.9? This might solve a number of lingering issues such as this one, as well as some with ArrayObject.

Could you start a thread on the dev mailing list asking about this?

@dphn
Copy link

dphn commented Dec 6, 2013

Excuse me, are just two question.

  • Why is translator not the traits?
  • Why do not php 5.4? All the same. It is inevitable, why small jumps. It will only upset users. I think it's better to make one big step.

@Ocramius
Copy link
Member

Ocramius commented Dec 6, 2013

@dphn ZF2 remainst 5.3 compatible - ZF3 is where we'd target 5.4. No breakage on that side within 2.x

@dphn
Copy link

dphn commented Dec 6, 2013

Now php 5.4 is even available for free hosting

@mpalourdio
Copy link
Contributor

yep, but not available by default on redhat like distros :( Even if alternative repos like Remi's ones are the first thing to implement when using CentOS IMHO

@dphn
Copy link

dphn commented Dec 6, 2013

What a pity! Have to wait until ZF ~ 2.7 - 2.8 But I think, a better one stride than several small ones.
P.S. http://linux.ioerror.us/2013/02/installing-php-5-4-11-on-centos-6-3

@weierophinney
Copy link
Member

@dphn Please keep discussion on the mailing list, not comments on the issue tracker.

$helper->setTranslator($locator->get('translator'));
} elseif ($locator && $locator->has('MvcTranslator')) {
$helper->setTranslator($locator->get('MvcTranslator'));
Copy link
Member

Choose a reason for hiding this comment

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

I would argue we should prefer the MvcTranslator over the Translator service here. The assumption is that the MvcTranslator service is the "bridge" implementation, and would be the one shared between all translator-aware services.

weierophinney added a commit that referenced this pull request Jan 3, 2014
Make I18n component completely optional for Mvc
weierophinney added a commit that referenced this pull request Jan 3, 2014
- Prefer the MvcTranslator service over the translator service
- Applied object calisthenics and removed nested conditionals
weierophinney added a commit that referenced this pull request Jan 3, 2014
@weierophinney weierophinney merged commit 64e4dc1 into zendframework:develop Jan 3, 2014
@@ -17,14 +17,14 @@
* Overrides the translator factory from the i18n component in order to
* replace it with the bridge class from this namespace.
*/
class TranslatorServiceFactory extends I18nTranslatorServiceFactory
class TranslatorServiceFactory
Copy link
Contributor

Choose a reason for hiding this comment

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

I am getting

Zend\ServiceManager\Exception\ServiceNotCreatedException
While attempting to create mvctranslator(alias: MvcTranslator) an invalid factory was registered for this instance type.

Should you not implement FactoryInterface?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, now it's an invalid factory.

weierophinney added a commit to weierophinney/zendframework that referenced this pull request Jan 6, 2014
- Covers zendframework#5406, and the changes also present in this PR.
weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015
…ix/mvc-translator-wrapper

Make I18n component completely optional for Mvc
weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-file that referenced this pull request May 15, 2015
…ix/mvc-translator-wrapper

Make I18n component completely optional for Mvc
weierophinney added a commit to zendframework/zend-file that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
…ix/mvc-translator-wrapper

Make I18n component completely optional for Mvc
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
- Prefer the MvcTranslator service over the translator service
- Applied object calisthenics and removed nested conditionals
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants