creasty / i18n_flow

[beta] Manage translation status in YAML file
https://rubygems.org/gems/i18n_flow
MIT License
7 stars 1 forks source link

Translation missing error when using !ignore:args #6

Open south37 opened 6 years ago

south37 commented 6 years ago

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 commented 6 years ago

cc. @creasty

creasty commented 6 years ago

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.