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

Keys reported as missing and unused #127

Closed
thegcat opened this issue Feb 3, 2015 · 1 comment
Closed

Keys reported as missing and unused #127

thegcat opened this issue Feb 3, 2015 · 1 comment

Comments

@thegcat
Copy link

thegcat commented Feb 3, 2015

In hacken-in/hacken-in#558 (I first linked to PR 557 of that repo, sorry for the mixup), some keys are recognised as missing and unused (see especially the fixing commit hacken-in/hacken-in@ca5d261), any idea what could be happening? Is there anything we can do to help debug this?

(we have obviously worked around it, but I don't think that's a good answer :-) )

@glebm
Copy link
Owner

glebm commented Feb 5, 2015

It is indeed correct in reporting the keys as missing:

+--------+-----------------------------------+----------------------------+
| Locale | Key                               | Details                    |
+--------+-----------------------------------+----------------------------+
|   de   | subscriptions.delete.confirmation | You no longer participate. |
|   de   | subscriptions.push.confirmation   | You now participate.       |
|   en   | single_events.delete.confirmation | Du nimmst nicht mehr teil. |
|   en   | single_events.push.confirmation   | Du nimmst jetzt teil.      |
+--------+-----------------------------------+----------------------------+

en.yml does not have single_events.{push,delete}.confirmation:

  single_events:
    show:
      participate: And me!
      unparticipate: Not yet.

de.yml does not have subscriptions.{push,delete}.confirmation:

  subscriptions:
    index:
      error: Eintrag nicht gefunden.

These are missing because they do appear in the other locale file.

subscriptions.{push,delete}.confirmation do not seem to be used anywhere (at least with git grep 'subscriptions').

The other unused warning is because the key is used like this:

flash[:notice] = t "single_events.#{params[:state]}.confirmation"

Generally, i18n-tasks does its best to guess the usage here, but I'd recommend to list the keys explicitly:

# i18n-tasks-use t('single_events.push.confirmation') t('single_events.delete.confirmation')
flash[:notice] = t "single_events.#{params[:state]}.confirmation"

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

No branches or pull requests

2 participants