Commit Graph

51 Commits

Author SHA1 Message Date
Gerhard Schlager
e180e14a55 DEV: Reload current client locale file in development mode 2019-01-15 22:55:51 +01:00
Gerhard Schlager
86546bb5c6 DEV: Use locale fallback even in development mode
Making dev behave differently than prod is a bad idea.
2018-12-18 16:01:14 +01:00
Robin Ward
e0096b0d1c Safety in case translations are missing root keys 2018-06-12 10:09:57 -04:00
Guo Xiang Tan
e82d45b009 FIX: Ensure we have proper timeout for MiniRacer. 2018-06-11 08:41:04 +08:00
Joffrey JAFFEUX
78435833a5
FEATURE: discourse-cronos is now a core plugin 2018-05-03 20:15:57 +02:00
Angus McLeod
fa7ddf7238 Add wizard_js to translations that can be overridden from a plugin 2018-04-06 11:34:25 +02:00
Gerhard Schlager
eb52c5469e FEATURE: Allow plugins to register a new locale 2018-01-25 14:57:41 +01:00
Sam
8ff5f5f2ef FIX: cache admin locale file for 24 hours 2018-01-09 10:23:49 +11:00
Robin Ward
5a959ca4e4 FIX: We also need a base key for admin_js 2017-11-27 11:57:06 -05:00
Neil Lalonde
6f8f2c494d FIX: admin strings in plugins should fallback to english when untranslated 2017-11-24 14:11:01 -05:00
Robin Ward
2974faee68 FIX: Support client locales defined in plugins 2017-11-16 16:21:53 -05:00
Robin Ward
dc15e48334 FIX: You can't cache the files here, plugin translations won't work 2017-08-09 17:28:11 -04:00
Robin Ward
53e6ccf17b Allow reloading of translation keys for plugins in development mode 2017-08-09 13:58:20 -04:00
Guo Xiang Tan
5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Guo Xiang Tan
ac9c8ccf3b Fix broken specs. 2017-07-20 13:17:45 +09:00
Guo Xiang Tan
0edb0018ff Dispose of heap when we reset the context. 2017-07-20 13:10:56 +09:00
Arpit Jalan
3449339fea FIX: admin locales were not getting converted to message format 2017-03-25 01:12:23 +05:30
Régis Hanol
a2c04be718 FIX: eradicate I18n fallback issues 💣
FIX: client's translation overrides were not working when the current locale was missing a key
FIX: ExtraLocalesController.show was not properly handling multiple translations
FIX: JsLocaleHelper#output_locale was not properly handling multiple translations

FIX: ExtraLocalesController.show's spec which was randomly failing
FIX: JsLocaleHelper#output_locale was muting cached translations hashes

REFACTOR: move 'enableVerboseLocalization' to the 'localization' initializer
REFACTOR: remove unused I18n.js methods (getFallbacks, localize, parseDate, toTime, strftime, toCurrency, toPercentage)
REFACTOR: remove all I18n.pluralizationRules and instead use MessageFormat's pluralization rules

TEST: add tests for localization initializer
TEST: add tests for I18n.js
2017-02-24 11:31:21 +01:00
Sam
7e43e73df6 FIX: properly reset all contexts after forking
Fixes hang on backup
2016-11-02 13:34:20 +11:00
Guo Xiang Tan
ccd75cf987 FIX: Ensure that the right locale exists before merging. 2016-09-30 15:01:42 +08:00
Guo Xiang Tan
72ccb4e11d FIX: Plugin "admin_js" translations bundle was not fetched. 2016-09-29 04:42:26 +08:00
Robin Ward
6070939daa Support for other i18n bundles 2016-09-22 09:48:58 -04:00
Sam
695773db1c FEATURE: upgrade from therubyracer to mini_racer
This pushes our internal V8 JavaScript engine from Chrome 32 to 50.

It also resolves some long standing issues we had with the old wrapper.
2016-05-23 09:57:15 +10:00
Robin Ward
cc25716e47 FIX: Allow message format translations to be overridden 2016-04-08 14:49:50 -04:00
Gerhard Schlager
89add4a4a2 JsLocaleHelper should search for moment.js locale files
moment.js uses a different naming conventions for locale files.
E.g. "zh-zn" instead of "zh_ZN" and "nb" instead of "nb_NO"

This change allows us to use the locale files without renaming which
makes future upgrades of moment.js a lot easier.
2016-02-05 21:49:03 +01:00
Robin Ward
f423869e03 FIX: forgot end :) 2015-12-23 16:43:39 -05:00
Robin Ward
d792c0a1d7 Should not be active in dev mode 2015-12-23 16:39:56 -05:00
Robin Ward
d1ebb9d0b5 FIX: I18n Fallbacks were not applying correctly 2015-12-23 12:09:18 -05:00
Robin Ward
320e4a83ac FIX: Don't cache translations in development mode 2015-08-20 12:05:15 -04:00
Kane York
e3b778a23a fixup: support merging N languages (js) 2015-07-15 14:30:16 -07:00
Kane York
15905be788 Disable in development (js) 2015-07-15 14:25:24 -07:00
Kane York
cb395662d0 Add JsLocaleHelper tests for i18n fallback 2015-07-15 14:23:41 -07:00
Kane York
728845d008 FEATURE: Localization fallbacks (client)
This patch sets I18n.defaultLocale in the Discourse.start() script block (it
was formerly always 'en') to SiteSetting.default_locale, and patches
translate() to perform fallback to defaultLocale followed by english.
Additionally, when enable_verbose_localization() is called, no fallbacks will
be performed.

It also memoizes the file loading operations in JsLocaleHelper and strips out
translations from the fallbacks that are also present in a prefered language,
to minimize file size.
2015-07-15 10:17:28 -07:00
Régis Hanol
e6e7948617 FEATURE: support for emoji sets
Added following emoji sets
  - Apple/International
  - Emoji One (default)
  - Android/Google
  - Twitter

FIX: translations from plugins weren't properly merged with default translations
FEATURE: new 'site_setting_changed' event
2014-12-11 17:08:47 +01:00
Neil Lalonde
7926b4f5c1 FIX: moment.js data formats were always english 2014-08-07 12:08:23 -04:00
Sam
d71f62a9f9 Merge pull request #2180 from tomciopp/master
More idiomatic approach to finding drafts
2014-04-08 16:46:24 +10:00
Thomas Cioppettini
38882eb1a7 Remove threequals from ruby files 2014-03-26 12:20:41 -07:00
Cyril Rohr
3631ba2eb5 Use string interpolation, to avoid segmentation fault.
The segmentation fault was ocurring when precompiling assets, with ruby2.0.0.
2014-03-26 15:06:22 +00:00
Neil Lalonde
ac8203b601 FIX: plugin translations overwrite each other 2014-02-19 17:16:36 -05:00
Neil Lalonde
f3feb441f9 Allow translations for admin_js in plugins. Use deep_merge so plugins can add to existing sections. 2013-11-20 11:51:07 -05:00
Régis Hanol
3a8bc60bf2 fix build 2013-11-19 17:16:07 +01:00
Régis Hanol
291acca4fa autoload server/client locales in plugins 2013-11-19 16:42:28 +01:00
Sam
e922f10f4e correct locale helper so it falls back to english message format if mf is missing 2013-07-25 11:16:07 +10:00
Sam
d0f50cb266 fixing up moment locales, they were not set up properly 2013-07-25 11:09:29 +10:00
Krugloff
d0901289e7 File exists check 2013-06-16 02:47:51 +04:00
Aleksandr Kruglov
ae81523aa5 It maybe worth load pluralizations rules before compile? 2013-06-15 02:31:36 +04:00
Sam
ae1f5b3de0 goodbye NaNy 2013-06-12 16:38:02 +10:00
Sam
c2cfbce9ce automatically updating times for posts on topic
moved moment.js into localization file (we need to localize it)
added helpers for date formatting use, moment().shortDate() moment().longDate() moment().shortDateNoYear()
2013-06-11 17:25:50 +10:00
Sam
5fa20ce357 more progress towards full migration to moment.js 2013-06-07 18:27:42 +10:00
Anton Batenev
621d949033 Update js_locale_helper.rb
Fix "undefined method `end_with?' for 1:Fixnum" when field name in YML file is not quoted number like:

```
    user_action_groups:
      1: "Likes Given"
      2: "Likes Received"
```

(yamllint.com validates such file as valid YML file)
2013-06-06 22:20:17 +04:00