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

Valid keys slipping through as invalid and not showing up missing #207

Closed
keldin-coding opened this issue Nov 1, 2016 · 4 comments · Fixed by #208
Closed

Valid keys slipping through as invalid and not showing up missing #207

keldin-coding opened this issue Nov 1, 2016 · 4 comments · Fixed by #208
Labels
Milestone

Comments

@keldin-coding
Copy link

We had an issue where we had an invalid key used in our views, but we didn't notice until it went to production because it raises a TranslationMissingError.

# Translations
en:
  parent:
    original_value: 'Some text'
# Usage in HAML

%p= t('parent.original_value:')

In this instance, with strict: true, the key is seen as invalid on this line. Because of that, it's never processed. I'm not sure how you would want to handle this. Maybe providing a list of invalid keys and their usage in the application? Letting them go through and be used as missing translation?

As far as I can tell though, I18n allows this kind of key in my testing...

# sample other translation
en:
  parent:
    'some_key:': 'A super special value'
# This evalutes
%p= t('parent.some_key:')
@keldin-coding
Copy link
Author

Conceivably a fix for this would be modifying this line to include a : as part of the VALID_KEY_CHARS.

@glebm
Copy link
Owner

glebm commented Nov 1, 2016

Including : in VALID_KEY_CHARS sounds good to me

@keldin-coding
Copy link
Author

Welp. Should've realized it would pick up on those commits, my bad. Got a pull request open, though. :)

@glebm glebm closed this as completed in #208 Nov 1, 2016
@glebm glebm added the bug label Nov 1, 2016
@glebm glebm added this to the v0.9.6 milestone Nov 1, 2016
@glebm
Copy link
Owner

glebm commented Nov 1, 2016

Released in v0.9.6!

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

Successfully merging a pull request may close this issue.

2 participants