Rémi Verschelde
0fcb68ffa1
Translation: Refactor locale matching to use proper language code
...
The previous code only parsed the first two characters (potentially reading
out of bounds if input was invalid), but some locales use a 3-letter language
code (e.g. 'nah_MX').
So I refactored the logic a bit to properly parse the locale and extract the
part left of the regional code, if provided (supports both 'en_US' and 'en-US'
style).
I made TranslationServer::get_language_code() public as I'll use it in a
follow up commit.
2019-12-04 16:53:08 +01:00
..
2019-12-04 11:14:21 +01:00
2019-10-28 08:07:29 +01:00
2019-12-01 05:50:33 +01:00
2019-12-03 15:43:59 +02:00
2019-12-04 11:14:21 +01:00
2019-09-24 21:33:09 +02:00
2019-09-14 13:08:28 -07:00
2019-09-25 10:28:50 +02:00
2019-11-28 22:57:27 +01:00
2019-05-24 20:37:40 +01:00
2019-10-14 16:46:54 -04:00
2019-10-14 16:46:54 -04:00
2019-02-16 04:00:19 +01:00
2019-08-12 04:26:38 -05:00
2019-10-14 11:40:55 +02:00
2019-01-01 12:58:10 +01:00
2019-05-03 15:06:05 -07:00
2019-05-03 15:06:05 -07:00
2019-10-08 11:03:57 +02:00
2019-10-10 18:12:20 +02:00
2019-04-20 02:01:55 +02:00
2019-09-25 10:28:50 +02:00
2019-07-11 08:25:26 +01:00
2019-06-27 12:48:26 +02:00
2019-11-11 10:57:00 +01:00
2019-11-13 14:21:32 +01:00
2019-08-08 11:58:57 +03:00
2019-08-08 11:58:57 +03:00
2019-06-27 12:48:26 +02:00
2019-02-12 13:34:25 +01:00
2019-10-24 08:18:34 +02:00
2019-02-12 13:34:25 +01:00
2019-11-01 16:16:31 +01:00
2019-09-25 10:28:50 +02:00
2019-09-25 10:28:50 +02:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-10-08 11:03:57 +02:00
2019-07-23 09:14:31 +02:00
2019-10-08 11:03:57 +02:00
2019-09-25 10:28:50 +02:00
2019-05-09 06:25:32 -04:00
2019-01-01 12:58:10 +01:00
2019-08-12 04:26:38 -05:00
2019-01-01 12:58:10 +01:00
2019-10-09 15:44:00 +02:00
2019-08-12 04:26:38 -05:00
2019-09-21 14:32:40 +08:00
2019-09-28 18:15:23 +03:00
2019-08-17 14:20:16 +02:00
2019-04-20 02:01:55 +02:00
2019-10-28 08:07:29 +01:00
2019-01-01 12:58:10 +01:00
2019-01-30 06:43:56 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-08-17 12:33:15 +02:00
2019-01-01 12:58:10 +01:00
2019-08-17 12:33:15 +02:00
2019-10-31 16:27:32 +01:00
2019-05-30 10:28:03 +02:00
2019-01-01 12:58:10 +01:00
2019-11-26 13:42:18 +01:00
2019-09-25 15:29:59 +02:00
2019-10-28 18:32:00 +01:00
2019-10-28 18:32:00 +01:00
2019-09-04 12:17:07 +08:00
2019-09-04 12:17:07 +08:00
2019-08-21 16:59:38 +02:00
2019-08-12 04:26:38 -05:00
2019-10-21 13:53:45 +02:00
2019-10-21 13:53:45 +02:00
2019-01-01 12:58:10 +01:00
2019-08-12 04:26:38 -05:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-09-04 12:17:07 +08:00
2019-09-03 20:49:09 +02:00
2019-09-03 20:49:09 +02:00
2019-10-08 11:54:29 +02:00
2019-10-23 02:51:32 +01:00
2019-11-03 10:37:48 -06:00
2019-10-08 11:03:57 +02:00
2019-08-12 04:26:38 -05:00
2019-01-01 12:58:10 +01:00
2019-10-08 11:03:57 +02:00
2019-01-01 12:58:10 +01:00
2019-10-03 19:14:29 +02:00
2019-04-19 02:11:39 +02:00
2019-07-20 08:09:57 +02:00
2019-08-12 04:26:38 -05:00
2019-12-04 16:53:08 +01:00
2019-12-04 16:53:08 +01:00
2019-07-22 00:08:35 +02:00
2019-11-20 16:22:16 +01:00
2019-04-05 11:10:15 +03:00
2019-06-26 16:32:34 +02:00
2019-06-26 16:32:34 +02:00
2019-11-20 16:22:16 +01:00
2019-11-01 16:16:31 +01:00
2019-11-07 14:54:15 +01:00
2019-07-20 08:09:57 +02:00
2019-09-22 18:45:08 +02:00
2019-01-01 12:58:10 +01:00
2019-10-24 15:14:55 +03:00
2019-08-12 04:26:38 -05:00
2019-06-11 14:49:34 +02:00
2019-02-17 13:38:52 +01:00
2019-10-24 08:18:34 +02:00
2019-04-05 23:41:51 +02:00