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

Translation error after updating from 4.7 to 4.8.1 #12047

Closed
pkatek opened this issue May 28, 2024 · 9 comments · Fixed by #12049
Closed

Translation error after updating from 4.7 to 4.8.1 #12047

pkatek opened this issue May 28, 2024 · 9 comments · Fixed by #12049
Assignees

Comments

@pkatek
Copy link

pkatek commented May 28, 2024

Context

I am reporting an error in the application after updating to 4.8.1.
By default, my language is set to English (US).
And there are the following errors:

  1. Products incorrectly interpret the default store language in an existing store with several language versions.
  2. Translations from the default language are not loaded in the store configuration. In the console in Spree::Store.first.translations there are correct translations for the "en" and other languages.

s = Spree::Store.first.
In the console:
irb(main):016> s.seo_title_en
=> nil
irb(main):017> s.seo_title_cs
=> "Vylepšete svůj styl s YES: Nádherné šperky pro každou příležitost."

Translations are indicated in s.translations, everything worked fine before the update.
After the update, should I do any additional rake task migrations or anything else apart from the basic ones?

@damianlegawiec
Copy link
Member

Hey @pkatek

In your spree initializer please set:

Spree::RuntimeConfig.always_use_translations = true

I've missed this one in the upgrade guide if you're upgrading from 4.7, will add it shortly

@pkatek
Copy link
Author

pkatek commented May 28, 2024

Thanks!

@pkatek
Copy link
Author

pkatek commented May 28, 2024

In intializer i have
Spree::RuntimeConfig.always_use_translations = true
And in rails console

3.2.2 :001 > Spree::RuntimeConfig.always_use_translations
=> true

But in spree admin I don't have translations.

Zrzut ekranu 2024-05-28 o 12 16 38

@pkatek
Copy link
Author

pkatek commented May 28, 2024

When I switch to another store that uses only one language (CS), everything is fine.

@pkatek
Copy link
Author

pkatek commented May 28, 2024

When I enter the values and change the default language, an entry like this is made in Store translations @damianlegawiec.
Pay attention to the locale: "EN", it is written incorrectly. I also have an entry with correctly written: locale: "en",

#<Spree::Store::Translation:0x00007fb1df55ac88 id: 6, name: "a", meta_description: nil, meta_keywords: nil, seo_title: nil, facebook: nil, twitter: nil, instagram: nil, customer_support_email: nil, description: nil, address: nil, contact_phone: nil, new_order_notifications_email: nil, locale: "EN", spree_store_id: 2, created_at: Tue, 27 Feb 2024 12:15:07.499612000 UTC +00:00, updated_at: Tue, 27 Feb 2024 12:15:07.499612000 UTC +00:00, deleted_at: nil>]

@mad-eel mad-eel self-assigned this May 28, 2024
@pkatek
Copy link
Author

pkatek commented May 29, 2024 via email

@chuckaiyu
Copy link

chuckaiyu commented May 29, 2024

Because Mobility plugin column_fallback default locale content was store main table, other locale store in translation table. If you use default locale :en, only in form to change it. other language can be use translate form to change.

So I use this migration code at core/db/migrate/20230117121303_transfer_taxonomy_data_to_translatable_tables.rb:

Spree::TranslationMigrations.new(Spree::Taxonomy, 'en').revert_translation_data_transfer

If your have other language, must change truncate method to delete only locale=en

@damianlegawiec
Copy link
Member

@pkatek @chuckyuee please upgrade to v4.8.2

@pkatek
Copy link
Author

pkatek commented May 29, 2024

Now it works great! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants