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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fdbfd25f140436e323ceb8eec7f22aaa1aa52d4e9979cb0e6cddf4020bf53a9
4
- data.tar.gz: a6e68e6e68cc021427164c95f671a012c78c31855aa9d1fef5c8cea528577ca1
3
+ metadata.gz: ef2003dd6566b01a576e74b7db0ef2e277e71a642c18e571683e8509db7af1b6
4
+ data.tar.gz: ea5121783f2dec044550682d9be5cbcdf5c1f8990bef886ec7a04ac414463f26
5
5
  SHA512:
6
- metadata.gz: 822a81c0d8e8d08c2d6e03a9208e899a2a5a6649bbafe347b3e56c3ab6c430bfb059e05ec03abde8307c2a9692f08c64d5f9b7a0c94fe8c10eefead0385ca845
7
- data.tar.gz: cd0d806e70019c47b00572bf16e64a13b6435337f36affc6a9f283df8949f56d575fcfe0d35b147d558112990c1e07a0ef9dda3b98808bede245fbd3feed2b8e
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 "Proofread translations", "?i18n_feedback=true" %>
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
- <% on = cookies[:i18n_feedback].present? %>
147
- <%= link_to (on ? "Disable translations editing" : "Enable translations editing"),
148
- "?i18n_feedback=#{!on}" %>
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
- - **Don't** run the label through `I18n.t`: the tool would then mark its own
162
- control as an editable string. Keep the label a plain literal.
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
 
@@ -1,6 +1,8 @@
1
1
  ar:
2
2
  i18n_feedback:
3
3
  pill: "اقترح تعديلات"
4
+ start: "اقترح تعديلات"
5
+ stop: "إيقاف الاقتراح"
4
6
  pill_active: "وضع الاقتراح — اضغط للخروج (Esc)"
5
7
  title: "اقترح تصحيحًا للترجمة"
6
8
  current_text: "النص الحالي"
@@ -1,6 +1,8 @@
1
1
  bn:
2
2
  i18n_feedback:
3
3
  pill: "সম্পাদনা প্রস্তাব করুন"
4
+ start: "সম্পাদনা প্রস্তাব করুন"
5
+ stop: "প্রস্তাব দেওয়া বন্ধ করুন"
4
6
  pill_active: "প্রস্তাব চলছে — বের হতে ট্যাপ করুন (Esc)"
5
7
  title: "অনুবাদ সংশোধন প্রস্তাব করুন"
6
8
  current_text: "বর্তমান লেখা"
@@ -1,6 +1,8 @@
1
1
  de:
2
2
  i18n_feedback:
3
3
  pill: "Änderungen vorschlagen"
4
+ start: "Änderungen vorschlagen"
5
+ stop: "Vorschläge beenden"
4
6
  pill_active: "Vorschlagsmodus — zum Beenden tippen (Esc)"
5
7
  title: "Übersetzungskorrektur vorschlagen"
6
8
  current_text: "Aktueller Text"
@@ -1,6 +1,8 @@
1
1
  en:
2
2
  i18n_feedback:
3
3
  pill: "Suggest edits"
4
+ start: "Suggest edits"
5
+ stop: "Stop suggesting"
4
6
  pill_active: "Suggesting — tap to exit (Esc)"
5
7
  title: "Suggest a translation fix"
6
8
  current_text: "Current text"
@@ -1,6 +1,8 @@
1
1
  es:
2
2
  i18n_feedback:
3
3
  pill: "Sugerir cambios"
4
+ start: "Sugerir cambios"
5
+ stop: "Dejar de sugerir"
4
6
  pill_active: "Sugiriendo — toca para salir (Esc)"
5
7
  title: "Sugerir una corrección de traducción"
6
8
  current_text: "Texto actual"
@@ -1,6 +1,8 @@
1
1
  fr:
2
2
  i18n_feedback:
3
3
  pill: "Proposer des corrections"
4
+ start: "Proposer des corrections"
5
+ stop: "Arrêter de proposer"
4
6
  pill_active: "En cours — appuyez pour quitter (Échap)"
5
7
  title: "Proposer une correction de traduction"
6
8
  current_text: "Texte actuel"
@@ -1,6 +1,8 @@
1
1
  hi:
2
2
  i18n_feedback:
3
3
  pill: "बदलाव सुझाएँ"
4
+ start: "बदलाव सुझाएँ"
5
+ stop: "सुझाव देना बंद करें"
4
6
  pill_active: "सुझाव मोड — बाहर निकलने के लिए टैप करें (Esc)"
5
7
  title: "अनुवाद सुधार सुझाएँ"
6
8
  current_text: "वर्तमान टेक्स्ट"
@@ -1,6 +1,8 @@
1
1
  id:
2
2
  i18n_feedback:
3
3
  pill: "Sarankan perubahan"
4
+ start: "Sarankan perubahan"
5
+ stop: "Berhenti menyarankan"
4
6
  pill_active: "Menyarankan — ketuk untuk keluar (Esc)"
5
7
  title: "Sarankan perbaikan terjemahan"
6
8
  current_text: "Teks saat ini"
@@ -1,6 +1,8 @@
1
1
  it:
2
2
  i18n_feedback:
3
3
  pill: "Suggerisci modifiche"
4
+ start: "Suggerisci modifiche"
5
+ stop: "Interrompi i suggerimenti"
4
6
  pill_active: "Suggerimento — tocca per uscire (Esc)"
5
7
  title: "Suggerisci una correzione di traduzione"
6
8
  current_text: "Testo attuale"
@@ -1,6 +1,8 @@
1
1
  ja:
2
2
  i18n_feedback:
3
3
  pill: "修正を提案"
4
+ start: "修正を提案"
5
+ stop: "提案を終了"
4
6
  pill_active: "提案中 — タップで終了(Esc)"
5
7
  title: "翻訳の修正を提案"
6
8
  current_text: "現在のテキスト"
@@ -1,6 +1,8 @@
1
1
  ko:
2
2
  i18n_feedback:
3
3
  pill: "수정 제안"
4
+ start: "수정 제안"
5
+ stop: "제안 중지"
4
6
  pill_active: "제안 중 — 종료하려면 탭하세요 (Esc)"
5
7
  title: "번역 수정 제안"
6
8
  current_text: "현재 텍스트"
@@ -1,6 +1,8 @@
1
1
  nl:
2
2
  i18n_feedback:
3
3
  pill: "Wijzigingen voorstellen"
4
+ start: "Wijzigingen voorstellen"
5
+ stop: "Stoppen met voorstellen"
4
6
  pill_active: "Aan het voorstellen — tik om te sluiten (Esc)"
5
7
  title: "Een vertaalcorrectie voorstellen"
6
8
  current_text: "Huidige tekst"
@@ -1,6 +1,8 @@
1
1
  pl:
2
2
  i18n_feedback:
3
3
  pill: "Zaproponuj zmiany"
4
+ start: "Zaproponuj zmiany"
5
+ stop: "Zakończ sugerowanie"
4
6
  pill_active: "Tryb sugestii — dotknij, aby wyjść (Esc)"
5
7
  title: "Zaproponuj poprawkę tłumaczenia"
6
8
  current_text: "Bieżący tekst"
@@ -1,6 +1,8 @@
1
1
  pt:
2
2
  i18n_feedback:
3
3
  pill: "Sugerir edições"
4
+ start: "Sugerir edições"
5
+ stop: "Parar de sugerir"
4
6
  pill_active: "Sugerindo — toque para sair (Esc)"
5
7
  title: "Sugerir uma correção de tradução"
6
8
  current_text: "Texto atual"
@@ -1,6 +1,8 @@
1
1
  ru:
2
2
  i18n_feedback:
3
3
  pill: "Предложить правки"
4
+ start: "Предложить правки"
5
+ stop: "Остановить предложения"
4
6
  pill_active: "Режим предложений — нажмите, чтобы выйти (Esc)"
5
7
  title: "Предложить исправление перевода"
6
8
  current_text: "Текущий текст"
@@ -1,6 +1,8 @@
1
1
  th:
2
2
  i18n_feedback:
3
3
  pill: "แนะนำการแก้ไข"
4
+ start: "แนะนำการแก้ไข"
5
+ stop: "หยุดแนะนำ"
4
6
  pill_active: "กำลังแนะนำ — แตะเพื่อออก (Esc)"
5
7
  title: "แนะนำการแก้ไขคำแปล"
6
8
  current_text: "ข้อความปัจจุบัน"
@@ -1,6 +1,8 @@
1
1
  tr:
2
2
  i18n_feedback:
3
3
  pill: "Düzenleme öner"
4
+ start: "Düzenleme öner"
5
+ stop: "Önermeyi durdur"
4
6
  pill_active: "Öneri modu — çıkmak için dokun (Esc)"
5
7
  title: "Çeviri düzeltmesi öner"
6
8
  current_text: "Mevcut metin"
@@ -1,6 +1,8 @@
1
1
  uk:
2
2
  i18n_feedback:
3
3
  pill: "Запропонувати зміни"
4
+ start: "Запропонувати зміни"
5
+ stop: "Зупинити пропозиції"
4
6
  pill_active: "Режим пропозицій — торкніться, щоб вийти (Esc)"
5
7
  title: "Запропонувати виправлення перекладу"
6
8
  current_text: "Поточний текст"
@@ -1,6 +1,8 @@
1
1
  ur:
2
2
  i18n_feedback:
3
3
  pill: "ترامیم تجویز کریں"
4
+ start: "ترامیم تجویز کریں"
5
+ stop: "تجویز کرنا بند کریں"
4
6
  pill_active: "تجویز موڈ — باہر نکلنے کے لیے تھپتھپائیں (Esc)"
5
7
  title: "ترجمے کی اصلاح تجویز کریں"
6
8
  current_text: "موجودہ متن"
@@ -1,6 +1,8 @@
1
1
  vi:
2
2
  i18n_feedback:
3
3
  pill: "Đề xuất chỉnh sửa"
4
+ start: "Đề xuất chỉnh sửa"
5
+ stop: "Dừng đề xuất"
4
6
  pill_active: "Đang đề xuất — chạm để thoát (Esc)"
5
7
  title: "Đề xuất sửa bản dịch"
6
8
  current_text: "Văn bản hiện tại"
@@ -1,6 +1,8 @@
1
1
  zh-CN:
2
2
  i18n_feedback:
3
3
  pill: "建议修改"
4
+ start: "建议修改"
5
+ stop: "停止建议"
4
6
  pill_active: "建议中 — 点击退出(Esc)"
5
7
  title: "建议翻译修正"
6
8
  current_text: "当前文本"
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module I18nFeedback
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_feedback
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov