-
Notifications
You must be signed in to change notification settings - Fork 264
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 with pattern router may leave duplicate entries. #263
Comments
Should be fixed by the commit linked above, PTAL |
Thanks again for the quick responses and fixes. It seems to work fine, but there is one minor problem. If you already have some leftovers they will not be deleted. P.S. I've made some comments in the commit, hope they are useful. |
What do you mean? Can you give an example? |
If you have ran normalize before this fix: diff --git a/spec/i18n_tasks_spec.rb b/spec/i18n_tasks_spec.rb
index 9d97ba8..6d07048 100644
--- a/spec/i18n_tasks_spec.rb
+++ b/spec/i18n_tasks_spec.rb
@@ -365,6 +365,8 @@ resolved_reference_target.a (resolved ref)
'config/locales/es.yml' => { 'es' => es_data }.to_yaml,
'config/locales/old_devise.en.yml' => { 'en' => { 'devise' => { 'a' => 'EN_TEXT' } } }.to_yaml,
'config/locales/old_devise.es.yml' => { 'es' => { 'devise' => { 'a' => 'ES_TEXT' } } }.to_yaml,
+ 'config/locales/devise.en.yml' => { 'en' => { 'devise' => { 'a' => 'EN_TEXT' } } }.to_yaml,
+ 'config/locales/devise.es.yml' => { 'es' => { 'devise' => { 'a' => 'ES_TEXT' } } }.to_yaml,
'config/locales/unused.en.yml' => { 'en' => { 'unused' => { 'file' => 'EN_TEXT' } } }.to_yaml,
'config/locales/unused.es.yml' => { 'es' => { 'unused' => { 'file' => 'ES_TEXT' } } }.to_yaml,
'config/locales/not-in-write/unused.en.yml' => And then run it again with the fix, and you still got your duplicates. Not sure whether this should be fixed by normalize or some kind of consistency check. If this has happened long ago you may have different translations for the same keys. Still this is a minor issue as when you move translations around you should carefully examine your diffs in the first place. |
This should probably just issue a warning when loading the data (like we do for other pathological cases). |
Sounds good. |
If you use normalize to move translations between files you may end with duplicate entries in different files.
The text was updated successfully, but these errors were encountered: