Commit Graph

89 Commits

Author SHA1 Message Date
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
Sam
8874c9ea75 Add message format support that can be used on complex localization strings
Add message about new and unread topics at the bottom of topics
move localization helper into lib
2013-05-30 16:49:57 +10:00