mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 01:13:38 +08:00
FIX: moment.js data formats were always english
This commit is contained in:
parent
37a9747f53
commit
7926b4f5c1
|
@ -1,6 +1,9 @@
|
|||
module JsLocaleHelper
|
||||
|
||||
def self.output_locale(locale, translations = nil)
|
||||
current_locale = I18n.locale
|
||||
I18n.locale = locale.to_sym
|
||||
|
||||
locale_str = locale.to_s
|
||||
|
||||
# load default translations
|
||||
|
@ -31,6 +34,9 @@ module JsLocaleHelper
|
|||
result << File.read("#{Rails.root}/lib/javascripts/moment.js")
|
||||
result << moment_locale(locale_str)
|
||||
result << moment_formats
|
||||
|
||||
I18n.locale = current_locale
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user