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
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 84f1f59bb68dc6218bd60503ffd68922efa30f46177cef3fc32f276c9b9c9161
|
4
|
+
data.tar.gz: c26cb0e32a0c8058592e9e127b99bd4064f5e13d6ae85610f2352adfa1d033a2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d15abb3e2a7845caa3f5dac5b672ffd2432dabef3867389203adebd8a3a330bfd75db543535d94a8b1b4e358d316de5b91e022331ed96d9632e39d7d1043ac71
|
7
|
+
data.tar.gz: 7f21f52b38beea422022e3bbbf92d7d29e1d5320472d6f6bf6bc49e79a7e7ea277313d94b074796786c525a5cf3a40288bc1e3c3355974b7a00aebbe8cd43ce3
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Prograils.com
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
# Lost in translation
|
2
|
+
### Rails i18n web interface
|
3
|
+
|
4
|
+
Translate your apps with pleasure (sort of...) and for free. It's simple i18n
|
5
|
+
web interface, build on top of twitter bootstrap, that one may find helpful in
|
6
|
+
translating app by non-technicals.
|
7
|
+
|
8
|
+
Highly inspired by Copycopter by thoughtbot.
|
9
|
+
|
10
|
+
![travis status](https://travis-ci.org/prograils/lit.svg)
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
1. Runs with your app - no need for external services
|
15
|
+
2. Support for array types, (ie. `date.abbr_day_names`)
|
16
|
+
3. Versioning translations - you can always check, how value did look like in past
|
17
|
+
4. Possibility to synchronize translations between environments or apps
|
18
|
+
5. Easy to install - works as an engine, comes with simple generator
|
19
|
+
6. You can always export all translations to plain old YAML file
|
20
|
+
7. Has build in wysiwyg editor ([jQuery TE](http://jqueryte.com/))
|
21
|
+
8. Translating apps directly in frontend (see bellow)
|
22
|
+
9. (On request) stores paths where translation keys were called
|
23
|
+
10. (On request) is able to show all translation keys used to render current page
|
24
|
+
|
25
|
+
### Screenshots
|
26
|
+
|
27
|
+
Check wiki: [Screenshots](https://github.com/prograils/lit/wiki/Screenshots)
|
28
|
+
|
29
|
+
### Installation
|
30
|
+
|
31
|
+
1. Add `lit` gem to your `Gemfile`
|
32
|
+
```ruby
|
33
|
+
gem 'lit'
|
34
|
+
```
|
35
|
+
|
36
|
+
For Ruby < 1.9 use `gem 'lit', '= 0.2.4'`, as next versions introduced new ruby hash syntax.
|
37
|
+
|
38
|
+
2. run `bundle install`
|
39
|
+
|
40
|
+
3. run installation generator `bundle exec rails g lit:install`
|
41
|
+
(for production/staging environment `redis` is suggested as key value engine. `hash` will not work in multi process environment)
|
42
|
+
|
43
|
+
4. Add `config.i18n.available_locales = [...]` to `application.rb` - it's required to precompile appropriate language flags in lit backend.
|
44
|
+
|
45
|
+
5. After doing above and restarting app, point your browser to `http://app/lit`
|
46
|
+
|
47
|
+
6. Profit!
|
48
|
+
|
49
|
+
|
50
|
+
You may want to take a look at generated initializer in `config/initializers/lit.rb` and change some default configuration options.
|
51
|
+
|
52
|
+
### So... again - what is it and how to use it?
|
53
|
+
*Lit* is Rails engine - it runs in it's own namespace, by default it's avaulable under `/lit`. It provides UI for managing translations of your app.
|
54
|
+
|
55
|
+
Once you call `I18n.t()` function from your views, *Lit* is asked whether it has or not proper value for it. If translation is present in database and is available for *Lit*, it's served back. If it does not exists, record is automatically created in database with initial value provided in `default` option key. If `default` key is not present, value `nil` is saved to database. When app is starting, *Lit* will preload all keys from your local `config/locale/*.yml` files - this is why app startup may take a while.
|
56
|
+
|
57
|
+
To optimize translation key lookup, *Lit* can use different cache engines. For production with many workers `redis` is suggested, for local development `hash` will be fine (`hash` is stored in memory, so if you have many workers and will update translation value in backend, only one worker will have proper translation in it's cache - db will be updated anyway).
|
58
|
+
|
59
|
+
Keys ending with `_html` have auto wysiwyg support.
|
60
|
+
|
61
|
+
You can also export translations using rake task
|
62
|
+
|
63
|
+
```bash
|
64
|
+
$ rake lit:export
|
65
|
+
```
|
66
|
+
|
67
|
+
You may also give it extra env variables to limit the export results.
|
68
|
+
|
69
|
+
```bash
|
70
|
+
$ LOCALES=en,de rake lit:export
|
71
|
+
```
|
72
|
+
|
73
|
+
|
74
|
+
### 0.2 -> 0.3 upgrade guide
|
75
|
+
|
76
|
+
1. Specify exact lit version in your Gemfile: `gem 'lit', '~> 0.3.0'`
|
77
|
+
2. Run `bundle update lit`
|
78
|
+
3. Add `config.i18n.available_locales` to your `application.rb` (see 3rd point from Installation info)
|
79
|
+
4. Add `config.i18n.enforce_available_locales = true` config to your `application.rb`
|
80
|
+
5. Compare your current `lit.rb` initializer with [template](https://github.com/prograils/lit/blob/master/lib/generators/lit/install/templates/initializer.rb).
|
81
|
+
|
82
|
+
### On-site live translations
|
83
|
+
|
84
|
+
1. Add `Lit::FrontendHelper` to your `ApplicationController`
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
helper Lit::FrontendHelper
|
88
|
+
```
|
89
|
+
|
90
|
+
2. In you layout file include lit assets
|
91
|
+
|
92
|
+
```erb
|
93
|
+
<% if admin_user_signed_in? %>
|
94
|
+
<%= lit_frontend_assets %>
|
95
|
+
<% end %>
|
96
|
+
```
|
97
|
+
|
98
|
+
3. You're good to go - now log in to lit (if required) and open your frontend in separate tab (to have session persisted). On the bottom-right of your page you should see "Enable / disable lit highlight" - after enabling it you'll be able to click and translate phrases directly in your frontend
|
99
|
+
|
100
|
+
4. Once enabled, all translations called via `t` helper function be rendered inside `<span />` tag, what may break your layout (ie if you're using translated values as button values or as placeholders, etc). To avoid that add `skip_lit: true` to `t()` call or use `I18n.t`.
|
101
|
+
|
102
|
+
5. This feature requires jQuery! (at least for now)
|
103
|
+
|
104
|
+
### Storing request info
|
105
|
+
|
106
|
+
1. Include `Lit::Concerns::RequestInfoStore` concern in your `ApplicationController`
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
include Lit::Concerns::RequestInfoStore
|
110
|
+
```
|
111
|
+
|
112
|
+
2. In lit initializer (`lit.rb`) set `store_request_info` config to true
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
Lit.store_request_info = true
|
116
|
+
```
|
117
|
+
|
118
|
+
3. Lit authorized user must be signed in for this feature to work!
|
119
|
+
|
120
|
+
### Showing called translations in frontend
|
121
|
+
|
122
|
+
|
123
|
+
1. Add `Lit::FrontendHelper` in your `ApplicationController`
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
include Lit::FrontendHelper
|
127
|
+
```
|
128
|
+
|
129
|
+
2. Include `Lit::Concerns::RequestKeysStore` concern in your `ApplicationController`
|
130
|
+
|
131
|
+
```ruby
|
132
|
+
include Lit::Concerns::RequestKeysStore
|
133
|
+
```
|
134
|
+
|
135
|
+
3. On the bottom of you layout file call `lit_translations_info` helper function
|
136
|
+
|
137
|
+
```erb
|
138
|
+
<%= lit_translations_info %>
|
139
|
+
```
|
140
|
+
|
141
|
+
4. From now on you'll be able to see all translation keys that were used to render current page. This feature works great with on-site live translations!
|
142
|
+
|
143
|
+
5. Lit authorized user must be signed in for this feature to work! This feature requires jQuery!
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
### ToDo
|
148
|
+
|
149
|
+
* ~~Versioning~~
|
150
|
+
* ~~API~~
|
151
|
+
* ~~Synchronization between environments~~
|
152
|
+
* Rewrite initializer
|
153
|
+
* ~~Rewrite exporter (which is now code from copycopter)~~
|
154
|
+
* ~~Support for array types (ie. `date.abbr_day_names`)~~
|
155
|
+
* ~~Generator~~
|
156
|
+
* ~~Support for wysiwyg~~
|
157
|
+
* ~~Better cache~~
|
158
|
+
* ~~Support for other key value providers (ie. Redis does not support Array types in easy way)~~ (not applicable, as array storage works now with redis).
|
159
|
+
* Integration with ActiveAdmin
|
160
|
+
* Support for Proc defaults (like in `I18n.t('not_exising_keys', default: lambda{|_, options| 'text'})` )
|
161
|
+
|
162
|
+
### Testing
|
163
|
+
|
164
|
+
For local testing [Appraisal](https://github.com/thoughtbot/appraisal) gem comes into play, run tests via: `bundle exec appraisal rails-4.2 rake test`.
|
165
|
+
|
166
|
+
Please remember to edit `test/dummy/config/database.yml` file
|
167
|
+
|
168
|
+
### License
|
169
|
+
|
170
|
+
Lit is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'rubygems'
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'rdoc/task'
|
11
|
+
rescue LoadError
|
12
|
+
require 'rdoc/rdoc'
|
13
|
+
require 'rake/rdoctask'
|
14
|
+
RDoc::Task = Rake::RDocTask
|
15
|
+
end
|
16
|
+
|
17
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
18
|
+
rdoc.rdoc_dir = 'rdoc'
|
19
|
+
rdoc.title = 'Lit'
|
20
|
+
rdoc.options << '--line-numbers'
|
21
|
+
rdoc.rdoc_files.include('README.rdoc')
|
22
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
23
|
+
end
|
24
|
+
|
25
|
+
APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
|
26
|
+
load 'rails/tasks/engine.rake'
|
27
|
+
|
28
|
+
Bundler::GemHelper.install_tasks
|
29
|
+
|
30
|
+
require 'rake/testtask'
|
31
|
+
|
32
|
+
Rake::TestTask.new(:test) do |t|
|
33
|
+
puts "Storage: #{ENV['LIT_STORAGE'] || 'redis'}"
|
34
|
+
t.libs << 'lib'
|
35
|
+
t.libs << 'test'
|
36
|
+
t.pattern = 'test/**/*_test.rb'
|
37
|
+
t.verbose = false
|
38
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|