vim-rails icon indicating copy to clipboard operation
vim-rails copied to clipboard

Allow to jump to exact key in i18n locale file

Open rnestler opened this issue 1 month ago • 3 comments

It would be nice if I could jump directly to the key in the locale file with :Elocale or a similar command when hovering inside a t().

So for example (* indicating cursor position):

I18n.t("admin.actions.toggle_lock.fla*sh.unlocked")

should jump to one of these locations

  admin:
    actions:
      toggle_lock:
        flash:* # if we want to support jumping to the section
          unlocked: *"User unlocked successfully." # if we want to just jump to the location of the full key
          locked: "User locked successfully."

rnestler avatar Dec 19 '25 14:12 rnestler

This would be a very cool addition!

It would be nice if it would be possible to detect namespaced translations too. Such as croms.en.yml

cb341 avatar Dec 20 '25 09:12 cb341

Possibly duplicate:

  • https://github.com/tpope/vim-rails/issues/114
  • https://github.com/tpope/vim-rails/issues/113

cb341 avatar Dec 22 '25 11:12 cb341

I also think that it would be very useful to jump to human attribute name:

User.human_attribute_name(:use*name),
en:
  activerecord:
    attributes:
      user:
        username: *"Username (used for login)"

cb341 avatar Dec 22 '25 11:12 cb341