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 moves empty string keys to a new file #579

Open
jaredmoody opened this issue May 23, 2024 · 3 comments
Open

Normalize moves empty string keys to a new file #579

jaredmoody opened this issue May 23, 2024 · 3 comments

Comments

@jaredmoody
Copy link
Contributor

To translate a blank option in a select in simple form, I have a key that is an empty string:

# config/locales/en_US/projects/tax_options.yml
en_US:
  simple_form:
    options:
      project:
        tax_labor:
          '': Use product default
          'false': Do not tax labor on all items
          'true': Tax labor on all items

Normalize is pulling out only the blank key and adding it to a new file at config/locales/en_US/en_US.yml, which I don't want.

I think this is a bug because AFAIU the conservative router is not supposed to move keys, correct?

@davidwessman
Copy link
Collaborator

Would be great if you could write a test case for this.

@jaredmoody
Copy link
Contributor Author

Sure, here's a failing spec:

main...Jetbuilt:i18n-tasks:empty-string-keys-#579

LMK if you want me to start a PR.

@davidwessman
Copy link
Collaborator

@glebm Do you have any suggestion for handling blank keys? The conservative router cannot find a key like es.

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