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
..
2021-03-25 13:23:48 +00:00
2021-02-04 14:44:40 +00:00
2021-04-16 13:39:45 +01:00
2021-04-28 23:12:08 +03:00
2021-01-21 11:37:47 +10:00
2021-04-29 10:17:33 +03:00
2021-04-22 08:43:06 +02:00
2021-04-12 14:00:52 +10:00
2021-04-30 10:56:27 +01:00
2021-04-27 18:24:27 +02:00
2021-04-21 12:36:32 +03:00
2021-01-21 11:37:47 +10:00
2021-02-08 08:45:14 +01:00
2021-04-26 14:19:47 +03:00
2021-04-21 12:36:32 +03:00
2021-03-02 17:11:14 +00:00
2021-04-16 06:42:34 +05:30
2021-04-22 08:43:06 +02:00
2021-03-02 10:28:27 -06:00
2021-04-12 12:46:42 +10:00
2020-11-19 17:31:21 +01:00
2021-04-07 12:51:19 -03:00
2021-04-28 17:27:18 +01:00
2021-04-28 10:48:00 -04:00
2021-04-30 10:54:49 +01:00
2021-04-27 17:45:54 +01:00
2021-04-21 12:36:32 +03:00
2021-04-21 12:36:32 +03:00
2021-03-03 11:45:29 +02:00
2021-04-21 12:36:32 +03:00
2021-03-22 09:50:22 +10:00
2021-03-22 09:50:22 +10:00
2021-04-21 12:36:32 +03:00
2021-01-04 10:34:44 +01:00
2021-04-14 12:34:13 -05:00
2021-04-22 11:28:35 -04:00
2021-03-22 19:41:42 +02:00
2021-04-21 12:36:32 +03:00
2020-11-11 19:46:13 +00:00
2021-03-19 13:57:04 -04:00
2021-03-02 10:28:27 -06:00
2021-04-19 09:43:50 +10:00
2021-04-21 12:40:27 -04:00
2021-04-23 10:24:42 -04:00
2021-02-02 17:34:00 +01:00
2021-04-05 20:31:42 +05:30
2021-04-27 08:48:51 +03:00
2021-01-11 13:43:11 +11:00
2021-04-09 08:52:06 -04:00
2021-03-31 13:19:34 -04:00
2021-04-06 15:39:27 +03:00
2021-04-28 17:08:48 +02:00
2021-02-03 21:45:22 +05:30
2021-04-16 06:42:34 +05:30
2021-03-19 17:48:30 +10:00
2021-03-24 08:48:04 +11:00
2021-02-26 15:07:04 +02:00
2021-04-14 18:09:55 +03:00
2021-04-16 10:21:39 +02:00
2021-03-11 21:07:29 -03:00
2021-04-21 08:41:36 -03:00
2021-03-25 12:34:53 +11:00
2021-01-11 15:58:27 -05:00
2021-04-27 18:24:27 +02:00
2021-04-21 08:41:36 -03:00
2021-03-17 16:11:40 +03:00
2021-01-19 11:35:46 +02:00
2021-01-04 22:32:08 +03:00
2020-12-30 16:05:42 +11:00
2021-04-27 15:52:45 +10:00
2021-02-08 10:04:33 +00:00
2021-03-19 10:20:10 +10:00
2021-04-07 12:51:19 -03:00
2021-01-12 17:28:33 +02:00
2021-03-02 18:51:50 +01:00
2021-04-28 23:12:08 +03:00
2020-11-11 15:11:36 +02:00
2021-04-28 23:12:08 +03:00
2021-04-20 18:42:02 -04:00
2021-03-10 20:15:04 -05:00
2021-01-25 11:30:59 +01:00
2021-04-23 16:55:34 +03:00
2020-12-11 14:20:48 +02:00
2021-04-28 11:29:54 +10:00
2021-03-15 11:58:53 -03:00
2021-01-29 09:03:44 +10:00
2021-01-21 12:47:03 -05:00
2020-11-12 13:57:12 +01:00
2020-10-30 15:04:29 +01:00
2021-04-12 13:55:54 +10:00
2021-02-16 12:34:03 +10:00
2020-12-30 18:13:13 +00:00
2021-04-06 11:13:06 -04:00
2020-12-23 08:51:36 +11:00
2021-04-29 13:37:14 -04:00
2021-03-16 09:47:57 +11:00