mainio / decidim-module-term_customizer

Decidim module that allows customizing the localization terms in the system for specific contexts.
GNU Affero General Public License v3.0
16 stars 21 forks source link

Inconsistent translation behavior #120

Open fblupi opened 6 months ago

fblupi commented 6 months ago

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:

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

ahukkanen commented 6 months ago

This is likely a duplicate of #107.

Suggest checking out #110.

fblupi commented 6 months ago

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

ahukkanen commented 6 months ago

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.

fblupi commented 6 months ago

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

ahukkanen commented 6 months ago

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
fblupi commented 6 months ago

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

Robin481 commented 1 month ago

@fblupi Were you able to properly solve this on your end or did you try any other solutions or got any other hints? We are facing similar problems and are a wit's end.

fblupi commented 1 month ago

@fblupi Were you able to properly solve this on your end or did you try any other solutions or got any other hints? We are facing similar problems and are a wit's end.

No. I couldn't, sorry