lib/i18n/tasks/console_context.rb in i18n-tasks-0.5.0 vs lib/i18n/tasks/console_context.rb in i18n-tasks-0.5.1
- old
+ new
@@ -29,15 +29,15 @@
end
def guide
green(bold "i18n-tasks IRB Quick Start guide") + "\n" + <<-TEXT
#{yellow 'Data as trees'}
- data[base_locale]
+ tree(locale)
missing_tree(locale, compared_to = base_locale)
used_tree(source_locations: false, key_filter: nil)
unused_tree(locale)
- Tree::Siblings['es' => {'hello' => 'Hola'}]
+ build_tree('es' => {'hello' => 'Hola'})
#{yellow 'Traversal'}
tree = missing_tree(base_locale)
tree.nodes { |node| }
tree.nodes.to_a
@@ -53,10 +53,10 @@
tree.grep_keys(/hello/) # grep, using ===
tree.keys { |key, leaf| } # enumerate over [full_key, leaf_node]
# Pass {root: true} to include root node in full_key (usually locale)
#{yellow 'Nodes'}
- node = missing_tree(base_locale).leaves.first
+ node = node(key, locale)
node.key # only the part after the last dot
node.full_key # full key. Includes root key, pass {root: false} to override.
# also: value, value_or_children_hash, data, walk_to_root, walk_from_root
Tree::Node.new(key: 'en')