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

Translation missing error when using !ignore:args #6

Open
south37 opened this issue Mar 1, 2018 · 2 comments
Open

Translation missing error when using !ignore:args #6

south37 opened this issue Mar 1, 2018 · 2 comments

Comments

@south37
Copy link

south37 commented Mar 1, 2018

When we use !ignore:args, translation missing occurs. This may be a bug.

## en
en:
  scouts:
    default_scout_message:
      example1: !ignore:args ''
      placeholder: ''

## ja
ja:
  scouts:
    default_scout_message:
      example1: "something"
      placeholder: "something"
## en
$> I18n.locale = :en
=> :en

$> I18n.t('scouts.default_scout_message.example1')
I18n::MissingTranslationData: translation missing: en.scouts.default_scout_message.example1
from /Users/minami/.go/src/github.com/wantedly/wantedly/config/initializers/i18n_exception_handler.rb:5:in `call'

$> I18n.t('scouts.default_scout_message.placeholder')
=> ""

## ja
$> I18n.locale = :ja
=> :ja

$> I18n.t('scouts.default_scout_message.example1')
=> "something"

$> I18n.t('scouts.default_scout_message.placeholder')
=> "something"
@south37
Copy link
Author

south37 commented Mar 1, 2018

cc. @creasty

@creasty
Copy link
Owner

creasty commented Mar 1, 2018

Ah...
Seemingly it's rather a bug of yaml parser or of I18n.t when a tag is involved.

en:
  foo: ''
en:
  foo: !anytag ''

The first one is just fine whereas the second one becomes an error.

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