motorefi-lit 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +170 -0
- data/Rakefile +38 -0
- data/app/assets/images/lit/famfamfam_flags/ad.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ae.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/af.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ag.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ai.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/al.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/am.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/an.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ao.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ar.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/as.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/at.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/au.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/aw.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ax.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/az.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ba.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bb.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bd.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/be.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bf.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bh.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bi.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bj.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bo.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/br.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bs.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bt.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bv.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bw.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/by.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/bz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ca.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/catalonia.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cc.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cd.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cf.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ch.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ci.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ck.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cl.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/co.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cs.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cu.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cv.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cx.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cy.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/cz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/da.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/de.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/dj.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/dk.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/dm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/do.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/dz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ec.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ee.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/eg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/eh.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/en.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/england.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/er.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/es.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/et.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/europeanunion.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/fam.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/fi.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/fj.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/fk.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/fm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/fo.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/fr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ga.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gb.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gd.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ge.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gf.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gh.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gi.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gl.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gp.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gq.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gs.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gt.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gu.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gw.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/gy.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/hk.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/hm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/hn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/hr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ht.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/hu.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/id.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ie.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/il.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/in.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/io.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/iq.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ir.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/is.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/it.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ja.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/jm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/jo.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/jp.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ke.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/kg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/kh.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ki.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/km.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/kn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/kp.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/kr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/kw.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ky.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/kz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/la.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/lb.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/lc.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/li.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/lk.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/lr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ls.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/lt.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/lu.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/lv.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ly.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ma.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mc.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/md.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/me.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mh.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mk.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ml.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mo.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mp.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mq.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ms.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mt.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mu.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mv.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mw.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mx.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/my.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/mz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/na.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/nc.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ne.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/nf.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ng.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ni.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/nl.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/no.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/np.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/nr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/nu.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/nz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/om.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pa.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pe.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pf.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ph.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pk.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pl.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ps.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pt.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/pw.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/py.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/qa.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/re.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ro.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/rs.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ru.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/rw.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sa.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sb.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sc.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/scotland.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sd.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/se.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sh.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/si.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sj.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sk.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sl.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/so.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/st.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sv.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sy.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/sz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tc.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/td.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tf.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/th.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tj.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tk.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tl.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/to.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tr.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tt.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tv.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tw.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/tz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ua.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ug.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/um.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/us.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/uy.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/uz.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/va.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/vc.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ve.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/vg.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/vi.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/vn.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/vu.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/wales.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/wf.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ws.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/ye.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/yt.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/za.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/zm.png +0 -0
- data/app/assets/images/lit/famfamfam_flags/zw.png +0 -0
- data/app/assets/images/lit/jquery-te.png +0 -0
- data/app/assets/javascripts/lit/application.js +19 -0
- data/app/assets/javascripts/lit/backend/bootstrap.js.coffee +4 -0
- data/app/assets/javascripts/lit/backend/dashboard.js +2 -0
- data/app/assets/javascripts/lit/backend/jquery-te-1.4.0.min.js +9 -0
- data/app/assets/javascripts/lit/backend/localizations.js.coffee +26 -0
- data/app/assets/javascripts/lit/backend/sources.js.coffee +24 -0
- data/app/assets/javascripts/lit/lit_frontend.js +103 -0
- data/app/assets/javascripts/lit/mousetrap.js +1044 -0
- data/app/assets/stylesheets/lit/application.css +59 -0
- data/app/assets/stylesheets/lit/backend/jquery-te-1.4.0.css.scss +457 -0
- data/app/assets/stylesheets/lit/lit_frontend.css +86 -0
- data/app/controllers/lit/api/v1/base_controller.rb +19 -0
- data/app/controllers/lit/api/v1/locales_controller.rb +14 -0
- data/app/controllers/lit/api/v1/localization_keys_controller.rb +15 -0
- data/app/controllers/lit/api/v1/localizations_controller.rb +18 -0
- data/app/controllers/lit/application_controller.rb +49 -0
- data/app/controllers/lit/concerns/request_info_store.rb +16 -0
- data/app/controllers/lit/concerns/request_keys_store.rb +16 -0
- data/app/controllers/lit/dashboard_controller.rb +9 -0
- data/app/controllers/lit/incomming_localizations_controller.rb +49 -0
- data/app/controllers/lit/locales_controller.rb +31 -0
- data/app/controllers/lit/localization_keys_controller.rb +117 -0
- data/app/controllers/lit/localizations_controller.rb +60 -0
- data/app/controllers/lit/sources_controller.rb +77 -0
- data/app/helpers/lit/application_helper.rb +4 -0
- data/app/helpers/lit/dashboard_helper.rb +4 -0
- data/app/helpers/lit/frontend_helper.rb +71 -0
- data/app/helpers/lit/localization_keys_helper.rb +5 -0
- data/app/helpers/lit/localizations_helper.rb +15 -0
- data/app/helpers/lit/sources_helper.rb +7 -0
- data/app/jobs/lit/synchronize_source_job.rb +11 -0
- data/app/models/lit/incomming_localization.rb +77 -0
- data/app/models/lit/locale.rb +48 -0
- data/app/models/lit/localization.rb +103 -0
- data/app/models/lit/localization_key.rb +107 -0
- data/app/models/lit/localization_version.rb +12 -0
- data/app/models/lit/source.rb +111 -0
- data/app/views/kaminari/lit/_first_page.html.erb +5 -0
- data/app/views/kaminari/lit/_gap.html.erb +3 -0
- data/app/views/kaminari/lit/_last_page.html.erb +6 -0
- data/app/views/kaminari/lit/_next_page.html.erb +5 -0
- data/app/views/kaminari/lit/_page.html.erb +3 -0
- data/app/views/kaminari/lit/_paginator.html.erb +17 -0
- data/app/views/kaminari/lit/_prev_page.html.erb +5 -0
- data/app/views/layouts/lit/_messages.html.erb +6 -0
- data/app/views/layouts/lit/_navigation.html.erb +23 -0
- data/app/views/layouts/lit/application.html.erb +46 -0
- data/app/views/lit/dashboard/index.html.erb +5 -0
- data/app/views/lit/incomming_localizations/accept.js.erb +2 -0
- data/app/views/lit/incomming_localizations/destroy.js.erb +1 -0
- data/app/views/lit/incomming_localizations/index.html.erb +52 -0
- data/app/views/lit/locales/_hide_link.html.erb +1 -0
- data/app/views/lit/locales/hide.js.erb +1 -0
- data/app/views/lit/locales/index.html.erb +20 -0
- data/app/views/lit/localization_keys/_localization_row.html.erb +14 -0
- data/app/views/lit/localization_keys/destroy.js.erb +1 -0
- data/app/views/lit/localization_keys/index.html.erb +127 -0
- data/app/views/lit/localization_keys/star.js.erb +1 -0
- data/app/views/lit/localizations/_form.html.erb +23 -0
- data/app/views/lit/localizations/_previous_versions_rows.html.erb +15 -0
- data/app/views/lit/localizations/edit.js.erb +7 -0
- data/app/views/lit/localizations/previous_versions.js.erb +3 -0
- data/app/views/lit/localizations/update.js.erb +4 -0
- data/app/views/lit/sources/_form.html.erb +35 -0
- data/app/views/lit/sources/edit.html.erb +6 -0
- data/app/views/lit/sources/index.html.erb +42 -0
- data/app/views/lit/sources/new.html.erb +5 -0
- data/app/views/lit/sources/show.html.erb +19 -0
- data/config/routes.rb +49 -0
- data/db/migrate/20180101010101_lit_create_lit_locales.rb +16 -0
- data/db/migrate/20180101010102_lit_create_lit_localization_keys.rb +18 -0
- data/db/migrate/20180101010103_lit_create_lit_localizations.rb +24 -0
- data/db/migrate/20180101010104_lit_add_is_completed_and_is_starred_to_localization_keys.rb +17 -0
- data/db/migrate/20180101010105_lit_add_is_hidden_to_locales.rb +12 -0
- data/db/migrate/20180101010106_lit_create_lit_localization_versions.rb +20 -0
- data/db/migrate/20180101010107_lit_create_lit_sources.rb +19 -0
- data/db/migrate/20180101010108_lit_create_lit_incomming_localizations.rb +34 -0
- data/db/migrate/20180101010109_lit_add_sync_complete_to_lit_sources.rb +12 -0
- data/lib/generators/lit/install/templates/initializer.rb +52 -0
- data/lib/generators/lit/install_generator.rb +66 -0
- data/lib/lit.rb +65 -0
- data/lib/lit/adapters/hash_storage.rb +12 -0
- data/lib/lit/adapters/redis_storage.rb +99 -0
- data/lib/lit/cache.rb +356 -0
- data/lib/lit/engine.rb +28 -0
- data/lib/lit/i18n_backend.rb +192 -0
- data/lib/lit/loader.rb +16 -0
- data/lib/lit/rails.rb +17 -0
- data/lib/lit/railtie.rb +12 -0
- data/lib/lit/version.rb +3 -0
- data/lib/tasks/lit_tasks.rake +29 -0
- metadata +478 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if localization.is_a?(Array) %>
|
2
|
+
<ul>
|
3
|
+
<% localization.each do |l| %>
|
4
|
+
<li><%= l %></li>
|
5
|
+
<% end %>
|
6
|
+
</ul>
|
7
|
+
<% else %>
|
8
|
+
<% if localization.nil? %>
|
9
|
+
<em title="<%= I18n.t('.value_not_yet_translated', default: 'Value not yet translated') %>">null</em>
|
10
|
+
<% else %>
|
11
|
+
<%= localization %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
$('tr.localization_key_row[data-id="<%= @localization_key.id %>"]').fadeOut();
|
@@ -0,0 +1,127 @@
|
|
1
|
+
<h3><%= I18n.t('.header', default: 'Localization keys') %></h3>
|
2
|
+
<% available_locales = I18n.backend.available_locales %>
|
3
|
+
|
4
|
+
<table class="table">
|
5
|
+
<%- @localization_keys.each do |lk| %>
|
6
|
+
<tr class="localization_key_row" data-id="<%= lk.id %>">
|
7
|
+
<td>
|
8
|
+
<strong><%= lk.localization_key %></strong>
|
9
|
+
<span class="badge"><%= Lit.init.cache.get_global_hits_counter(lk.localization_key) %></span>
|
10
|
+
<div class="localization_keys_options">
|
11
|
+
<% if Lit.store_request_info %>
|
12
|
+
<%= link_to '#', class: 'request_info_link title', title: 'Show / hide request' do %>
|
13
|
+
<%= draw_icon 'link' %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<%= link_to lit.star_localization_key_path(lk), remote: true, class: 'star_icon title', title: 'Star / unstar translation key' do %>
|
17
|
+
<%= draw_icon lk.is_starred? ? 'star' : 'star-o' %>
|
18
|
+
<% end %>
|
19
|
+
<%= link_to lit.localization_key_path(lk), method: :delete, data: {confirm: t('lit.common.you_sure', default: "Are you sure?")}, remote: true, title: 'Delete translation key', class: 'title' do %>
|
20
|
+
<%= draw_icon 'trash-o' %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
<div class="detail_wrapper">
|
24
|
+
<table class="table table-bordered table-striped">
|
25
|
+
<%- available_locales.each do |locale| %>
|
26
|
+
<%- localization = localization_for(locale, lk) %>
|
27
|
+
<tr>
|
28
|
+
<td class="localization_row" data-id="<%= localization.id%>" data-edit="<%= edit_localization_key_localization_path(lk, localization, format: :js) %>" data-editing=0 data-content="">
|
29
|
+
<%= render partial: 'localization_row', locals: {localization: Lit.init.cache["#{locale}.#{lk.localization_key}"]} %>
|
30
|
+
</td>
|
31
|
+
<td class="locale_row">
|
32
|
+
<%= image_tag "lit/famfamfam_flags/#{locale[0,2]}.png" %>
|
33
|
+
<%= locale %>
|
34
|
+
<% if localization %>
|
35
|
+
<%= link_to lit.previous_versions_localization_key_localization_path(lk, localization, format: :js), class: "show_prev_versions #{'hidden' unless has_versions?(localization)}", remote: true do %>
|
36
|
+
<%= draw_icon 'random', title: I18n.t('lit.common.previous_versions', default: 'Previous versions') %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
</td>
|
40
|
+
</tr>
|
41
|
+
<tr class="hidden localization_versions_row" data-id="<%= localization.id %>">
|
42
|
+
<td colspan="2" class="localization_versions"></td>
|
43
|
+
</tr>
|
44
|
+
<% end %>
|
45
|
+
<% if Lit.store_request_info %>
|
46
|
+
<tr class="hidden request_info_row">
|
47
|
+
<td colspan="2">
|
48
|
+
<strong>Translation key recently displayed on following pages:</strong>
|
49
|
+
<ul>
|
50
|
+
<% Lit.init.cache.get_request_info(lk.localization_key).split(' ').reverse.each do |l| %>
|
51
|
+
<li><%= link_to l, l %></li>
|
52
|
+
<% end %>
|
53
|
+
</ul>
|
54
|
+
<em>Note: you might not have access to those pages!</em>
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<% end %>
|
58
|
+
</table>
|
59
|
+
</div>
|
60
|
+
</td>
|
61
|
+
</tr>
|
62
|
+
<% end %>
|
63
|
+
|
64
|
+
</table>
|
65
|
+
<% if defined?(Kaminari) %>
|
66
|
+
<%= paginate @localization_keys, :theme=>"lit" %>
|
67
|
+
<% end %>
|
68
|
+
|
69
|
+
|
70
|
+
<% content_for(:sidebar) do %>
|
71
|
+
<div class="well">
|
72
|
+
<%= form_tag '', :class=>"form-search", :method=>:get do |f| %>
|
73
|
+
<% if @search_options.has_key?(:key_prefix) %>
|
74
|
+
<%= hidden_field_tag :key_prefix, @search_options[:key_prefix] %>
|
75
|
+
<% end %>
|
76
|
+
<div class="input-group">
|
77
|
+
<%= text_field_tag :key, @search_options[:key], :class=>"form-control search-query" %>
|
78
|
+
<div class="input-group-btn">
|
79
|
+
<button type="submit" class="btn btn-default"><%= draw_icon 'search' %></button>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
<label class="checkbox">
|
83
|
+
<%= check_box_tag :include_completed, '1', @search_options[:include_completed].to_i==1 %>
|
84
|
+
<%= t('.is_completed', :default=>"Include completed") %>
|
85
|
+
</label>
|
86
|
+
<% end %>
|
87
|
+
<ul class="nav nav-pills nav-stacked">
|
88
|
+
<li class="<%= "active" if params[:action]=='index' %>">
|
89
|
+
<%= link_to lit.localization_keys_path do -%>
|
90
|
+
<%= draw_icon 'list' %>
|
91
|
+
all
|
92
|
+
<% end %>
|
93
|
+
</li>
|
94
|
+
<li class="<%= "active" if params[:action]=='starred' %>">
|
95
|
+
<%= link_to lit.starred_localization_keys_path do -%>
|
96
|
+
<%= draw_icon 'star' %>
|
97
|
+
starred
|
98
|
+
<% end %>
|
99
|
+
</li>
|
100
|
+
<li class="nav-header"><%= t(".order_by", :default => "Order by") %>:</li>
|
101
|
+
<% Lit::LocalizationKey.order_options.each do |order| %>
|
102
|
+
<li class="<%= "active" if order == @search_options[:order] %>">
|
103
|
+
<%= link_to url_for(@search_options.merge(:order => order)) do %>
|
104
|
+
<%= t("lit.order_options.#{order.gsub(" ", "_")}", :default => order.humanize) %>
|
105
|
+
<% end %>
|
106
|
+
</li>
|
107
|
+
<% end %>
|
108
|
+
<li class="nav-header">Narrow with prefix</li>
|
109
|
+
<% if @search_options[:key_prefix].present? %>
|
110
|
+
<li>
|
111
|
+
<%= link_to url_for(@search_options.merge(:key_prefix=>@parent_prefix.present? ? @parent_prefix : nil)), :title=>(@parent_prefix.present? ? @parent_prefix : 'show all') do %>
|
112
|
+
<%= draw_icon('chevron-left') %>
|
113
|
+
<%= @parent_prefix.present? ? @parent_prefix.split('.').last : 'show all' %>
|
114
|
+
<% end %>
|
115
|
+
</li>
|
116
|
+
<% end %>
|
117
|
+
<% @prefixes.each do |p| %>
|
118
|
+
<li class="key_prefix">
|
119
|
+
<%= link_to url_for(@search_options.merge(:key_prefix=>p)) do %>
|
120
|
+
<%= draw_icon('chevron-right') %>
|
121
|
+
<%= p.split('.').last %>
|
122
|
+
<% end %>
|
123
|
+
</li>
|
124
|
+
<% end %>
|
125
|
+
</ul>
|
126
|
+
</div>
|
127
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
$('tr.localization_key_row[data-id="<%= @localization_key.id %>"] a.star_icon').html("<%= ejs(draw_icon(@localization_key.is_starred? ? 'star' : 'star-o')) %>");
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%= form_for @localization, url: lit.localization_key_localization_path(@localization_key, @localization, format: :js), html: {remote: true} do |f| %>
|
2
|
+
<%- f.label :translated_value %>
|
3
|
+
<% if @localization.translated_value.is_a?(Array) %>
|
4
|
+
<ul style="list-style: none;">
|
5
|
+
<% @localization.translated_value.each do |l| %>
|
6
|
+
<li><%= text_field_tag 'localization[translated_value][]', l, class: 'form-control input-xlarge' %></li>
|
7
|
+
<% end %>
|
8
|
+
</ul>
|
9
|
+
<% else %>
|
10
|
+
<%= f.text_area :translated_value, size: '40x2', class: 'form-control input-xxlarge' %>
|
11
|
+
<% if allow_wysiwyg_editor?(@localization_key.localization_key) %>
|
12
|
+
<br />
|
13
|
+
<label>
|
14
|
+
<input type="checkbox" class="wysiwyg_switch" /> use wysiwyg editor
|
15
|
+
</label>
|
16
|
+
<br />
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<button class="btn btn-primary btn-sm" type="submit"><%= I18n.t('lit.common.update', default: "Update") %></button>
|
21
|
+
<button class="btn btn-default btn-sm cancel" type="reset"><%= I18n.t('lit.common.cancel', default: 'Cancel') %></button>
|
22
|
+
<% end %>
|
23
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<span class="pull-right"><%= draw_icon 'times', :class=>"close_versions" %></span>
|
2
|
+
<table class="table table-condensed">
|
3
|
+
<tr>
|
4
|
+
<th><%= t('lit.common.previous_versions') %></th>
|
5
|
+
<th width="25%"><%= t('lit.common.changed_at') %></th>
|
6
|
+
</tr>
|
7
|
+
<% @versions.each do |v| %>
|
8
|
+
<tr>
|
9
|
+
<td>
|
10
|
+
<%= render :partial=>"/lit/localization_keys/localization_row", formats: ['html'], :locals=>{:localization=>v.translated_value} %>
|
11
|
+
</td>
|
12
|
+
<td><%= I18n.l v.created_at, format: :long %></td>
|
13
|
+
</tr>
|
14
|
+
<% end %>
|
15
|
+
</table>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
var $row = $('td.localization_row[data-id="<%= @localization.id %>"]');
|
2
|
+
$row.data('editing', 1);
|
3
|
+
$row.html("<%= ejs render(partial: 'form', formats: ['html']) %>");
|
4
|
+
$row.find('textarea').focus();
|
5
|
+
<% if @localization.full_key.ends_with?('_html') -%>
|
6
|
+
$row.find('.wysiwyg_switch').click();
|
7
|
+
<% end %>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
var $row = $('td.localization_row[data-id="<%= @localization.id %>"]');
|
2
|
+
$row.data('editing', 0);
|
3
|
+
$row.html("<%= ejs render(:partial=>"/lit/localization_keys/localization_row", formats: ['html'], :locals=>{:localization=>@localization.translated_value }) %>");
|
4
|
+
$row.siblings().find('.show_prev_versions').removeClass('hidden');
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<%= form_for(@source, :class=>"form-horizontal") do |f| %>
|
2
|
+
<% if @source.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@source.errors.count, "error") %> prohibited this source from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @source.errors.full_messages.each do |msg| %>
|
8
|
+
<li><%= msg %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
<div class="control-group">
|
14
|
+
<%= f.label :identifier, :class=>"control-label" %>
|
15
|
+
<div class="controls">
|
16
|
+
<%= f.text_field :identifier, :class=>"form-control" %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<div class="control-group">
|
20
|
+
<%= f.label :url, :class=>"control-label" %>
|
21
|
+
<div class="controls">
|
22
|
+
<%= f.text_field :url, :placeholder=>"http://your_other_env.host/lit", :class=>"form-control" %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<div class="control-group">
|
26
|
+
<%= f.label :api_key, :class=>"control-label" %>
|
27
|
+
<div class="controls">
|
28
|
+
<%= f.text_field :api_key, :class=>"form-control" %>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="actions">
|
33
|
+
<%= f.submit t('lit.common.save', :default => "Save"), :class=>"btn btn-primary btn-sm" %>
|
34
|
+
</div>
|
35
|
+
<% end %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<h1>Synchronization sources</h1>
|
2
|
+
|
3
|
+
<table class="table">
|
4
|
+
<tr>
|
5
|
+
<th>Identifier</th>
|
6
|
+
<th>Last synchronization</th>
|
7
|
+
<th>Last change (remote)</th>
|
8
|
+
<th width="95px"></th>
|
9
|
+
</tr>
|
10
|
+
|
11
|
+
<% @sources.each do |source| %>
|
12
|
+
<tr>
|
13
|
+
<td><%= link_to source.identifier, lit.source_path(source) %></td>
|
14
|
+
<td><%= source.last_updated_at.to_s(:db) unless source.last_updated_at.nil? %></td>
|
15
|
+
<td><%= source.get_last_change %></td>
|
16
|
+
<td>
|
17
|
+
<%= link_to lit.source_incomming_localizations_path(source), :title=>t('lit.common.browse_incomming', :default=>"Browse incomming localizations") do %>
|
18
|
+
<%= draw_icon 'search' %>
|
19
|
+
<% end %>
|
20
|
+
<%= link_to lit.synchronize_source_path(source), :title=>t('lit.common.synchronize', :default=>"Synchronize") do %>
|
21
|
+
<%= draw_icon 'refresh' %>
|
22
|
+
<% end %>
|
23
|
+
<%= link_to lit.source_path(source), :title=>t('lit.common.show', :default=>"Show") do %>
|
24
|
+
<%= draw_icon 'zoom-in' %>
|
25
|
+
<% end %>
|
26
|
+
<%= link_to lit.edit_source_path(source), :title=>t('lit.common.edit', :default=>"Edit") do %>
|
27
|
+
<%= draw_icon 'pencil' %>
|
28
|
+
<% end %>
|
29
|
+
<%= link_to lit.touch_source_path(source), :title=>t('lit.common.touch', :default=>"Touch (update) last_updated_at"), :method => :put, :data => { :confirm => 'Are you sure?' } do %>
|
30
|
+
<%= draw_icon 'clock-o' %>
|
31
|
+
<% end %>
|
32
|
+
<%= link_to lit.source_path(source), :method => :delete, :data => { :confirm => 'Are you sure?' }, :title=>t('lit.common.delete', :default=>"Delete") do %>
|
33
|
+
<%= draw_icon 'trash-o' %>
|
34
|
+
<% end %>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<% end %>
|
38
|
+
</table>
|
39
|
+
|
40
|
+
<br />
|
41
|
+
|
42
|
+
<%= link_to 'New Source', new_source_path %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<strong>Indetifier:</strong>
|
4
|
+
<%= @source.identifier %>
|
5
|
+
<br/>
|
6
|
+
<strong>Url:</strong>
|
7
|
+
<%= @source.url %>
|
8
|
+
<br/>
|
9
|
+
<strong>API key:</strong>
|
10
|
+
<%= @source.api_key %>
|
11
|
+
<br/>
|
12
|
+
<strong>Last updated at:</strong>
|
13
|
+
<%= @source.last_updated_at.to_s(:db) unless @source.last_updated_at.nil? %>
|
14
|
+
<%= link_to '(touch!)', touch_source_path(@source), :method => :put, :data => { :confirm => 'Are you sure?' } %>
|
15
|
+
<br/>
|
16
|
+
|
17
|
+
|
18
|
+
<%= link_to 'Edit', edit_source_path(@source) %> |
|
19
|
+
<%= link_to 'Back', sources_path %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
Lit::Engine.routes.draw do
|
2
|
+
if Lit.api_enabled
|
3
|
+
namespace :api do
|
4
|
+
namespace :v1 do
|
5
|
+
get '/last_change' => 'localizations#last_change'
|
6
|
+
resources :locales, only: [:index]
|
7
|
+
resources :localization_keys, only: [:index]
|
8
|
+
resources :localizations, only: [:index] do
|
9
|
+
get 'last_change', on: :collection
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
resources :locales, only: [:index, :destroy] do
|
15
|
+
put :hide, on: :member
|
16
|
+
end
|
17
|
+
resources :localization_keys, only: [:index, :destroy] do
|
18
|
+
member do
|
19
|
+
get :star
|
20
|
+
end
|
21
|
+
collection do
|
22
|
+
get :starred
|
23
|
+
get :find_localization
|
24
|
+
end
|
25
|
+
resources :localizations, only: [:edit, :update, :show] do
|
26
|
+
member do
|
27
|
+
get :previous_versions
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
resources :sources do
|
32
|
+
member do
|
33
|
+
get :synchronize
|
34
|
+
get :sync_complete
|
35
|
+
put :touch
|
36
|
+
end
|
37
|
+
resources :incomming_localizations, only: [:index, :destroy] do
|
38
|
+
member do
|
39
|
+
get :accept
|
40
|
+
end
|
41
|
+
collection do
|
42
|
+
get :accept_all
|
43
|
+
post :reject_all
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
root to: 'dashboard#index'
|
49
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class LitCreateLitLocales < Rails::VERSION::MAJOR >= 5 ?
|
2
|
+
ActiveRecord::Migration[4.2] :
|
3
|
+
ActiveRecord::Migration
|
4
|
+
def up
|
5
|
+
return if table_exists?(:lit_locales)
|
6
|
+
create_table :lit_locales do |t|
|
7
|
+
t.string :locale
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def down
|
14
|
+
drop_table :lit_locales
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class LitCreateLitLocalizationKeys < Rails::VERSION::MAJOR >= 5 ?
|
2
|
+
ActiveRecord::Migration[4.2] :
|
3
|
+
ActiveRecord::Migration
|
4
|
+
def up
|
5
|
+
return if table_exists?(:lit_localization_keys)
|
6
|
+
create_table :lit_localization_keys do |t|
|
7
|
+
t.string :localization_key
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :lit_localization_keys, :localization_key, unique: true
|
12
|
+
end
|
13
|
+
|
14
|
+
def down
|
15
|
+
remove_index :lit_localization_keys, :localization_key
|
16
|
+
drop_table :lit_localization_keys
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class LitCreateLitLocalizations < Rails::VERSION::MAJOR >= 5 ?
|
2
|
+
ActiveRecord::Migration[4.2] :
|
3
|
+
ActiveRecord::Migration
|
4
|
+
def up
|
5
|
+
return if table_exists?(:lit_localizations)
|
6
|
+
create_table :lit_localizations do |t|
|
7
|
+
t.integer :locale_id
|
8
|
+
t.integer :localization_key_id
|
9
|
+
t.text :default_value
|
10
|
+
t.text :translated_value
|
11
|
+
t.boolean :is_changed, default: false
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
|
16
|
+
add_index :lit_localizations, :locale_id
|
17
|
+
add_index :lit_localizations, :localization_key_id
|
18
|
+
end
|
19
|
+
|
20
|
+
def down
|
21
|
+
remove_index :lit_localizations, :locale_id
|
22
|
+
remove_index :lit_localizations, :localization_key_id
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class LitAddIsCompletedAndIsStarredToLocalizationKeys < Rails::VERSION::MAJOR >= 5 ?
|
2
|
+
ActiveRecord::Migration[4.2] :
|
3
|
+
ActiveRecord::Migration
|
4
|
+
def up
|
5
|
+
unless column_exists?(:lit_localization_keys, :is_completed)
|
6
|
+
add_column :lit_localization_keys, :is_completed, :boolean, default: false
|
7
|
+
end
|
8
|
+
unless column_exists?(:lit_localization_keys, :is_starred)
|
9
|
+
add_column :lit_localization_keys, :is_starred, :boolean, default: false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def down
|
14
|
+
remove_column :lit_localization_keys, :is_completed
|
15
|
+
remove_column :lit_localization_keys, :is_starred
|
16
|
+
end
|
17
|
+
end
|