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

"normalize" destroys stuff like &defaults #61

Open
jmuheim opened this issue May 3, 2014 · 3 comments
Open

"normalize" destroys stuff like &defaults #61

jmuheim opened this issue May 3, 2014 · 3 comments

Comments

@jmuheim
Copy link

jmuheim commented May 3, 2014

I often use stuff like the following:

de:
  activerecord:
    attributes:
      defaults: &defaults
        created_at: 'Erstellt am'
        updated_at: 'Aktualisiert am'
      user:
        <<: *defaults
        current_password: Aktuelles Passwort

Sadly, when doing i18n-tasks normalize, these are "flattened". Is there any way to circumvent this?

@glebm
Copy link
Owner

glebm commented May 3, 2014

Perhaps there is a YAML parser mode that can round-trip this, but I am not aware of one.
Related discussion on StackOverflow.

@bertBruynooghe
Copy link

something similar happens here:

  insulin_dose:
    dose: &dosis Dosis
    bolus: Snelwerkend
    application_time: &toegediend Toegediend

becomes:

  insulin_dose:
    application_time: Toegediend
    bolus: Snelwerkend
    dose: Dosis

so references got lost.

@glebm
Copy link
Owner

glebm commented Dec 21, 2016

@bertBruynooghe Yes, it's the same thing, the YAML parser can't round-trip this.
But in your case you should just use reference keys instead, e.g.:

en:
  some_other_key: :insulin_dose.dose

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

3 participants