mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
more progress towards full migration to moment.js
This commit is contained in:
@ -19,9 +19,17 @@ module JsLocaleHelper
|
||||
|
||||
result << "I18n.translations = #{translations.to_json};\n"
|
||||
result << "I18n.locale = '#{locale_str}'\n"
|
||||
result << moment_locale(locale_str)
|
||||
result
|
||||
end
|
||||
|
||||
def self.moment_locale(locale_str)
|
||||
filename = Rails.root + "lib/javascript/moment_locale/#{locale_str}.js"
|
||||
if File.exists?(filename)
|
||||
File.read(filename) << "\n"
|
||||
end || ""
|
||||
end
|
||||
|
||||
def self.generate_message_format(message_formats, locale_str)
|
||||
formats = message_formats.map{|k,v| k.inspect << " : " << compile_message_format(locale_str ,v)}.join(" , ")
|
||||
|
||||
|
Reference in New Issue
Block a user