i18n_feedback 0.5.0 → 0.6.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/CHANGELOG.md +9 -0
- data/README.md +13 -7
- data/config/locales/i18n_feedback.ar.yml +2 -0
- data/config/locales/i18n_feedback.bn.yml +2 -0
- data/config/locales/i18n_feedback.de.yml +2 -0
- data/config/locales/i18n_feedback.en.yml +2 -0
- data/config/locales/i18n_feedback.es.yml +2 -0
- data/config/locales/i18n_feedback.fr.yml +2 -0
- data/config/locales/i18n_feedback.hi.yml +2 -0
- data/config/locales/i18n_feedback.id.yml +2 -0
- data/config/locales/i18n_feedback.it.yml +2 -0
- data/config/locales/i18n_feedback.ja.yml +2 -0
- data/config/locales/i18n_feedback.ko.yml +2 -0
- data/config/locales/i18n_feedback.nl.yml +2 -0
- data/config/locales/i18n_feedback.pl.yml +2 -0
- data/config/locales/i18n_feedback.pt.yml +2 -0
- data/config/locales/i18n_feedback.ru.yml +2 -0
- data/config/locales/i18n_feedback.th.yml +2 -0
- data/config/locales/i18n_feedback.tr.yml +2 -0
- data/config/locales/i18n_feedback.uk.yml +2 -0
- data/config/locales/i18n_feedback.ur.yml +2 -0
- data/config/locales/i18n_feedback.vi.yml +2 -0
- data/config/locales/i18n_feedback.zh-CN.yml +2 -0
- data/lib/generators/i18n_feedback/install/templates/initializer.rb +5 -0
- data/lib/i18n_feedback/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef2003dd6566b01a576e74b7db0ef2e277e71a642c18e571683e8509db7af1b6
|
|
4
|
+
data.tar.gz: ea5121783f2dec044550682d9be5cbcdf5c1f8990bef886ec7a04ac414463f26
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02fba91e18f211348b3c99a23de1c0ca6b4bdc22c63a7cf7833c537cfc2a671e9802e76ff2385687135b410d574d70a5ae57f38a8e770d0bc70b351946f85d7e
|
|
7
|
+
data.tar.gz: e30815c01401a293b4226e2fd9f6cfbc39dbb660924520c3325fef0954f786791346f8160d06b96b5f479d0d8f034b4c4bdb80ce1f33cbfb68f4d56bd4beeb3f
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.6.0]
|
|
6
|
+
|
|
7
|
+
- Ship `i18n_feedback.start` / `i18n_feedback.stop` labels in every bundled
|
|
8
|
+
language, for hosts that drive suggest mode from their own menu/link instead
|
|
9
|
+
of the floating pill. Because the `i18n_feedback.*` scope is exempt from
|
|
10
|
+
key-marking, these are safe to render with `t(...)` — no plain-literal
|
|
11
|
+
workaround needed. See the "Toggling suggest mode from your own link" README
|
|
12
|
+
section for a full HTML example.
|
|
13
|
+
|
|
5
14
|
## [0.5.0]
|
|
6
15
|
|
|
7
16
|
- Add a `status` to each suggestion — a string-backed Active Record enum with
|
data/README.md
CHANGED
|
@@ -136,16 +136,20 @@ config.show_pill = false # optional
|
|
|
136
136
|
A one-way "turn it on" link is just the toggle parameter:
|
|
137
137
|
|
|
138
138
|
```erb
|
|
139
|
-
<%= link_to "
|
|
139
|
+
<%= link_to t("i18n_feedback.start"), "?i18n_feedback=true" %>
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
For a single control that flips both ways, read the current state from the
|
|
143
|
-
`i18n_feedback` cookie and point at the opposite state
|
|
143
|
+
`i18n_feedback` cookie and point at the opposite state. The gem ships `start`
|
|
144
|
+
and `stop` labels under the `i18n_feedback.*` scope in every bundled language,
|
|
145
|
+
so a localized toggle needs no keys of your own:
|
|
144
146
|
|
|
145
147
|
```erb
|
|
146
|
-
<%
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
<% if I18nFeedback.available?(request) %>
|
|
149
|
+
<% suggesting = cookies[:i18n_feedback].present? %>
|
|
150
|
+
<%= link_to (suggesting ? t("i18n_feedback.stop") : t("i18n_feedback.start")),
|
|
151
|
+
"?#{I18nFeedback.config.toggle_param}=#{!suggesting}" %>
|
|
152
|
+
<% end %>
|
|
149
153
|
```
|
|
150
154
|
|
|
151
155
|
Good to know:
|
|
@@ -158,8 +162,10 @@ Good to know:
|
|
|
158
162
|
ordinary navigation during proofreading (so a stray click can't leave the page
|
|
159
163
|
mid-edit), but any link carrying the toggle parameter is exempt — so a "Disable"
|
|
160
164
|
item in your nav always gets you out.
|
|
161
|
-
- **
|
|
162
|
-
|
|
165
|
+
- The `i18n_feedback.*` keys are **safe to run through `I18n.t`** — that scope is
|
|
166
|
+
exempt from key-marking, so the tool never flags its own controls as editable.
|
|
167
|
+
Use the bundled `i18n_feedback.start` / `i18n_feedback.stop` labels (or your own
|
|
168
|
+
keys); either way, no plain-literal workaround is needed.
|
|
163
169
|
|
|
164
170
|
### Gating examples
|
|
165
171
|
|
|
@@ -41,4 +41,9 @@ I18nFeedback.configure do |config|
|
|
|
41
41
|
# ticket. Runs inline after save, so keep it fast or hand off to a job.
|
|
42
42
|
#
|
|
43
43
|
# config.on_submit = ->(suggestion) { SuggestionMailer.with(suggestion:).created.deliver_later }
|
|
44
|
+
|
|
45
|
+
# Per-IP throttle on the submission endpoint, passed to Rails' built-in rate
|
|
46
|
+
# limiter (Rails 7.2+; ignored on 7.1). Set nil to disable.
|
|
47
|
+
#
|
|
48
|
+
# config.rate_limit = { to: 30, within: 60 }
|
|
44
49
|
end
|