-
Notifications
You must be signed in to change notification settings - Fork 164
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
Localized Slugs with same translations are not generated #153
Comments
I added a spec on master in commit 8b2e023 testing this scenario and I can not replicate it. Is there something I am doing different in the spec compared to what you are doing? |
Hi, I copy pasted your suggestion:
>> page = Musicstyle.new
#<Musicstyle _id: 52e3e7302d289ec73d00006c, parent_id: nil, parent_ids: [], n(name): nil, dsc(description): nil, _slugs: {"en"=>[]}, location_ids: nil, user_ids: nil>
>> page.name_translations = {"en" => "Title on English", "nl" => "Title on English"}
{"en"=>"Title on English", "nl"=>"Title on English"}
>> page.save!
true
>> page.reload
#<Musicstyle _id: 52e3e7302d289ec73d00006c, parent_id: nil, parent_ids: [], n(name): {"en"=>"Title on English", "nl"=>"Title on English"}, dsc(description): nil, _slugs: {"en"=>[], "nl"=>["title-on-english"]}, location_ids: nil, user_ids: nil>
>> page["_slugs"]
{"en"=>[], "nl"=>["title-on-english"]}
>> page.name_translations = {"en" => "Title on English123", "de" => "Title on English123"}
{"en"=>"Title on English123", "de"=>"Title on English123"}
>> page.save!
true
>> page.reload
#<Musicstyle _id: 52e3e7302d289ec73d00006c, parent_id: nil, parent_ids: [], n(name): {"en"=>"Title on English123", "de"=>"Title on English123"}, dsc(description): nil, _slugs: {"en"=>[], "nl"=>["title-on-english"], "de"=>["title-on-english123"]}, location_ids: nil, user_ids: nil>
>> page["_slugs"]
{"en"=>[], "nl"=>["title-on-english"], "de"=>["title-on-english123"]} |
The most recent version of the I8n support in rails seems to fix your problem. We test this as part of your testsuite: Please let me know if this is not true for you. |
Any updates on this? |
I am closing this for now since I can't reproduce the problem. |
I have a model
If I am submitting a new Category an it has the same name in both translations only one slug will be generated:
THIS WORKS:
Category.create(name_translations: {"en"=>"Open Air", "de"=>"Freiluft"} )
THIS DOES NOT WORK:
Category.create(name_translations: {"en"=>"Open Air", "de"=>"Open Air"} )
What I am missing?
The text was updated successfully, but these errors were encountered: