mainio/decidim-module-term_customizer

Inconsistent translation behavior

Opened this issue · 6 comments

Description

We are encountering inconsistent translation behavior within the term customizer module of the Decidim Barcelona instance. Specifically, we have configured a translation set for both the participatory space and the specific proposals component, where we altered the translation for the evaluating status. The following keys were modified:

  • decidim.admin.filters.proposals.state_eq.values.evaluating
  • decidim.proposals.admin.proposal_answers.form.evaluating
  • decidim.proposals.answers.evaluating
  • decidim.proposals.application_helper.filter_state_values.evaluating

Despite these modifications, when accessing the public page of the proposals component, the translation is inconsistent. Sometimes it uses the custom translation, while other times it resorts to the default one.

Steps to Reproduce

  1. Configure a translation set for the participatory space and proposals component.
  2. Modify the translation for the evaluating status using the specified keys.
  3. Access the public page of the proposals component multiple times and check the inconsistent behavior.

Expected Behavior

The translation for the evaluating status should consistently reflect the custom value.

Actual Behavior

The translation for the evaluating status appears inconsistently, sometimes using the custom value and other times using the default one.

Screenshot

Screenshot_10-5-2024_132017_www decidim barcelona

Additional Information

This is likely a duplicate of #107.

Suggest checking out #110.

@ahukkanen I tried the solution from #110 but it didn't fix the problem 😔

Can you try disabling action controller caching by setting this in the environment configuration:

config.action_controller.perform_caching = false

It might be also cache related and if so, it would be hard to fix within term customizer alone because the cells can be shown inside different contexts.

This will obviously affect the performance of the app but at least would allow narrowing down the root cause of this issue.

I tried disabling action controller caching too. But the problem persists.

Actually it seems caching for cells cannot be disabled with this config as far as I understand from here:
https://github.com/trailblazer/cells-rails/blob/b4c491fa22c63a21b91595ec8b13022406c0452f/lib/cell/rails.rb#L64C7-L66

This method is overridden in Decidim:
https://github.com/decidim/decidim/blob/484ee5f93215a7c4c6ab06d530b2bb9fcf78bbba/decidim-core/lib/decidim/view_model.rb#L85-L87

But I believe setting the cache store to the null_store should work, i.e. this config:

config.action_controller.cache_store = :null_store

Changing the setting to null_store gives me the impression of facing these inconsistencies less often but the problem is still present.