Changes for mozo host

This commit is contained in:
2020-03-05 11:36:19 -05:00
parent 02e60c174d
commit 3aa204aa30
7 changed files with 32 additions and 17 deletions
+2
View File
@@ -64,9 +64,11 @@ module Cmtool
def flag_locales
[:ad, :ae, :af, :ag, :ai, :al, :am, :an, :ao, :aq, :ar, :as, :at, :au, :aw, :az, :ba, :bb, :bd, :be, :bf, :bg, :bh, :bi, :bj, :bm, :bn, :bo, :br, :bs, :bt, :bw, :by, :bz, :ca, :cd, :cf, :cg, :ch, :ci, :ck, :cl, :cm, :cn, :co, :cr, :cu, :cv, :cy, :cz, :de, :dj, :dk, :dm, :do, :dz, :ec, :ee, :eg, :eh, :en, :er, :es, :et, :fi, :fj, :fm, :fo, :fr, :ga, :gb, :gd, :ge, :gg, :gh, :gi, :gl, :gm, :gn, :gp, :gq, :gr, :gt, :gu, :gw, :gy, :hk, :hn, :hr, :ht, :hu, :id, :ie, :il, :im, :in, :iq, :ir, :is, :it, :je, :jm, :jo, :jp, :ke, :kg, :kh, :ki, :km, :kn, :kp, :kr, :kw, :ky, :kz, :la, :lb, :lc, :li, :lk, :lr, :ls, :lt, :lu, :lv, :ly, :ma, :mc, :md, :me, :mg, :mh, :mk, :ml, :mm, :mn, :mo, :mq, :mr, :ms, :mt, :mu, :mv, :mw, :mx, :my, :mz, :na, :nc, :ne, :ng, :ni, :nl, :no, :np, :nr, :nz, :om, :pa, :pe, :pf, :pg, :ph, :pk, :pl, :pr, :ps, :pt, :pw, :py, :qa, :re, :ro, :rs, :ru, :rw, :sa, :sb, :sc, :sd, :se, :sg, :si, :sk, :sl, :sm, :sn, :so, :sr, :st, :sv, :sy, :sz, :tc, :td, :tg, :th, :tj, :tl, :tm, :tn, :to, :tr, :tt, :tv, :tw, :tz, :ua, :ug, :us, :uy, :uz, :va, :vc, :ve, :vg, :vi, :vn, :vu, :ws, :ye, :za, :zm, :zw]
end
def locales
Rails.configuration.i18n.available_locales.presence || []
end
def default_locale
:en
end
+8 -4
View File
@@ -141,18 +141,22 @@ module Cmtool
def engine
return @options[:engine] if @options[:engine].present?
base = @options[:scope].presence
base ||= @resource.name.split('::').first if @resource.name.index('::')
if @options[:scope].present?
base = options[:scope].to_s.camelize
else
base = @resource.name.split('::').first if @resource.name.index('::')
end
return Rails.application unless base
return base if base.is_a?(Rails::Engine)
return base if base.is_a?(Rails::Engine) # WTF?
if e = "#{base}::Engine".safe_constantize
return e
end
return Rails.application
end
def nested_controller_name
if @options[:scope].present?
"#{@options[:scope]}::#{@resource.name.split('::').last}".underscore.pluralize
"#{@options[:scope].to_s.camelize}::#{@resource.name.split('::').last}".underscore.pluralize
else
@resource.name.underscore.pluralize
end