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

Do not consider a plural node if it only has "other" with no count #312

Merged
merged 2 commits into from
Oct 29, 2018

Conversation

Gargron
Copy link
Contributor

@Gargron Gargron commented Oct 26, 2018

Fix #310

s.present? && s.all? { |node| node.leaf? && plural_suffix?(node.key) }
end

def non_plural_other?(s)
s.size == 1 && s.first.leaf? && s.first.key == 'other' && !s.first.value.include?('%{count}')
Copy link
Owner

Choose a reason for hiding this comment

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

  1. I don't think this should be restricted to "other" (remove s.first.key == 'other')
  2. !s.first.value.include?('%{count}') => !s.first.value.is_a?(String) || !s.first.value.include?('%{count}')

@Gargron
Copy link
Contributor Author

Gargron commented Oct 28, 2018

Addressed

Also, it would be amazing if this could make it into a gem release quickly because I would prefer not to push out a Mastodon release with a git-based dependency if I can help it, and the release is pretty much only waiting for i18n things right now

@glebm glebm merged commit a1c9089 into glebm:master Oct 29, 2018
@glebm
Copy link
Owner

glebm commented Oct 29, 2018

@Gargron I'll try to release tonight. I'm in Brussels for a conference but hopefully I'll have time.

@Gargron Gargron deleted the fix-non-plural-other branch October 29, 2018 11:44
@glebm
Copy link
Owner

glebm commented Oct 29, 2018

@Gargron Released

bartimaeus added a commit to bartimaeus/i18n-tasks that referenced this pull request Feb 8, 2019
* upstream/master: (177 commits)
  ✏️ Typo
  📝 Add example of usage for "Key pattern syntax"
  Silence warnings for common leaf -> tree expansion scenario.
  Update README and post installation instructions message (glebm#320)
  Bump to v0.9.28
  Do not consider a plural node if it only has one child with no count (glebm#312)
  Include file name in CommandError raised during unsuccessful file load (glebm#313)
  Use separate trees per locale in missing_plural_forest (glebm#311)
  Missing plural keys: Extract plural_nodes method
  Missing plural keys: minor optimization
  Missing plural keys: do not modify data nodes
  Check for missing plural keys (glebm#309)
  Fix interpolations with repeated vars
  readme [ci skip]
  changelog
  s/inconsistent_interpolation/inconsistent_interpolations
  Bump to v0.9.26
  s/Commands::Inconsistent/Commands::Interpolations/
  DeeplTranslator: Fix CommandError
  Follow-up to glebm#304
  ...
@glebm
Copy link
Owner

glebm commented Sep 18, 2022

i had to revert this due to #461, hopefully this doesn't cause any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants