Silence warnings for common leaf -> tree expansion scenario#314
Conversation
6083dd8 to
7131653
Compare
| # siblings' keys are unique | ||
| class Siblings < Nodes # rubocop:disable Metrics/ClassLength | ||
| # Ref: http://cldr.unicode.org/index/cldr-spec/plural-rules | ||
| CLDR_CATEGORY_KEYS = %w[zero one two few many other].freeze |
There was a problem hiding this comment.
This could maybe reuse a similar definition from I18n::Tasks::PluralKeys
There was a problem hiding this comment.
Refactored
dc5dc71 to
a22e6b1
Compare
81eb609 to
774c3d6
Compare
|
Build is green + rebased on latest |
| def conditionally_warn_add_children_to_leaf(node, children) | ||
| return unless @warn_about_add_children_to_leaf | ||
| return if !children.empty? && | ||
| (children.map(&:key) - I18n::Tasks::PluralKeys::CLDR_CATEGORY_KEYS).empty? |
There was a problem hiding this comment.
Consider exposing and reusing the following method here:
i18n-tasks/lib/i18n/tasks/plural_keys.rb
Line 50 in 774c3d6
There was a problem hiding this comment.
Good suggestion! Refactored and added extra test to cover "internal node" situation
774c3d6 to
bc5673a
Compare
Closes glebm#242 Signed-off-by: Aleksandrs Ļedovskis <aleksandrs@ledovskis.lv>
bc5673a to
a771f4c
Compare
|
@glebm Hello. The review's changes were applied, branch is rebased and build passes (JRuby failures are from upstream - ruby-i18n/i18n#447). Seems LGTM? |
|
@aleksandrs-ledovskis Sorry, it fell through the cracks |
|
@glebm Could you cut a new release with changes done since v0.9.28 ? |
|
@aleksandrs-ledovskis Released v0.9.29! |
Closes #242