Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow merging text domains without plural rules #5908

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Member

DASPRiD commented Mar 5, 2014

This pull request fixes the issue addressed by #5277 in a much cleaner way. Thus closes #5277.

@weierophinney weierophinney added this to the 2.3.0 milestone Mar 5, 2014

@samsonasik samsonasik commented on the diff Mar 5, 2014

library/Zend/I18n/Translator/TextDomain.php
{
- if ($this->pluralRule === null) {
- $this->setPluralRule(PluralRule::fromString('nplurals=2; plural=n != 1;'));
+ if (self::$defaultPluralRule === null) {
+ self::$defaultPluralRule = PluralRule::fromString('nplurals=2; plural=n != 1;');
@samsonasik

samsonasik Mar 5, 2014

Contributor

should it be static:: instead of self:: ?

@samsonasik samsonasik commented on the diff Mar 5, 2014

library/Zend/I18n/Translator/TextDomain.php
@@ -40,17 +47,40 @@ public function setPluralRule(PluralRule $rule)
/**
* Get the plural rule.
*
- * Lazy loads a default rule if none already registered
+ * @param bool $fallbackToDefaultRule
+ * @return PluralRule|null
+ */
+ public function getPluralRule($fallbackToDefaultRule = true)
+ {
+ if ($this->pluralRule === null && $fallbackToDefaultRule) {
+ return self::getDefaultPluralRule();
@samsonasik

samsonasik Mar 5, 2014

Contributor

should it be static:: instead of self:: ?

weierophinney added a commit that referenced this pull request Mar 5, 2014

Merge pull request #5908 from DASPRiD/bugfix/text-domain-without-plur…
…al-merging

Allow merging text domains without plural rules

weierophinney added a commit that referenced this pull request Mar 5, 2014

[#5908] s/self/static/
- in order to invoke LSB for extensions

weierophinney added a commit that referenced this pull request Mar 5, 2014

@weierophinney weierophinney self-assigned this Mar 5, 2014

Owner

weierophinney commented Mar 5, 2014

Merged to develop for release in 2.3.0.

weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015

Merge pull request zendframework/zendframework#5908 from DASPRiD/bugf…
…ix/text-domain-without-plural-merging

Allow merging text domains without plural rules

weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015

[zendframework/zendframework#5908] s/self/static/
- in order to invoke LSB for extensions

weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment