discourse/spec/components/freedom_patches
David Taylor 1bc1a439ee
PERF: Ensure locales are always handled as symbols internally (#12897)
Sometimes, parts of the application pass in the locale as a string, not a symbol. This was causing the translate_accelerator to cache two versions of the locale separately: one cache for the symbol version, and one cache for the string version. For example, in a running production process:

```
irb(main):001:0> I18n.instance_variable_get(:@loaded_locales)
=> [:en, "en"]
```

This commit ensures the `locale` key is always converted to a symbol, and adds a spec to ensure the same locale cannot appear twice in `@loaded_locales`
2021-04-30 10:56:27 +01:00
..
safe_buffer_spec.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
schema_migration_details_spec.rb DEV: correct spec failures in PG 12 2019-11-26 16:39:14 +11:00
translate_accelerator_spec.rb PERF: Ensure locales are always handled as symbols internally (#12897) 2021-04-30 10:56:27 +01:00