mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 13:52:50 +08:00
correct locale helper so it falls back to english message format if mf is missing
This commit is contained in:
parent
d0f50cb266
commit
e922f10f4e
|
@ -2,7 +2,7 @@
|
|||
// language : korean (ko)
|
||||
// author : Kyungwook, Park : https://github.com/kyungw00k
|
||||
|
||||
require('../moment').lang('ko', {
|
||||
moment.lang('ko', {
|
||||
months : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),
|
||||
monthsShort : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),
|
||||
weekdays : "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),
|
||||
|
|
|
@ -50,7 +50,11 @@ module JsLocaleHelper
|
|||
formats = message_formats.map{|k,v| k.inspect << " : " << compile_message_format(locale_str ,v)}.join(" , ")
|
||||
|
||||
result = "MessageFormat = {locale: {}};\n"
|
||||
result << File.read(Rails.root + "lib/javascripts/locale/#{locale_str}.js") << "\n"
|
||||
|
||||
filename = Rails.root + "lib/javascripts/locale/#{locale_str}.js"
|
||||
filename = Rails.root + "lib/javascripts/locale/en.js" unless File.exists?(filename)
|
||||
|
||||
result << File.read(filename) << "\n"
|
||||
|
||||
result << "I18n.messageFormat = (function(formats){
|
||||
var f = formats;
|
||||
|
|
Loading…
Reference in New Issue
Block a user