discourse/lib/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
..
active_record_attribute_methods.rb
active_record_base.rb
ams_include_without_root.rb
better_handlebars_errors.rb
ember_handlebars.rb
fast_pluck.rb DEV: Upgrade Rails to 6.1.3.1 (#12688) 2021-04-21 12:36:32 +03:00
inflector_backport.rb DEV: correct some Ruby 2.7 deprecations 2020-07-16 17:43:20 +10:00
open_uri_redirections.rb
performance_fixes.rb
pluck_first.rb
rails4.rb
rails_multisite.rb DEV: Allow multisite apps to boot with readonly db. 2020-06-23 16:34:25 +08:00
raw_handlebars.rb FIX: Use `addRawTemplates` even when compiling `.hbr` files (#12228) 2021-03-01 11:46:50 -05:00
safe_buffer.rb
safe_migrations.rb
schema_cache_concurrency.rb
schema_migration_details.rb
sprockets_patches.rb PERF: apply sprockets patch in a test environment (#11034) 2020-10-27 10:17:21 +11:00
translate_accelerator.rb PERF: Ensure locales are always handled as symbols internally (#12897) 2021-04-30 10:56:27 +01:00