refinerycms-i18n 5.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/main.yml +51 -0
- data/.github/workflows/release.yml +27 -0
- data/.gitignore +80 -0
- data/Gemfile +12 -11
- data/README.md +27 -5
- data/Rakefile +4 -8
- data/lib/generators/refinery/templates/config/initializers/refinery/i18n.rb.erb +2 -0
- data/lib/refinery/i18n/engine.rb +19 -10
- data/lib/refinery/i18n/override_routing_filter.rb +70 -0
- data/lib/refinery/i18n-filter.rb +11 -5
- data/lib/refinery/i18n.rb +2 -2
- data/lib/refinerycms/i18n.rb +2 -0
- data/refinerycms-i18n.gemspec +4 -9
- data/spec/controllers/refinery/pages_controller_spec.rb +2 -2
- data/spec/features/set_locale_spec.rb +2 -2
- data/spec/support/refinery/refinery_login.rb +3 -0
- data/translate-readme.md +21 -12
- metadata +16 -288
- checksums.yaml.gz.sig +0 -0
- data/.travis.yml +0 -16
- data/app/assets/images/refinery/icons/flags/ad.png +0 -0
- data/app/assets/images/refinery/icons/flags/ae.png +0 -0
- data/app/assets/images/refinery/icons/flags/af.png +0 -0
- data/app/assets/images/refinery/icons/flags/ag.png +0 -0
- data/app/assets/images/refinery/icons/flags/ai.png +0 -0
- data/app/assets/images/refinery/icons/flags/al.png +0 -0
- data/app/assets/images/refinery/icons/flags/am.png +0 -0
- data/app/assets/images/refinery/icons/flags/an.png +0 -0
- data/app/assets/images/refinery/icons/flags/ao.png +0 -0
- data/app/assets/images/refinery/icons/flags/ar.png +0 -0
- data/app/assets/images/refinery/icons/flags/as.png +0 -0
- data/app/assets/images/refinery/icons/flags/at.png +0 -0
- data/app/assets/images/refinery/icons/flags/au.png +0 -0
- data/app/assets/images/refinery/icons/flags/aw.png +0 -0
- data/app/assets/images/refinery/icons/flags/ax.png +0 -0
- data/app/assets/images/refinery/icons/flags/az.png +0 -0
- data/app/assets/images/refinery/icons/flags/ba.png +0 -0
- data/app/assets/images/refinery/icons/flags/bb.png +0 -0
- data/app/assets/images/refinery/icons/flags/bd.png +0 -0
- data/app/assets/images/refinery/icons/flags/be.png +0 -0
- data/app/assets/images/refinery/icons/flags/bf.png +0 -0
- data/app/assets/images/refinery/icons/flags/bg.png +0 -0
- data/app/assets/images/refinery/icons/flags/bh.png +0 -0
- data/app/assets/images/refinery/icons/flags/bi.png +0 -0
- data/app/assets/images/refinery/icons/flags/bj.png +0 -0
- data/app/assets/images/refinery/icons/flags/bm.png +0 -0
- data/app/assets/images/refinery/icons/flags/bn.png +0 -0
- data/app/assets/images/refinery/icons/flags/bo.png +0 -0
- data/app/assets/images/refinery/icons/flags/bs.png +0 -0
- data/app/assets/images/refinery/icons/flags/bt.png +0 -0
- data/app/assets/images/refinery/icons/flags/bv.png +0 -0
- data/app/assets/images/refinery/icons/flags/bw.png +0 -0
- data/app/assets/images/refinery/icons/flags/by.png +0 -0
- data/app/assets/images/refinery/icons/flags/bz.png +0 -0
- data/app/assets/images/refinery/icons/flags/ca.png +0 -0
- data/app/assets/images/refinery/icons/flags/cc.png +0 -0
- data/app/assets/images/refinery/icons/flags/cd.png +0 -0
- data/app/assets/images/refinery/icons/flags/cf.png +0 -0
- data/app/assets/images/refinery/icons/flags/cg.png +0 -0
- data/app/assets/images/refinery/icons/flags/ch.png +0 -0
- data/app/assets/images/refinery/icons/flags/ci.png +0 -0
- data/app/assets/images/refinery/icons/flags/ck.png +0 -0
- data/app/assets/images/refinery/icons/flags/cl.png +0 -0
- data/app/assets/images/refinery/icons/flags/cm.png +0 -0
- data/app/assets/images/refinery/icons/flags/cn.png +0 -0
- data/app/assets/images/refinery/icons/flags/co.png +0 -0
- data/app/assets/images/refinery/icons/flags/cr.png +0 -0
- data/app/assets/images/refinery/icons/flags/cs.png +0 -0
- data/app/assets/images/refinery/icons/flags/cu.png +0 -0
- data/app/assets/images/refinery/icons/flags/cv.png +0 -0
- data/app/assets/images/refinery/icons/flags/cx.png +0 -0
- data/app/assets/images/refinery/icons/flags/cy.png +0 -0
- data/app/assets/images/refinery/icons/flags/da.png +0 -0
- data/app/assets/images/refinery/icons/flags/de.png +0 -0
- data/app/assets/images/refinery/icons/flags/dj.png +0 -0
- data/app/assets/images/refinery/icons/flags/dm.png +0 -0
- data/app/assets/images/refinery/icons/flags/do.png +0 -0
- data/app/assets/images/refinery/icons/flags/dz.png +0 -0
- data/app/assets/images/refinery/icons/flags/ec.png +0 -0
- data/app/assets/images/refinery/icons/flags/eg.png +0 -0
- data/app/assets/images/refinery/icons/flags/eh.png +0 -0
- data/app/assets/images/refinery/icons/flags/el.png +0 -0
- data/app/assets/images/refinery/icons/flags/en.png +0 -0
- data/app/assets/images/refinery/icons/flags/england.png +0 -0
- data/app/assets/images/refinery/icons/flags/er.png +0 -0
- data/app/assets/images/refinery/icons/flags/es.png +0 -0
- data/app/assets/images/refinery/icons/flags/et.png +0 -0
- data/app/assets/images/refinery/icons/flags/europeanunion.png +0 -0
- data/app/assets/images/refinery/icons/flags/fam.png +0 -0
- data/app/assets/images/refinery/icons/flags/fi.png +0 -0
- data/app/assets/images/refinery/icons/flags/fj.png +0 -0
- data/app/assets/images/refinery/icons/flags/fk.png +0 -0
- data/app/assets/images/refinery/icons/flags/fm.png +0 -0
- data/app/assets/images/refinery/icons/flags/fo.png +0 -0
- data/app/assets/images/refinery/icons/flags/fr.png +0 -0
- data/app/assets/images/refinery/icons/flags/ga.png +0 -0
- data/app/assets/images/refinery/icons/flags/gd.png +0 -0
- data/app/assets/images/refinery/icons/flags/ge.png +0 -0
- data/app/assets/images/refinery/icons/flags/gf.png +0 -0
- data/app/assets/images/refinery/icons/flags/gh.png +0 -0
- data/app/assets/images/refinery/icons/flags/gi.png +0 -0
- data/app/assets/images/refinery/icons/flags/gl.png +0 -0
- data/app/assets/images/refinery/icons/flags/gm.png +0 -0
- data/app/assets/images/refinery/icons/flags/gn.png +0 -0
- data/app/assets/images/refinery/icons/flags/gp.png +0 -0
- data/app/assets/images/refinery/icons/flags/gq.png +0 -0
- data/app/assets/images/refinery/icons/flags/gr.png +0 -0
- data/app/assets/images/refinery/icons/flags/gs.png +0 -0
- data/app/assets/images/refinery/icons/flags/gt.png +0 -0
- data/app/assets/images/refinery/icons/flags/gu.png +0 -0
- data/app/assets/images/refinery/icons/flags/gw.png +0 -0
- data/app/assets/images/refinery/icons/flags/gy.png +0 -0
- data/app/assets/images/refinery/icons/flags/hk.png +0 -0
- data/app/assets/images/refinery/icons/flags/hm.png +0 -0
- data/app/assets/images/refinery/icons/flags/hn.png +0 -0
- data/app/assets/images/refinery/icons/flags/hr.png +0 -0
- data/app/assets/images/refinery/icons/flags/ht.png +0 -0
- data/app/assets/images/refinery/icons/flags/hu.png +0 -0
- data/app/assets/images/refinery/icons/flags/id.png +0 -0
- data/app/assets/images/refinery/icons/flags/ie.png +0 -0
- data/app/assets/images/refinery/icons/flags/il.png +0 -0
- data/app/assets/images/refinery/icons/flags/in.png +0 -0
- data/app/assets/images/refinery/icons/flags/io.png +0 -0
- data/app/assets/images/refinery/icons/flags/iq.png +0 -0
- data/app/assets/images/refinery/icons/flags/ir.png +0 -0
- data/app/assets/images/refinery/icons/flags/is.png +0 -0
- data/app/assets/images/refinery/icons/flags/it.png +0 -0
- data/app/assets/images/refinery/icons/flags/ja.png +0 -0
- data/app/assets/images/refinery/icons/flags/jm.png +0 -0
- data/app/assets/images/refinery/icons/flags/jo.png +0 -0
- data/app/assets/images/refinery/icons/flags/ke.png +0 -0
- data/app/assets/images/refinery/icons/flags/kg.png +0 -0
- data/app/assets/images/refinery/icons/flags/kh.png +0 -0
- data/app/assets/images/refinery/icons/flags/ki.png +0 -0
- data/app/assets/images/refinery/icons/flags/km.png +0 -0
- data/app/assets/images/refinery/icons/flags/kn.png +0 -0
- data/app/assets/images/refinery/icons/flags/ko.png +0 -0
- data/app/assets/images/refinery/icons/flags/kp.png +0 -0
- data/app/assets/images/refinery/icons/flags/kr.png +0 -0
- data/app/assets/images/refinery/icons/flags/kw.png +0 -0
- data/app/assets/images/refinery/icons/flags/ky.png +0 -0
- data/app/assets/images/refinery/icons/flags/kz.png +0 -0
- data/app/assets/images/refinery/icons/flags/la.png +0 -0
- data/app/assets/images/refinery/icons/flags/lb.png +0 -0
- data/app/assets/images/refinery/icons/flags/lc.png +0 -0
- data/app/assets/images/refinery/icons/flags/li.png +0 -0
- data/app/assets/images/refinery/icons/flags/lk.png +0 -0
- data/app/assets/images/refinery/icons/flags/lr.png +0 -0
- data/app/assets/images/refinery/icons/flags/ls.png +0 -0
- data/app/assets/images/refinery/icons/flags/lt.png +0 -0
- data/app/assets/images/refinery/icons/flags/lu.png +0 -0
- data/app/assets/images/refinery/icons/flags/lv.png +0 -0
- data/app/assets/images/refinery/icons/flags/ly.png +0 -0
- data/app/assets/images/refinery/icons/flags/ma.png +0 -0
- data/app/assets/images/refinery/icons/flags/mc.png +0 -0
- data/app/assets/images/refinery/icons/flags/md.png +0 -0
- data/app/assets/images/refinery/icons/flags/me.png +0 -0
- data/app/assets/images/refinery/icons/flags/mg.png +0 -0
- data/app/assets/images/refinery/icons/flags/mh.png +0 -0
- data/app/assets/images/refinery/icons/flags/mk.png +0 -0
- data/app/assets/images/refinery/icons/flags/ml.png +0 -0
- data/app/assets/images/refinery/icons/flags/mm.png +0 -0
- data/app/assets/images/refinery/icons/flags/mn.png +0 -0
- data/app/assets/images/refinery/icons/flags/mo.png +0 -0
- data/app/assets/images/refinery/icons/flags/mp.png +0 -0
- data/app/assets/images/refinery/icons/flags/mq.png +0 -0
- data/app/assets/images/refinery/icons/flags/mr.png +0 -0
- data/app/assets/images/refinery/icons/flags/ms.png +0 -0
- data/app/assets/images/refinery/icons/flags/mt.png +0 -0
- data/app/assets/images/refinery/icons/flags/mu.png +0 -0
- data/app/assets/images/refinery/icons/flags/mv.png +0 -0
- data/app/assets/images/refinery/icons/flags/mw.png +0 -0
- data/app/assets/images/refinery/icons/flags/mx.png +0 -0
- data/app/assets/images/refinery/icons/flags/my.png +0 -0
- data/app/assets/images/refinery/icons/flags/mz.png +0 -0
- data/app/assets/images/refinery/icons/flags/na.png +0 -0
- data/app/assets/images/refinery/icons/flags/nb.png +0 -0
- data/app/assets/images/refinery/icons/flags/nc.png +0 -0
- data/app/assets/images/refinery/icons/flags/ne.png +0 -0
- data/app/assets/images/refinery/icons/flags/nf.png +0 -0
- data/app/assets/images/refinery/icons/flags/ng.png +0 -0
- data/app/assets/images/refinery/icons/flags/ni.png +0 -0
- data/app/assets/images/refinery/icons/flags/nl.png +0 -0
- data/app/assets/images/refinery/icons/flags/nn.png +0 -0
- data/app/assets/images/refinery/icons/flags/np.png +0 -0
- data/app/assets/images/refinery/icons/flags/nr.png +0 -0
- data/app/assets/images/refinery/icons/flags/nu.png +0 -0
- data/app/assets/images/refinery/icons/flags/nz.png +0 -0
- data/app/assets/images/refinery/icons/flags/om.png +0 -0
- data/app/assets/images/refinery/icons/flags/pa.png +0 -0
- data/app/assets/images/refinery/icons/flags/pe.png +0 -0
- data/app/assets/images/refinery/icons/flags/pf.png +0 -0
- data/app/assets/images/refinery/icons/flags/pg.png +0 -0
- data/app/assets/images/refinery/icons/flags/ph.png +0 -0
- data/app/assets/images/refinery/icons/flags/pk.png +0 -0
- data/app/assets/images/refinery/icons/flags/pl.png +0 -0
- data/app/assets/images/refinery/icons/flags/pm.png +0 -0
- data/app/assets/images/refinery/icons/flags/pn.png +0 -0
- data/app/assets/images/refinery/icons/flags/pr.png +0 -0
- data/app/assets/images/refinery/icons/flags/ps.png +0 -0
- data/app/assets/images/refinery/icons/flags/pt-BR.png +0 -0
- data/app/assets/images/refinery/icons/flags/pt.png +0 -0
- data/app/assets/images/refinery/icons/flags/pw.png +0 -0
- data/app/assets/images/refinery/icons/flags/py.png +0 -0
- data/app/assets/images/refinery/icons/flags/qa.png +0 -0
- data/app/assets/images/refinery/icons/flags/re.png +0 -0
- data/app/assets/images/refinery/icons/flags/ro.png +0 -0
- data/app/assets/images/refinery/icons/flags/rs.png +0 -0
- data/app/assets/images/refinery/icons/flags/ru.png +0 -0
- data/app/assets/images/refinery/icons/flags/rw.png +0 -0
- data/app/assets/images/refinery/icons/flags/sa.png +0 -0
- data/app/assets/images/refinery/icons/flags/sb.png +0 -0
- data/app/assets/images/refinery/icons/flags/sc.png +0 -0
- data/app/assets/images/refinery/icons/flags/scotland.png +0 -0
- data/app/assets/images/refinery/icons/flags/sd.png +0 -0
- data/app/assets/images/refinery/icons/flags/sg.png +0 -0
- data/app/assets/images/refinery/icons/flags/sh.png +0 -0
- data/app/assets/images/refinery/icons/flags/si.png +0 -0
- data/app/assets/images/refinery/icons/flags/sj.png +0 -0
- data/app/assets/images/refinery/icons/flags/sk.png +0 -0
- data/app/assets/images/refinery/icons/flags/sl.png +0 -0
- data/app/assets/images/refinery/icons/flags/sm.png +0 -0
- data/app/assets/images/refinery/icons/flags/sn.png +0 -0
- data/app/assets/images/refinery/icons/flags/so.png +0 -0
- data/app/assets/images/refinery/icons/flags/sr.png +0 -0
- data/app/assets/images/refinery/icons/flags/st.png +0 -0
- data/app/assets/images/refinery/icons/flags/sv.png +0 -0
- data/app/assets/images/refinery/icons/flags/sy.png +0 -0
- data/app/assets/images/refinery/icons/flags/sz.png +0 -0
- data/app/assets/images/refinery/icons/flags/tc.png +0 -0
- data/app/assets/images/refinery/icons/flags/td.png +0 -0
- data/app/assets/images/refinery/icons/flags/tf.png +0 -0
- data/app/assets/images/refinery/icons/flags/tg.png +0 -0
- data/app/assets/images/refinery/icons/flags/th.png +0 -0
- data/app/assets/images/refinery/icons/flags/tj.png +0 -0
- data/app/assets/images/refinery/icons/flags/tk.png +0 -0
- data/app/assets/images/refinery/icons/flags/tl.png +0 -0
- data/app/assets/images/refinery/icons/flags/tm.png +0 -0
- data/app/assets/images/refinery/icons/flags/tn.png +0 -0
- data/app/assets/images/refinery/icons/flags/to.png +0 -0
- data/app/assets/images/refinery/icons/flags/tr.png +0 -0
- data/app/assets/images/refinery/icons/flags/tt.png +0 -0
- data/app/assets/images/refinery/icons/flags/tv.png +0 -0
- data/app/assets/images/refinery/icons/flags/tw.png +0 -0
- data/app/assets/images/refinery/icons/flags/tz.png +0 -0
- data/app/assets/images/refinery/icons/flags/ug.png +0 -0
- data/app/assets/images/refinery/icons/flags/uk.png +0 -0
- data/app/assets/images/refinery/icons/flags/um.png +0 -0
- data/app/assets/images/refinery/icons/flags/us.png +0 -0
- data/app/assets/images/refinery/icons/flags/uy.png +0 -0
- data/app/assets/images/refinery/icons/flags/uz.png +0 -0
- data/app/assets/images/refinery/icons/flags/va.png +0 -0
- data/app/assets/images/refinery/icons/flags/vc.png +0 -0
- data/app/assets/images/refinery/icons/flags/ve.png +0 -0
- data/app/assets/images/refinery/icons/flags/vg.png +0 -0
- data/app/assets/images/refinery/icons/flags/vi.png +0 -0
- data/app/assets/images/refinery/icons/flags/vn.png +0 -0
- data/app/assets/images/refinery/icons/flags/vu.png +0 -0
- data/app/assets/images/refinery/icons/flags/wales.png +0 -0
- data/app/assets/images/refinery/icons/flags/wf.png +0 -0
- data/app/assets/images/refinery/icons/flags/ws.png +0 -0
- data/app/assets/images/refinery/icons/flags/ye.png +0 -0
- data/app/assets/images/refinery/icons/flags/yt.png +0 -0
- data/app/assets/images/refinery/icons/flags/za.png +0 -0
- data/app/assets/images/refinery/icons/flags/zh-CN.png +0 -0
- data/app/assets/images/refinery/icons/flags/zh-TW.png +0 -0
- data/app/assets/images/refinery/icons/flags/zm.png +0 -0
- data/app/assets/images/refinery/icons/flags/zw.png +0 -0
- data/lib/refinerycms-i18n.rb +0 -1
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c0bbc56d3e341aa95e97b24ff111f12282ea9041ced7d401b55af4ca14b832b
|
|
4
|
+
data.tar.gz: dd8ce0cc066a9dff7657767d1361fefb1ddea8ee1271ebbd423a2943618df98a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ddbc4fe467848875424df48aefcf1ab8ad4da8bb5174462d5d2c7288eae42c550101ea81d79312dd1538990d34b984aa2af07e0f687a88aad4bcdfddffc641b4
|
|
7
|
+
data.tar.gz: e9240d6d049472b194784d545fcc986bc62c447660da89d5b848e0baccae9e5b77059e1e12ca394531c052c0e9a53b8cfc048622dde9fcfccc3774af5248ec8b
|
data/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: [parndt, bricesanchez]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
database: [ sqlite3, mysql, postgresql ]
|
|
14
|
+
ruby: [ 4.0, 3.4, 3.3, 3.2, 3.1 ]
|
|
15
|
+
fail-fast: false
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
env:
|
|
19
|
+
CI: true
|
|
20
|
+
DB: ${{ matrix.database }}
|
|
21
|
+
MYSQL_PASSWORD: root
|
|
22
|
+
PGHOST: localhost
|
|
23
|
+
PGPASSWORD: runner
|
|
24
|
+
PGUSER: runner
|
|
25
|
+
RAILS_ENV: test
|
|
26
|
+
RETRY_COUNT: 3
|
|
27
|
+
|
|
28
|
+
name: ${{ matrix.ruby }} ${{ matrix.database }}
|
|
29
|
+
steps:
|
|
30
|
+
- run: sudo apt-get update && sudo apt-get install libsqlite3-dev -y
|
|
31
|
+
- uses: actions/checkout@v6
|
|
32
|
+
- uses: ruby/setup-ruby@v1
|
|
33
|
+
with:
|
|
34
|
+
bundler-cache: true
|
|
35
|
+
ruby-version: ${{ matrix.ruby }}
|
|
36
|
+
|
|
37
|
+
- name: "Set up MySQL using VM's server"
|
|
38
|
+
if: ${{ env.DB == 'mysql' }}
|
|
39
|
+
run: |
|
|
40
|
+
sudo apt-get install libmysqlclient-dev -y
|
|
41
|
+
sudo systemctl start mysql.service
|
|
42
|
+
|
|
43
|
+
- name: "Set up PostgreSQL using VM's server"
|
|
44
|
+
if: ${{ env.DB == 'postgresql' }}
|
|
45
|
+
run: |
|
|
46
|
+
sudo apt-get install libpq-dev -y
|
|
47
|
+
sudo systemctl start postgresql.service
|
|
48
|
+
sudo -u postgres psql -c "CREATE USER runner WITH SUPERUSER PASSWORD 'runner'"
|
|
49
|
+
|
|
50
|
+
- run: bin/rake refinery:testing:dummy_app
|
|
51
|
+
- run: bin/rspec spec
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Release Gem to rubygems.org
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
push:
|
|
10
|
+
if: github.repository == 'refinery/refinerycms-i18n'
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
id-token: write
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
# Set up
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
|
+
- name: Set up Ruby
|
|
21
|
+
uses: ruby/setup-ruby@v1
|
|
22
|
+
with:
|
|
23
|
+
bundler-cache: true
|
|
24
|
+
ruby-version: ruby
|
|
25
|
+
|
|
26
|
+
# Release
|
|
27
|
+
- uses: rubygems/release-gem@v1
|
data/.gitignore
CHANGED
|
@@ -87,3 +87,83 @@ spec/dummy
|
|
|
87
87
|
|
|
88
88
|
# Local Gemfile for developing without sharing dependencies
|
|
89
89
|
.gemfile
|
|
90
|
+
# Rails
|
|
91
|
+
.bundle
|
|
92
|
+
db/*.sqlite3
|
|
93
|
+
db/*.sqlite3-journal
|
|
94
|
+
*.log
|
|
95
|
+
tmp
|
|
96
|
+
tmp/**/*
|
|
97
|
+
|
|
98
|
+
# Documentation
|
|
99
|
+
doc/api
|
|
100
|
+
doc/app
|
|
101
|
+
.yardoc
|
|
102
|
+
.yardopts
|
|
103
|
+
coverage
|
|
104
|
+
|
|
105
|
+
# Public Uploads
|
|
106
|
+
public/system/*
|
|
107
|
+
public/themes/*
|
|
108
|
+
|
|
109
|
+
# Public Cache
|
|
110
|
+
public/javascripts/cache
|
|
111
|
+
public/stylesheets/cache
|
|
112
|
+
public/refinery/*
|
|
113
|
+
|
|
114
|
+
# Vendor Cache
|
|
115
|
+
vendor/cache
|
|
116
|
+
|
|
117
|
+
# Acts as Indexed
|
|
118
|
+
index/**/*
|
|
119
|
+
|
|
120
|
+
# Refinery Specific
|
|
121
|
+
*.tmproj
|
|
122
|
+
*.autobackupbyrefinery.*
|
|
123
|
+
refinerycms-*.gem
|
|
124
|
+
|
|
125
|
+
# Mac
|
|
126
|
+
.DS_Store
|
|
127
|
+
|
|
128
|
+
# Windows
|
|
129
|
+
Thumbs.db
|
|
130
|
+
|
|
131
|
+
# NetBeans
|
|
132
|
+
nbproject
|
|
133
|
+
|
|
134
|
+
# Eclipse
|
|
135
|
+
.project
|
|
136
|
+
|
|
137
|
+
# Redcar
|
|
138
|
+
.redcar
|
|
139
|
+
|
|
140
|
+
# Rubinius
|
|
141
|
+
*.rbc
|
|
142
|
+
|
|
143
|
+
# Vim
|
|
144
|
+
*.swp
|
|
145
|
+
*.swo
|
|
146
|
+
|
|
147
|
+
# RubyMine
|
|
148
|
+
.idea
|
|
149
|
+
|
|
150
|
+
# E-texteditor
|
|
151
|
+
.eprj
|
|
152
|
+
|
|
153
|
+
# Backup
|
|
154
|
+
*~
|
|
155
|
+
|
|
156
|
+
# Capybara Bug
|
|
157
|
+
capybara-*html
|
|
158
|
+
|
|
159
|
+
# sass
|
|
160
|
+
.sass-cache
|
|
161
|
+
.sass-cache/*
|
|
162
|
+
|
|
163
|
+
#rvm
|
|
164
|
+
.rvmrc
|
|
165
|
+
.rvmrc.*
|
|
166
|
+
|
|
167
|
+
# vendor/extensions dummy applications.
|
|
168
|
+
vendor/extensions/**/spec/dummy
|
|
169
|
+
|
data/Gemfile
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
source "https://rubygems.org"
|
|
2
|
-
|
|
3
2
|
gemspec
|
|
4
|
-
|
|
5
|
-
git "https://github.com/
|
|
3
|
+
#
|
|
4
|
+
git "https://github.com/anitagraham/refinerycms", branch: "ruby3" do
|
|
6
5
|
gem "refinerycms"
|
|
7
6
|
|
|
8
7
|
group :test do
|
|
@@ -14,24 +13,26 @@ group :development, :test do
|
|
|
14
13
|
gem "listen"
|
|
15
14
|
end
|
|
16
15
|
|
|
16
|
+
gem 'routing-filter', git: 'https://github.com/svenfuchs/routing-filter', branch: 'master'
|
|
17
|
+
|
|
17
18
|
# Database Configuration
|
|
18
19
|
unless ENV["TRAVIS"]
|
|
19
|
-
gem "activerecord-jdbcsqlite3-adapter", :
|
|
20
|
-
gem "sqlite3", :
|
|
20
|
+
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
|
21
|
+
gem "sqlite3", platform: :ruby
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
if !ENV["TRAVIS"] || ENV["DB"] == "mysql"
|
|
24
|
-
gem "activerecord-jdbcmysql-adapter", :
|
|
25
|
-
gem "jdbc-mysql", "= 5.1.13", :
|
|
26
|
-
gem 'mysql2', '~> 0.
|
|
25
|
+
gem "activerecord-jdbcmysql-adapter", platform: :jruby
|
|
26
|
+
gem "jdbc-mysql", "= 5.1.13", platform: :jruby
|
|
27
|
+
gem 'mysql2', '~> 0.5.3', platform: :ruby
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
if !ENV["TRAVIS"] || ENV["DB"] == "postgresql"
|
|
30
|
-
gem "activerecord-jdbcpostgresql-adapter", :
|
|
31
|
-
gem "pg", :
|
|
31
|
+
gem "activerecord-jdbcpostgresql-adapter", platform: :jruby
|
|
32
|
+
gem "pg", platform: :ruby
|
|
32
33
|
end
|
|
33
34
|
|
|
34
|
-
gem "jruby-openssl", :
|
|
35
|
+
gem "jruby-openssl", platform: :jruby
|
|
35
36
|
|
|
36
37
|
# Refinery/rails should pull in the proper versions of these
|
|
37
38
|
group :assets do
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Refinery CMS I18n
|
|
1
|
+
# Refinery CMS I18n
|
|
2
2
|
|
|
3
3
|
I18n logic extracted from Refinery CMS, for Refinery CMS.
|
|
4
4
|
|
|
@@ -10,15 +10,37 @@ rails g refinery:i18n
|
|
|
10
10
|
|
|
11
11
|
```ruby
|
|
12
12
|
Refinery::I18n.configure do |config|
|
|
13
|
-
|
|
13
|
+
config.default_locale = :en
|
|
14
14
|
|
|
15
15
|
# config.current_locale = :en
|
|
16
16
|
|
|
17
17
|
# config.default_frontend_locale = :en
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
config.frontend_locales = [:en, :ar]
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
config.locales = { en: "English", ar: "Arabic" }
|
|
22
|
+
# { nl: "Nederlands",
|
|
23
|
+
# pt: "Português",
|
|
24
|
+
# "pt-BR": "Português brasileiro",
|
|
25
|
+
# da: "Dansk",
|
|
26
|
+
# nb: "Norsk Bokmål",
|
|
27
|
+
# sl: "Slovenian",
|
|
28
|
+
# es: "Español",
|
|
29
|
+
# it: "Italiano",
|
|
30
|
+
# de: "Deutsch",
|
|
31
|
+
# lv: "Latviski",
|
|
32
|
+
# ru: "Русский",
|
|
33
|
+
# sv: "Svenska",
|
|
34
|
+
# pl: "Polski",
|
|
35
|
+
# "zh-CN": "简体中文",
|
|
36
|
+
# "zh-TW": "繁體中文",
|
|
37
|
+
# el: "Ελληνικά",
|
|
38
|
+
# rs: "Srpski",
|
|
39
|
+
# cs: "Česky",
|
|
40
|
+
# sk: "Slovenský",
|
|
41
|
+
# ja: "日本語",
|
|
42
|
+
# bg: "Български",
|
|
43
|
+
# hu: "Hungarian",
|
|
44
|
+
# uk: "Українська" }
|
|
23
45
|
end
|
|
24
46
|
```
|
data/Rakefile
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env rake
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
6
|
-
end
|
|
2
|
+
require "bundler/gem_helper"
|
|
3
|
+
|
|
4
|
+
Bundler::GemHelper.install_tasks(name: "refinerycms-i18n")
|
|
7
5
|
|
|
8
6
|
ENGINE_PATH = File.dirname(__FILE__)
|
|
9
7
|
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
|
10
8
|
|
|
11
|
-
if File.
|
|
12
|
-
load 'rails/tasks/engine.rake'
|
|
13
|
-
end
|
|
9
|
+
load 'rails/tasks/engine.rake' if File.exist?(APP_RAKEFILE)
|
|
14
10
|
|
|
15
11
|
require "refinerycms-testing"
|
|
16
12
|
Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
|
|
@@ -10,4 +10,6 @@ Refinery::I18n.configure do |config|
|
|
|
10
10
|
# config.frontend_locales = <%= Refinery::I18n.config.frontend_locales.inspect %>
|
|
11
11
|
|
|
12
12
|
# config.locales = <%= Refinery::I18n.config.locales.inspect %>
|
|
13
|
+
|
|
14
|
+
# config.url_filter_enabled = <%= Refinery::I18n.url_filter_enabled.inspect %>
|
|
13
15
|
end
|
data/lib/refinery/i18n/engine.rb
CHANGED
|
@@ -18,38 +18,45 @@ module Refinery
|
|
|
18
18
|
config.to_prepare do
|
|
19
19
|
::ApplicationController.module_eval do
|
|
20
20
|
def default_url_options
|
|
21
|
-
super.reverse_merge
|
|
21
|
+
super.reverse_merge({ locale: ::I18n.locale })
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def find_or_set_locale
|
|
25
|
-
|
|
25
|
+
locale = params[:locale]&.to_sym
|
|
26
|
+
::I18n.locale = ::Refinery::I18n.default_frontend_locale
|
|
26
27
|
|
|
27
|
-
if
|
|
28
|
-
::I18n.locale = locale
|
|
29
|
-
|
|
30
|
-
::I18n.locale = ::Refinery::I18n.default_frontend_locale
|
|
28
|
+
if locale.nil? || valid_locale?(locale) || locale == ::Refinery::I18n.default_frontend_locale
|
|
29
|
+
::I18n.locale = locale || ::Refinery::I18n.default_frontend_locale
|
|
30
|
+
else
|
|
31
31
|
redirect_to(params.permit(:locale).merge(locale: ::I18n.locale),
|
|
32
32
|
notice: "The locale '#{locale}' is not supported.") and return
|
|
33
|
-
else
|
|
34
|
-
::I18n.locale = ::Refinery::I18n.default_frontend_locale
|
|
35
33
|
end
|
|
36
34
|
Mobility.locale = ::I18n.locale
|
|
37
35
|
end
|
|
38
36
|
|
|
37
|
+
def valid_locale?(locale)
|
|
38
|
+
locale && ::Refinery::I18n.locales.keys.include?(locale)
|
|
39
|
+
end
|
|
40
|
+
|
|
39
41
|
prepend_before_action :find_or_set_locale
|
|
40
42
|
protected :default_url_options, :find_or_set_locale
|
|
41
43
|
end
|
|
42
44
|
|
|
43
45
|
::Refinery::AdminController.class_eval do
|
|
44
46
|
def find_or_set_locale
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
locale = params[:set_locale]&.to_sym
|
|
48
|
+
if valid_locale?(locale)
|
|
49
|
+
::Refinery::I18n.current_locale = locale
|
|
47
50
|
redirect_back_or_default(refinery.admin_root_path) and return
|
|
48
51
|
else
|
|
49
52
|
::I18n.locale = ::Refinery::I18n.current_locale
|
|
50
53
|
end
|
|
51
54
|
end
|
|
52
55
|
|
|
56
|
+
def valid_locale?(locale)
|
|
57
|
+
locale && ::Refinery::I18n.locales.keys.include?(locale)
|
|
58
|
+
end
|
|
59
|
+
|
|
53
60
|
def globalize!
|
|
54
61
|
if ::Refinery::I18n.frontend_locales.any?
|
|
55
62
|
if params[:switch_locale]
|
|
@@ -61,9 +68,11 @@ module Refinery
|
|
|
61
68
|
end
|
|
62
69
|
end
|
|
63
70
|
end
|
|
71
|
+
|
|
64
72
|
# globalize! should be prepended first so that it runs after find_or_set_locale
|
|
65
73
|
prepend_before_action :globalize!, :find_or_set_locale
|
|
66
74
|
protected :globalize!, :find_or_set_locale
|
|
75
|
+
private :valid_locale?
|
|
67
76
|
end
|
|
68
77
|
end
|
|
69
78
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
module RoutingFilterOverrideShared
|
|
2
|
+
private
|
|
3
|
+
|
|
4
|
+
def apply_routing_filters(path, env)
|
|
5
|
+
filter_parameters = {}
|
|
6
|
+
original_path = path.dup
|
|
7
|
+
|
|
8
|
+
@routes.filters.run(:around_recognize, path, env) do
|
|
9
|
+
filter_parameters
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
[path, original_path, filter_parameters]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
if Rails::VERSION::MAJOR == 8 && Rails::VERSION::MINOR >= 1
|
|
17
|
+
# from: https://github.com/svenfuchs/routing-filter/pull/87
|
|
18
|
+
# Removing the (existing) broken find_routes override from the routing-filter gem first
|
|
19
|
+
if defined?(ActionDispatchJourneyRouterWithFiltering) &&
|
|
20
|
+
ActionDispatchJourneyRouterWithFiltering.method_defined?(:find_routes)
|
|
21
|
+
ActionDispatchJourneyRouterWithFiltering.remove_method(:find_routes)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Rails 8.1+ uses recognize method instead of find_routes
|
|
25
|
+
module CustomOverridesActionDispatchJourneyRouterRails8
|
|
26
|
+
include RoutingFilterOverrideShared
|
|
27
|
+
|
|
28
|
+
def recognize(req, &block)
|
|
29
|
+
path, original_path, filter_parameters = apply_routing_filters(req.path_info, req.env)
|
|
30
|
+
req.path_info = path
|
|
31
|
+
|
|
32
|
+
##### OVERRIDE STARTS #####
|
|
33
|
+
super(req) do |route, parameters|
|
|
34
|
+
parameters.merge!(filter_parameters)
|
|
35
|
+
req.path_info = original_path
|
|
36
|
+
yield route, parameters
|
|
37
|
+
end.tap { req.path_info = original_path }
|
|
38
|
+
##### OVERRIDE ENDS #####
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
ActionDispatch::Journey::Router.prepend(CustomOverridesActionDispatchJourneyRouterRails8)
|
|
43
|
+
elsif Rails::VERSION::MAJOR == 8 || (Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR >= 1)
|
|
44
|
+
# from: https://github.com/svenfuchs/routing-filter/pull/87
|
|
45
|
+
# Removing the (existing) broken find_routes override from the routing-filter gem first
|
|
46
|
+
if defined?(ActionDispatchJourneyRouterWithFiltering) &&
|
|
47
|
+
ActionDispatchJourneyRouterWithFiltering.method_defined?(:find_routes)
|
|
48
|
+
ActionDispatchJourneyRouterWithFiltering.remove_method(:find_routes)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Rails < 8.1 uses find_routes method
|
|
52
|
+
module CustomOverridesActionDispatchJourneyRouterWithFiltering
|
|
53
|
+
include RoutingFilterOverrideShared
|
|
54
|
+
|
|
55
|
+
def find_routes(env)
|
|
56
|
+
path = env.is_a?(Hash) ? env['PATH_INFO'] : env.path_info
|
|
57
|
+
path, original_path, filter_parameters = apply_routing_filters(path, env)
|
|
58
|
+
|
|
59
|
+
##### OVERRIDE STARTS #####
|
|
60
|
+
super(env) do |match, parameters, route|
|
|
61
|
+
parameters = parameters.merge(filter_parameters)
|
|
62
|
+
env.is_a?(Hash) ? env['PATH_INFO'] = original_path : env.path_info = original_path
|
|
63
|
+
yield [match, parameters, route]
|
|
64
|
+
end
|
|
65
|
+
##### OVERRIDE ENDS #####
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
ActionDispatch::Journey::Router.prepend(CustomOverridesActionDispatchJourneyRouterWithFiltering)
|
|
70
|
+
end
|
data/lib/refinery/i18n-filter.rb
CHANGED
|
@@ -24,13 +24,19 @@ module RoutingFilter
|
|
|
24
24
|
|
|
25
25
|
yield.tap do |result|
|
|
26
26
|
result = result.is_a?(Array) ? result.first : result
|
|
27
|
-
if
|
|
28
|
-
locale != ::Refinery::I18n.default_frontend_locale and
|
|
29
|
-
result !~ %r{^/(#{Refinery::Core.backend_route}|wymiframe)}
|
|
30
|
-
result.sub!(%r(^(http.?://[^/]*)?(.*))) { "#{$1}/#{locale}#{$2}" }
|
|
31
|
-
end
|
|
27
|
+
insert_locale(result.url, locale) if url_needs_locale?(result.url, locale)
|
|
32
28
|
end
|
|
33
29
|
end
|
|
34
30
|
|
|
31
|
+
# locale should be inserted if filtering AND not in default locale AND not a backend url
|
|
32
|
+
private def url_needs_locale?(url, locale)
|
|
33
|
+
::Refinery::I18n.url_filter_enabled? &&
|
|
34
|
+
locale != ::Refinery::I18n.default_frontend_locale &&
|
|
35
|
+
url !~ %r{^/(#{Refinery::Core.backend_route}|wymiframe)}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
private def insert_locale(url, locale)
|
|
39
|
+
url.sub!(%r(^(http.?://[^/]*)?(.*))) { "#{$1}/#{locale}#{$2}" }
|
|
40
|
+
end
|
|
35
41
|
end
|
|
36
42
|
end
|
data/lib/refinery/i18n.rb
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Encoding: UTF-8 <-- required, please leave this in.
|
|
2
2
|
require 'mobility'
|
|
3
|
-
require 'refinerycms-core'
|
|
4
3
|
require 'routing-filter'
|
|
5
4
|
require 'rails-i18n'
|
|
5
|
+
require 'refinery/i18n/engine'
|
|
6
|
+
require 'refinery/i18n/override_routing_filter'
|
|
6
7
|
|
|
7
8
|
module Refinery
|
|
8
9
|
autoload :I18nGenerator, 'generators/refinery/i18n_generator'
|
|
@@ -61,7 +62,6 @@ module Refinery
|
|
|
61
62
|
end
|
|
62
63
|
end
|
|
63
64
|
|
|
64
|
-
require 'refinery/i18n/engine'
|
|
65
65
|
require 'refinery/i18n/configuration'
|
|
66
66
|
end
|
|
67
67
|
end
|
data/refinerycms-i18n.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{refinerycms-i18n}
|
|
5
|
-
s.version = %q{5.0
|
|
5
|
+
s.version = %q{5.1.0}
|
|
6
6
|
s.description = %q{i18n logic extracted from Refinery CMS, for Refinery CMS.}
|
|
7
7
|
s.summary = %q{i18n logic for Refinery CMS.}
|
|
8
8
|
s.email = %q{info@refinerycms.com}
|
|
@@ -14,14 +14,9 @@ Gem::Specification.new do |s|
|
|
|
14
14
|
s.files = `git ls-files`.split("\n")
|
|
15
15
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
|
16
16
|
|
|
17
|
-
s.required_ruby_version = '>= 2.
|
|
17
|
+
s.required_ruby_version = '>= 2.7'
|
|
18
18
|
|
|
19
|
-
s.add_dependency 'routing-filter', '~> 0.
|
|
19
|
+
s.add_dependency 'routing-filter', '~> 0.7'
|
|
20
20
|
s.add_dependency 'rails-i18n', '>= 5.0'
|
|
21
|
-
s.add_dependency 'mobility', '~>
|
|
22
|
-
|
|
23
|
-
s.cert_chain = [File.expand_path("../certs/parndt.pem", __FILE__)]
|
|
24
|
-
if $0 =~ /gem\z/ && ARGV.include?("build") && ARGV.include?(__FILE__)
|
|
25
|
-
s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem")
|
|
26
|
-
end
|
|
21
|
+
s.add_dependency 'mobility', '~> 1.2'
|
|
27
22
|
end
|
|
@@ -10,7 +10,7 @@ module Refinery
|
|
|
10
10
|
subject { get :show, params: { path: 'test', locale: 'en%20217' } }
|
|
11
11
|
|
|
12
12
|
it 'redirects to the location with the default frontend locale' do
|
|
13
|
-
expect(subject).to redirect_to
|
|
13
|
+
expect(subject).to redirect_to('/test')
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
it 'flashes a notice message' do
|
|
@@ -18,4 +18,4 @@ module Refinery
|
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
|
-
end
|
|
21
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
require "spec_helper"
|
|
3
3
|
|
|
4
|
-
describe "set_locale parameter", :
|
|
4
|
+
describe "set_locale parameter", type: :feature do
|
|
5
5
|
refinery_login
|
|
6
6
|
|
|
7
7
|
it "changes language used in backend" do
|
|
@@ -9,7 +9,7 @@ describe "set_locale parameter", :type => :feature do
|
|
|
9
9
|
|
|
10
10
|
expect(page).to have_content("Switch to your website")
|
|
11
11
|
|
|
12
|
-
visit refinery.admin_pages_path(:
|
|
12
|
+
visit refinery.admin_pages_path(set_locale: :cs)
|
|
13
13
|
|
|
14
14
|
expect(page).to have_content("Přepnout na web")
|
|
15
15
|
end
|
data/translate-readme.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Translate
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
-
This plugin provides a web interface for translating Rails I18n texts (requires Rails 2.2 or higher) from one locale to another. The plugin has been tested only with the simple I18n backend that ships with Rails. I18n texts are read from and written to YAML files under config/locales
|
|
4
|
+
This plugin provides a web interface for translating Rails I18n texts (requires Rails 2.2 or higher) from one locale to another. The plugin has been tested only with the simple I18n backend that ships with Rails. I18n texts are read from and written to YAML files under `config/locales`.
|
|
5
5
|
|
|
6
|
-
To translate to a new locale you need to add a YAML file for that locale
|
|
6
|
+
To translate to a new locale you need to add a YAML file for that locale.
|
|
7
|
+
A translation file has the _locale_ as the top key and at least one translation.
|
|
7
8
|
|
|
8
9
|
Please note that there are certain I18n keys that map to Array objects rather than strings and those are currently not dealt with by the translation UI. This means that Rails built in keys such as date.day_names need to be translated manually directly in the YAML file.
|
|
9
10
|
|
|
@@ -19,21 +20,29 @@ Rake Tasks
|
|
|
19
20
|
|
|
20
21
|
In addition to the web UI this plugin adds the following rake tasks:
|
|
21
22
|
|
|
22
|
-
translate:lost_in_translation
|
|
23
|
-
translate:merge_keys
|
|
24
|
-
translate:google
|
|
25
|
-
translate:changed
|
|
23
|
+
* translate:lost_in_translation
|
|
24
|
+
* translate:merge_keys
|
|
25
|
+
* translate:google
|
|
26
|
+
* translate:changed
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
### Lost in Translation
|
|
29
|
+
The `translate:lost_in_translation` task shows you any I18n keys in your code that are do not have translations in the YAML file for your default locale, i.e. config/locales/sv.yml.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
### Merge Keys
|
|
32
|
+
The `translate:merge_keys` task is supposed to be used in conjunction with Sven Fuch's [Rails I18n TextMate bundle](http://github.com/svenfuchs/rails-i18n/tree/master).
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
Texts and keys extracted with the TextMate bundle end up in a temporary file `log/translations.yml`.
|
|
35
|
+
When you run the `merge_keys` rake task these keys are moved to the corresponding I18n locale file, i.e. `config/locales/sv.yml`.
|
|
36
|
+
The `merge_keys` task also warns you if one of your extracted keys will overwrite an existing translation.
|
|
32
37
|
|
|
33
|
-
|
|
38
|
+
### Translate Google
|
|
39
|
+
The `translate:google` task is used for auto translating from one locale to another using Google Translate.
|
|
40
|
+
|
|
41
|
+
### Translate Changed
|
|
42
|
+
The `translate:changed` task can show you which keys have had their texts changed between one file and another.
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
34
45
|
|
|
35
|
-
Installation
|
|
36
|
-
=========
|
|
37
46
|
Obtain the source with:
|
|
38
47
|
|
|
39
48
|
./script/plugin install git://github.com/newsdesk/translate.git
|