cloudflare-turnstile-rails 0.9.2 → 0.10.1

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: b26a1fe41faf2fc522f8c3edfa99d1630302e42f6b27c70d57ef2bd18d68141b
4
- data.tar.gz: a4cd3a79a966b15dd86abb2bb432ec514b799a7cb18c259fe663d7a0b446e68c
3
+ metadata.gz: 7af30ad08aa789ad214d41613d6a6a2b6df44c05cacb3fcdd198ae8f17760f02
4
+ data.tar.gz: 3a248a47546aaf3efe6f8341b472af2d11a0de137d8c05a890f6bd6c50d7b8ea
5
5
  SHA512:
6
- metadata.gz: 44f4c61f9ee07d73c42537269b82467cd6feea576249d3c726a85cf77a779a0243868947af930baddd4458d0310330c62843eff956602156193fdfedd44df7ed
7
- data.tar.gz: 491185d8692844b7fca37e5881054b6f25ac20e58f369ecda969a260d1f66f520a6ff297d4b86c444d483cc25e63cf496c76b6c6cba192c19a077a815d201802
6
+ metadata.gz: e4e959a9aecc03dcf6365b304be22777a815c22d1b208df6160003c510c286d5253c22a475699d1aa03acd728c4cd0c413a4e8eb98a5d662e78b1341fc56a9c8
7
+ data.tar.gz: 1998385612074a7fc53232f415276b7b7799f2e412f24cc46b6e889486e4281073d988af7453adc47fdcd50c6f3ebac210dbbb45315dda48553f64ad97e2d12a
data/Appraisals CHANGED
@@ -62,4 +62,8 @@ if RUBY_VERSION >= '3.2.0'
62
62
  appraise 'rails-8.0' do
63
63
  gem 'rails', '~> 8.0.0'
64
64
  end
65
+
66
+ appraise 'rails-8.0' do
67
+ gem 'rails', '~> 8.1.0'
68
+ end
65
69
  end
data/README.md CHANGED
@@ -16,7 +16,7 @@ Supports `Rails >= 5.0` with `Ruby >= 2.6.0`.
16
16
  * **One‑line integration**: `<%= cloudflare_turnstile_tag %>` in views, `valid_turnstile?(model:)` in controllers — no extra wiring.
17
17
  * **Turbo & Turbo Streams aware**: Automatically re‑initializes widgets on `turbo:load`, `turbo:before-stream-render`, and DOM mutations.
18
18
  * **Legacy Turbolinks support**: Includes a helper for Turbolinks to handle remote form submissions with validation errors.
19
- * **CSP nonce support**: Honors Rails’s `content_security_policy_nonce` for secure inline scripts.
19
+ * **CSP nonce support**: Honours Rails' `content_security_policy_nonce` for secure inline scripts.
20
20
  * **Rails Engine & Asset pipeline**: Ships a precompiled JS helper via Railtie — no manual asset setup.
21
21
  * **Lightweight**: Pure Ruby/Rails with only `net/http` and `json` dependencies.
22
22
 
@@ -30,6 +30,11 @@ Supports `Rails >= 5.0` with `Ruby >= 2.6.0`.
30
30
  - [CSP Nonce Support](#csp-nonce-support)
31
31
  - [Turbo & Turbo Streams Support](#turbo--turbo-streams-support)
32
32
  - [Turbolinks Support](#turbolinks-support)
33
+ - [Internationalization (I18n)](#internationalization-i18n)
34
+ - [Overriding Translations](#overriding-translations)
35
+ - [Locale Fallbacks](#locale-fallbacks)
36
+ - [Adding New Languages](#adding-new-languages)
37
+ - [Available Translation Keys](#available-translation-keys)
33
38
  - [Automated Testing of Your Integration](#automated-testing-of-your-integration)
34
39
  - [Upgrade Guide](#upgrade-guide)
35
40
  - [Troubleshooting](#troubleshooting)
@@ -81,14 +86,14 @@ Supports `Rails >= 5.0` with `Ruby >= 2.6.0`.
81
86
  <%= cloudflare_turnstile_tag %>
82
87
  ```
83
88
 
84
- That's it! Though it is recommended to match your `theme` and `language` to your apps design and locale:
89
+ That's it! Though it is recommended to match your `theme` and `language` to your app's design and locale:
85
90
 
86
91
  ```erb
87
92
  <%= cloudflare_turnstile_tag data: { theme: 'auto', language: 'en' } %>
88
93
  ```
89
94
 
90
95
  * For all available **data-**\* options (e.g., `action`, `cdata`, `theme`, etc.), refer to the official Cloudflare client-side rendering docs:
91
- [https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#configurations](https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#configurations)
96
+ [https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#configuration-options](https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#configuration-options)
92
97
  * **Supported locales** for the widget UI can be found here:
93
98
  [https://developers.cloudflare.com/turnstile/reference/supported-languages/](https://developers.cloudflare.com/turnstile/reference/supported-languages/)
94
99
 
@@ -107,8 +112,19 @@ Supports `Rails >= 5.0` with `Ruby >= 2.6.0`.
107
112
  end
108
113
  ```
109
114
 
110
- * You may also pass additional **siteverify** parameters (e.g., `secret`, `response`, `remoteip`, `idempotency_key`) supported by Cloudflares API:
111
- [Cloudflare Server-Side Validation Parameters](https://developers.cloudflare.com/turnstile/get-started/server-side-validation/#accepted-parameters)
115
+ * You may also pass additional **siteverify** parameters (e.g., `secret`, `response`, `remoteip`, `idempotency_key`) supported by Cloudflare's API:
116
+ [Cloudflare Server-Side Validation Parameters](https://developers.cloudflare.com/turnstile/get-started/server-side-validation/#required-parameters)
117
+
118
+ For example, to pass a custom remote IP address:
119
+
120
+ ```ruby
121
+ if valid_turnstile?(model: @user, remoteip: request.remote_ip)
122
+ # Passed with custom IP verification
123
+ else
124
+ # Failed
125
+ render :new, status: :unprocessable_entity
126
+ end
127
+ ```
112
128
 
113
129
  #### Advanced Validation
114
130
 
@@ -157,7 +173,7 @@ Supports `Rails >= 5.0` with `Ruby >= 2.6.0`.
157
173
 
158
174
  ### CSP Nonce Support
159
175
 
160
- The `cloudflare_turnstile_tag` helper injects the Turnstile widget and accompanying JavaScript inline by default (honoring Rails' `content_security_policy_nonce`), so there's no need to allow `unsafe-inline` in your CSP.
176
+ The `cloudflare_turnstile_tag` helper injects the Turnstile widget and accompanying JavaScript inline by default (honouring Rails' `content_security_policy_nonce`), so there's no need to allow `unsafe-inline` in your CSP.
161
177
 
162
178
  ### Turbo & Turbo Streams Support
163
179
 
@@ -171,7 +187,68 @@ If your Rails app still uses Turbolinks (rather than Turbo), you can add a small
171
187
  templates / shared / cloudflare_turbolinks_ajax_cache.js
172
188
  ```
173
189
 
174
- into your applications JavaScript entrypoint (for example `app/javascript/packs/application.js`). This script listens for Rails UJS `ajax:complete` events that return HTML, caches the response as a Turbolinks snapshot, and then restores it via `Turbolinks.visit`, ensuring forms with validation errors are re‑rendered seamlessly.
190
+ into your application's JavaScript entrypoint (for example `app/javascript/packs/application.js`). This script listens for Rails UJS `ajax:complete` events that return HTML, caches the response as a Turbolinks snapshot, and then restores it via `Turbolinks.visit`, ensuring forms with validation errors are re‑rendered seamlessly.
191
+
192
+ ## Internationalization (I18n)
193
+
194
+ Error messages are fully internationalized using Rails I18n. See [all languages](lib/cloudflare/turnstile/rails/locales) bundled with the gem.
195
+
196
+ ### Overriding Translations
197
+
198
+ To customize error messages, add your own translations in your application's locale files:
199
+
200
+ ```yaml
201
+ # config/locales/cloudflare_turnstile/en.yml
202
+ en:
203
+ cloudflare_turnstile:
204
+ errors:
205
+ default: "Verification failed. Please try again."
206
+ timeout_or_duplicate: "Session expired. Please try again."
207
+ ```
208
+
209
+ Your application's translations take precedence over the gem's defaults.
210
+
211
+ ### Locale Fallbacks
212
+
213
+ This gem respects Rails' built-in I18n fallback configuration. When `config.i18n.fallbacks = true`, Rails will try fallback locales (including `default_locale`) before using the gem's default message.
214
+
215
+ For example, with fallbacks enabled and a chain of `:pt → :es`, if a Portuguese translation is missing, Rails will automatically try Spanish before falling back to the gem's default message.
216
+
217
+ > **Note:** If you use regional locales (e.g., `:pt-BR`, `:zh-CN`), you should enable fallbacks. Without `config.i18n.fallbacks = true`, a locale like `:pt-BR` will **not** automatically fall back to `:pt`, and users will see the generic fallback message instead of the Portuguese translation.
218
+
219
+ ### Adding New Languages
220
+
221
+ To add a language not bundled with the gem (e.g. Yoruba), create a new locale file:
222
+
223
+ ```yaml
224
+ # config/locales/cloudflare_turnstile/yo.yml
225
+ yo:
226
+ cloudflare_turnstile:
227
+ errors:
228
+ default: "A ko le jẹrisi pe o jẹ ènìyàn. Jọwọ gbìyànjú lẹ́ẹ̀kansi."
229
+ missing_input_secret: "Kọkọrọ̀ ìkọkọ Turnstile kò sí."
230
+ invalid_input_secret: "Kọkọrọ̀ ìkọkọ Turnstile kò bófin mu, kò sí, tàbí pé ó jẹ́ akọsọ ìdánwò pẹ̀lú ìdáhùn tí kì í ṣe ìdánwò."
231
+ missing_input_response: "A kò fi ìdáhùn Turnstile ránṣẹ́."
232
+ invalid_input_response: "Ìbáṣepọ̀ ìdáhùn Turnstile kò bófin mu."
233
+ bad_request: "Ìbéèrè Turnstile kọjá àṣìṣe nítorí pé a kọ ọ̀ ní ọna tí kò tó."
234
+ timeout_or_duplicate: "Àmì-ẹ̀rí Turnstile ti lo tẹlẹ̀ tàbí pé ó ti parí."
235
+ internal_error: "Àṣìṣe inú Turnstile ṣẹlẹ̀ nígbà ìmúdájú ìdáhùn. Jọwọ gbìyànjú lẹ́ẹ̀kansi."
236
+ ```
237
+
238
+ ### Available Translation Keys
239
+
240
+ | Key | Cloudflare Error Code | Description |
241
+ |--------------------------|----------------------------|-------------------------------------|
242
+ | `default` | — | Fallback message for unknown errors |
243
+ | `missing_input_secret` | `missing-input-secret` | Secret key not configured |
244
+ | `invalid_input_secret` | `invalid-input-secret` | Invalid or missing secret key |
245
+ | `missing_input_response` | `missing-input-response` | Response parameter not provided |
246
+ | `invalid_input_response` | `invalid-input-response` | Invalid response parameter |
247
+ | `bad_request` | `bad-request` | Malformed request |
248
+ | `timeout_or_duplicate` | `timeout-or-duplicate` | Token expired or already used |
249
+ | `internal_error` | `internal-error` | Cloudflare internal error |
250
+
251
+ For more details on these error codes, see Cloudflare's [error codes reference](https://developers.cloudflare.com/turnstile/get-started/server-side-validation/#error-codes-reference).
175
252
 
176
253
  ## Automated Testing of Your Integration
177
254
 
@@ -250,7 +327,7 @@ If you run into any issues after upgrading Rails, please [open an issue](https:/
250
327
  - If more than one Turnstile widget appears in the same container, this indicates a bug in the gem—please [open an issue](https://github.com/vkononov/cloudflare-turnstile-rails/issues) so it can be addressed.
251
328
 
252
329
  **Explicit Rendering**
253
- - If youve configured explicit mode (`config.render = 'explicit'` or `cloudflare_turnstile_tag render: 'explicit'`) but widgets still auto-render, override the default container class:
330
+ - If you've configured explicit mode (`config.render = 'explicit'` or `cloudflare_turnstile_tag render: 'explicit'`) but widgets still auto-render, override the default container class:
254
331
 
255
332
  ```erb
256
333
  <%= cloudflare_turnstile_tag class: nil %>
@@ -262,13 +339,13 @@ If you run into any issues after upgrading Rails, please [open an issue](https:/
262
339
  <%= cloudflare_turnstile_tag class: 'my-widget-class' %>
263
340
  ```
264
341
 
265
- - By default Turnstile targets elements with the `cf-turnstile` class. For more details, see Cloudflares [https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#explicitly-render-the-turnstile-widget](https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#explicitly-render-the-turnstile-widget).
342
+ - By default Turnstile targets elements with the `cf-turnstile` class. For more details, see Cloudflare's [https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#explicit-rendering](https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#explicit-rendering).
266
343
 
267
344
  **CSP Nonce Issues**
268
- - When using Rails CSP nonces, make sure `content_security_policy_nonce` is available in your view context — otherwise the Turnstile script may be blocked.
345
+ - When using Rails' CSP nonces, make sure `content_security_policy_nonce` is available in your view context — otherwise the Turnstile script may be blocked.
269
346
 
270
347
  **Server Validation Errors**
271
- - Validation failures (invalid, expired, or already‑used tokens) surface as model errors. Consult Cloudflares [server-side troubleshooting](https://developers.cloudflare.com/turnstile/troubleshooting/testing/) for common error codes and test keys.
348
+ - Validation failures (invalid, expired, or already‑used tokens) surface as model errors. Consult Cloudflare's [server-side troubleshooting](https://developers.cloudflare.com/turnstile/troubleshooting/testing/) for common [error codes](https://developers.cloudflare.com/turnstile/troubleshooting/client-side-errors/error-codes/) and [test keys](https://developers.cloudflare.com/turnstile/troubleshooting/testing/#dummy-sitekeys-and-secret-keys).
272
349
 
273
350
  > Still stuck? Check the Cloudflare Turnstile docs: [https://developers.cloudflare.com/turnstile/get-started/](https://developers.cloudflare.com/turnstile/get-started/)
274
351
 
@@ -284,7 +361,7 @@ bin/setup
284
361
 
285
362
  ### Running the Test Suite
286
363
 
287
- [Appraisal](https://github.com/thoughtbot/appraisal) is used to run the full test suite against multiple Rails versions by generating separate Gemfiles and isolating each environment. To install dependencies and exercise all unit, integration and system tests:
364
+ [Appraisal](https://github.com/thoughtbot/appraisal) is used to run the full test suite against multiple Rails versions by generating separate Gemfiles and isolating each environment.
288
365
 
289
366
  Execute **all** tests (unit, integration, system) across every Ruby & Rails combination:
290
367
 
@@ -293,11 +370,11 @@ bundle exec appraisal install
293
370
  bundle exec appraisal rake test
294
371
  ```
295
372
 
296
- > **CI Note:** Our GitHub Actions [.github/workflows/test.yml](https://github.com/vkononov/cloudflare-turnstile-rails/blob/main/.github/workflows/test.yml) runs this command on each Ruby/Rails combo and captures screenshots from system specs.
373
+ > **CI Note:** The GitHub Action [.github/workflows/test.yml](https://github.com/vkononov/cloudflare-turnstile-rails/blob/main/.github/workflows/test.yml) runs this command on each Ruby/Rails combo and captures screenshots from system specs.
297
374
 
298
375
  ### Code Linting
299
376
 
300
- Enforce code style with RuboCop (latest Ruby only)::
377
+ Enforce code style with RuboCop (latest Ruby only):
301
378
 
302
379
  ```bash
303
380
  bundle exec rubocop
@@ -2,7 +2,7 @@ module Cloudflare
2
2
  module Turnstile
3
3
  module Rails
4
4
  module ErrorCode
5
- # https://developers.cloudflare.com/turnstile/get-started/server-side-validation/#error-codes
5
+ # https://developers.cloudflare.com/turnstile/get-started/server-side-validation/#error-codes-reference
6
6
 
7
7
  MISSING_INPUT_SECRET = 'missing-input-secret'.freeze
8
8
  INVALID_INPUT_SECRET = 'invalid-input-secret'.freeze
@@ -4,21 +4,49 @@ module Cloudflare
4
4
  module Turnstile
5
5
  module Rails
6
6
  module ErrorMessage
7
- MAP = {
8
- ErrorCode::TIMEOUT_OR_DUPLICATE => 'Turnstile token has already been used or expired.'.freeze,
9
- ErrorCode::INVALID_INPUT_RESPONSE => 'Turnstile response parameter is invalid.'.freeze,
10
- ErrorCode::MISSING_INPUT_RESPONSE => 'Turnstile response parameter was not passed.'.freeze,
11
- ErrorCode::BAD_REQUEST => 'Turnstile request was rejected because it was malformed.'.freeze,
12
- ErrorCode::INTERNAL_ERROR => 'Turnstile Internal error occurred while validating the response. Please try again.'.freeze,
13
- ErrorCode::MISSING_INPUT_SECRET => 'Turnstile secret key missing.'.freeze,
14
- ErrorCode::INVALID_INPUT_SECRET => 'Turnstile secret parameter was invalid, did not exist, or is a testing secret key with a non-testing response.'.freeze
15
- }.freeze
16
-
17
- DEFAULT = "We could not verify that you're human. Please try again.".freeze
7
+ # I18n namespace for all error message translations
8
+ SCOPE = 'cloudflare_turnstile.errors'.freeze
9
+
10
+ # Fallback message used when no translation exists for an error code.
11
+ # This can happen if Cloudflare introduces a new error code that we
12
+ # haven't added to our locale files yet. Rails I18n fallbacks are
13
+ # respected if configured (config.i18n.fallbacks = true).
14
+ FALLBACK = "We could not verify that you're human. Please try again.".freeze
18
15
 
19
16
  def self.for(code)
20
- base = MAP.fetch(code, DEFAULT)
21
- "#{base} (#{code})"
17
+ "#{translate(key_for(code))} (#{code})"
18
+ end
19
+
20
+ def self.default
21
+ translate(:default)
22
+ end
23
+
24
+ # Backwards compatibility: ErrorMessage::DEFAULT still works (deprecated)
25
+ def self.const_missing(name)
26
+ if name == :DEFAULT
27
+ warn '[DEPRECATION] ErrorMessage::DEFAULT is deprecated. Use ErrorMessage.default instead.'
28
+ return default
29
+ end
30
+
31
+ super
32
+ end
33
+
34
+ # Converts Cloudflare error codes to i18n keys
35
+ # e.g., 'timeout-or-duplicate' → :timeout_or_duplicate
36
+ private_class_method def self.key_for(code)
37
+ return :default if code.nil? || code.to_s.empty?
38
+
39
+ code.to_s.tr('-', '_').to_sym
40
+ end
41
+
42
+ # Looks up translation for the given key in the current locale.
43
+ #
44
+ # Fallback behavior depends on the app's Rails configuration:
45
+ # - With `config.i18n.fallbacks = true`: tries current locale, then
46
+ # fallback chain (e.g., :pt → :sp), then FALLBACK constant
47
+ # - Without fallbacks (default): tries current locale, then FALLBACK
48
+ private_class_method def self.translate(key)
49
+ I18n.t(key, scope: SCOPE, default: FALLBACK)
22
50
  end
23
51
  end
24
52
  end
@@ -10,7 +10,7 @@ module Cloudflare
10
10
  result = Rails::Verification.verify(response: response, **opts)
11
11
 
12
12
  unless result.success?
13
- message = ErrorMessage::DEFAULT
13
+ message = ErrorMessage.default
14
14
  model&.errors&.add(:base, message)
15
15
  end
16
16
 
@@ -11,6 +11,11 @@ module Cloudflare
11
11
  app.config.assets.paths << js_path
12
12
  app.config.assets.precompile += %w[cloudflare_turnstile_helper.js]
13
13
  end
14
+
15
+ initializer 'cloudflare_turnstile.i18n' do
16
+ locale_path = File.expand_path('locales/*.yml', __dir__)
17
+ I18n.load_path += Dir[locale_path]
18
+ end
14
19
  end
15
20
  end
16
21
  end
@@ -0,0 +1,11 @@
1
+ cs:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "Nebylo možné ověřit, že jste člověk. Prosím zkuste to znovu."
5
+ missing_input_secret: "Chybí tajný klíč Turnstile."
6
+ invalid_input_secret: "Parametr tajného klíče Turnstile je neplatný, neexistuje nebo se jedná o testovací tajný klíč s netestovací odpovědí."
7
+ missing_input_response: "Chybí parametr odpovědi Turnstile."
8
+ invalid_input_response: "Parametr odpovědi Turnstile je neplatný."
9
+ bad_request: "Požadavek Turnstile byl odmítnut, protože nebyl správně sestaven."
10
+ timeout_or_duplicate: "Token Turnstile již byl použit nebo vypršel."
11
+ internal_error: "Při ověřování odpovědi došlo k interní chybě Turnstile. Zkuste to prosím znovu."
@@ -0,0 +1,11 @@
1
+ de:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "Wir konnten nicht bestätigen, dass Sie ein Mensch sind. Bitte versuchen Sie es erneut."
5
+ missing_input_secret: "Turnstile-Geheimschlüssel fehlt."
6
+ invalid_input_secret: "Der Turnstile-Geheimparameter war ungültig, existierte nicht oder ist ein Test-Geheimschlüssel mit einer Nicht-Test-Antwort."
7
+ missing_input_response: "Der Turnstile-Antwortparameter wurde nicht übergeben."
8
+ invalid_input_response: "Der Turnstile-Antwortparameter ist ungültig."
9
+ bad_request: "Die Turnstile-Anfrage wurde abgelehnt, da sie fehlerhaft war."
10
+ timeout_or_duplicate: "Das Turnstile-Token wurde bereits verwendet oder ist abgelaufen."
11
+ internal_error: "Bei der Turnstile-Validierung ist ein interner Fehler aufgetreten. Bitte versuchen Sie es erneut."
@@ -0,0 +1,11 @@
1
+ en:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "We could not verify that you're human. Please try again."
5
+ missing_input_secret: "Turnstile secret key missing."
6
+ invalid_input_secret: "Turnstile secret parameter was invalid, did not exist, or is a testing secret key with a non-testing response."
7
+ missing_input_response: "Turnstile response parameter was not passed."
8
+ invalid_input_response: "Turnstile response parameter is invalid."
9
+ bad_request: "Turnstile request was rejected because it was malformed."
10
+ timeout_or_duplicate: "Turnstile token has already been used or expired."
11
+ internal_error: "Turnstile internal error occurred while validating the response. Please try again."
@@ -0,0 +1,11 @@
1
+ es:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "No pudimos verificar que eres humano. Por favor, inténtalo de nuevo."
5
+ missing_input_secret: "Falta la clave secreta de Turnstile."
6
+ invalid_input_secret: "El parámetro secreto de Turnstile no es válido, no existe, o es una clave de prueba con una respuesta que no es de prueba."
7
+ missing_input_response: "No se proporcionó el parámetro de respuesta de Turnstile."
8
+ invalid_input_response: "El parámetro de respuesta de Turnstile no es válido."
9
+ bad_request: "La solicitud de Turnstile fue rechazada porque estaba mal formada."
10
+ timeout_or_duplicate: "El token de Turnstile ya ha sido utilizado o ha expirado."
11
+ internal_error: "Ocurrió un error interno de Turnstile al validar la respuesta. Por favor, inténtalo de nuevo."
@@ -0,0 +1,11 @@
1
+ fr:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "Nous n'avons pas pu vérifier que vous êtes humain. Veuillez réessayer."
5
+ missing_input_secret: "La clé secrète Turnstile est manquante."
6
+ invalid_input_secret: "Le paramètre secret Turnstile était invalide, n'existait pas, ou est une clé de test avec une réponse de non-test."
7
+ missing_input_response: "Le paramètre de réponse Turnstile n'a pas été fourni."
8
+ invalid_input_response: "Le paramètre de réponse Turnstile est invalide."
9
+ bad_request: "La requête Turnstile a été rejetée car elle était mal formée."
10
+ timeout_or_duplicate: "Le jeton Turnstile a déjà été utilisé ou a expiré."
11
+ internal_error: "Une erreur interne Turnstile s'est produite lors de la validation de la réponse. Veuillez réessayer."
@@ -0,0 +1,11 @@
1
+ it:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "Non siamo riusciti a verificare che sei umano. Per favore riprova."
5
+ missing_input_secret: "La chiave segreta Turnstile è mancante."
6
+ invalid_input_secret: "Il parametro segreto Turnstile non era valido, non esisteva, o è una chiave di test con una risposta non di test."
7
+ missing_input_response: "Il parametro di risposta Turnstile non è stato fornito."
8
+ invalid_input_response: "Il parametro di risposta Turnstile non è valido."
9
+ bad_request: "La richiesta Turnstile è stata rifiutata perché era malformata."
10
+ timeout_or_duplicate: "Il token Turnstile è già stato utilizzato o è scaduto."
11
+ internal_error: "Si è verificato un errore interno Turnstile durante la convalida della risposta. Per favore riprova."
@@ -0,0 +1,11 @@
1
+ ja:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "あなたが人間であることを確認できませんでした。もう一度お試しください。"
5
+ missing_input_secret: "Turnstileシークレットキーがありません。"
6
+ invalid_input_secret: "Turnstileシークレットパラメータが無効であるか、存在しないか、またはテストキーで非テストレスポンスが使用されています。"
7
+ missing_input_response: "Turnstileレスポンスパラメータが提供されていません。"
8
+ invalid_input_response: "Turnstileレスポンスパラメータが無効です。"
9
+ bad_request: "Turnstileリクエストは形式が不正なため拒否されました。"
10
+ timeout_or_duplicate: "Turnstileトークンは既に使用されたか、有効期限が切れています。"
11
+ internal_error: "レスポンスの検証中にTurnstile内部エラーが発生しました。もう一度お試しください。"
@@ -0,0 +1,11 @@
1
+ ko:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "사용자가 사람인지 확인할 수 없습니다. 다시 시도해 주세요."
5
+ missing_input_secret: "Turnstile 비밀 키가 없습니다."
6
+ invalid_input_secret: "Turnstile 비밀 매개변수가 유효하지 않거나, 존재하지 않거나, 테스트 키로 비테스트 응답을 사용했습니다."
7
+ missing_input_response: "Turnstile 응답 매개변수가 제공되지 않았습니다."
8
+ invalid_input_response: "Turnstile 응답 매개변수가 유효하지 않습니다."
9
+ bad_request: "Turnstile 요청이 잘못된 형식으로 인해 거부되었습니다."
10
+ timeout_or_duplicate: "Turnstile 토큰이 이미 사용되었거나 만료되었습니다."
11
+ internal_error: "응답 검증 중 Turnstile 내부 오류가 발생했습니다. 다시 시도해 주세요."
@@ -0,0 +1,11 @@
1
+ nl:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "We konden niet verifiëren dat je een mens bent. Probeer het opnieuw."
5
+ missing_input_secret: "De geheime Turnstile-sleutel ontbreekt."
6
+ invalid_input_secret: "De geheime Turnstile-parameter was ongeldig, bestond niet, of is een testsleutel met een niet-testrespons."
7
+ missing_input_response: "De Turnstile-responsparameter is niet opgegeven."
8
+ invalid_input_response: "De Turnstile-responsparameter is ongeldig."
9
+ bad_request: "Het Turnstile-verzoek is afgewezen omdat het onjuist was geformuleerd."
10
+ timeout_or_duplicate: "Het Turnstile-token is al gebruikt of verlopen."
11
+ internal_error: "Er is een interne Turnstile-fout opgetreden bij het valideren van de respons. Probeer het opnieuw."
@@ -0,0 +1,11 @@
1
+ pl:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "Nie udało się zweryfikować, że jesteś człowiekiem. Spróbuj ponownie."
5
+ missing_input_secret: "Brak klucza tajnego Turnstile."
6
+ invalid_input_secret: "Parametr tajny Turnstile był nieprawidłowy, nie istniał lub jest kluczem testowym z odpowiedzią nietestową."
7
+ missing_input_response: "Nie podano parametru odpowiedzi Turnstile."
8
+ invalid_input_response: "Parametr odpowiedzi Turnstile jest nieprawidłowy."
9
+ bad_request: "Żądanie Turnstile zostało odrzucone, ponieważ było nieprawidłowo sformułowane."
10
+ timeout_or_duplicate: "Token Turnstile został już użyty lub wygasł."
11
+ internal_error: "Wystąpił wewnętrzny błąd Turnstile podczas weryfikacji odpowiedzi. Spróbuj ponownie."
@@ -0,0 +1,11 @@
1
+ pt:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "Não foi possível verificar que você é humano. Por favor, tente novamente."
5
+ missing_input_secret: "A chave secreta do Turnstile está ausente."
6
+ invalid_input_secret: "O parâmetro secreto do Turnstile era inválido, não existia, ou é uma chave de teste com uma resposta que não é de teste."
7
+ missing_input_response: "O parâmetro de resposta do Turnstile não foi fornecido."
8
+ invalid_input_response: "O parâmetro de resposta do Turnstile é inválido."
9
+ bad_request: "A solicitação do Turnstile foi rejeitada porque estava malformada."
10
+ timeout_or_duplicate: "O token do Turnstile já foi usado ou expirou."
11
+ internal_error: "Ocorreu um erro interno do Turnstile ao validar a resposta. Por favor, tente novamente."
@@ -0,0 +1,11 @@
1
+ ru:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "Не удалось подтвердить, что вы человек. Пожалуйста, попробуйте ещё раз."
5
+ missing_input_secret: "Отсутствует секретный ключ Turnstile."
6
+ invalid_input_secret: "Секретный параметр Turnstile недействителен, не существует или является тестовым ключом с нетестовым ответом."
7
+ missing_input_response: "Параметр ответа Turnstile не был передан."
8
+ invalid_input_response: "Недопустимый параметр ответа Turnstile."
9
+ bad_request: "Запрос Turnstile был отклонён из-за неверного формата."
10
+ timeout_or_duplicate: "Токен Turnstile уже был использован или истёк."
11
+ internal_error: "Произошла внутренняя ошибка Turnstile при проверке ответа. Пожалуйста, попробуйте ещё раз."
@@ -0,0 +1,11 @@
1
+ tr:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "İnsan olduğunuzu doğrulayamadık. Lütfen tekrar deneyin."
5
+ missing_input_secret: "Turnstile gizli anahtarı eksik."
6
+ invalid_input_secret: "Turnstile gizli parametresi geçersizdi, mevcut değildi veya test anahtarı test dışı bir yanıtla kullanıldı."
7
+ missing_input_response: "Turnstile yanıt parametresi sağlanmadı."
8
+ invalid_input_response: "Turnstile yanıt parametresi geçersiz."
9
+ bad_request: "Turnstile isteği hatalı biçimlendirildiği için reddedildi."
10
+ timeout_or_duplicate: "Turnstile jetonu zaten kullanılmış veya süresi dolmuş."
11
+ internal_error: "Yanıt doğrulanırken Turnstile dahili hatası oluştu. Lütfen tekrar deneyin."
@@ -0,0 +1,11 @@
1
+ zh:
2
+ cloudflare_turnstile:
3
+ errors:
4
+ default: "我们无法验证您是人类。请重试。"
5
+ missing_input_secret: "缺少 Turnstile 密钥。"
6
+ invalid_input_secret: "Turnstile 密钥参数无效、不存在,或者是测试密钥却使用了非测试响应。"
7
+ missing_input_response: "未提供 Turnstile 响应参数。"
8
+ invalid_input_response: "Turnstile 响应参数无效。"
9
+ bad_request: "Turnstile 请求因格式错误而被拒绝。"
10
+ timeout_or_duplicate: "Turnstile 令牌已被使用或已过期。"
11
+ internal_error: "验证响应时发生 Turnstile 内部错误。请重试。"
@@ -1,7 +1,7 @@
1
1
  module Cloudflare
2
2
  module Turnstile
3
3
  module Rails
4
- VERSION = '0.9.2'.freeze
4
+ VERSION = '0.10.1'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudflare-turnstile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Kononov
@@ -45,6 +45,20 @@ files:
45
45
  - lib/cloudflare/turnstile/rails/controller_methods.rb
46
46
  - lib/cloudflare/turnstile/rails/engine.rb
47
47
  - lib/cloudflare/turnstile/rails/helpers.rb
48
+ - lib/cloudflare/turnstile/rails/locales/cs.yml
49
+ - lib/cloudflare/turnstile/rails/locales/de.yml
50
+ - lib/cloudflare/turnstile/rails/locales/en.yml
51
+ - lib/cloudflare/turnstile/rails/locales/es.yml
52
+ - lib/cloudflare/turnstile/rails/locales/fr.yml
53
+ - lib/cloudflare/turnstile/rails/locales/it.yml
54
+ - lib/cloudflare/turnstile/rails/locales/ja.yml
55
+ - lib/cloudflare/turnstile/rails/locales/ko.yml
56
+ - lib/cloudflare/turnstile/rails/locales/nl.yml
57
+ - lib/cloudflare/turnstile/rails/locales/pl.yml
58
+ - lib/cloudflare/turnstile/rails/locales/pt.yml
59
+ - lib/cloudflare/turnstile/rails/locales/ru.yml
60
+ - lib/cloudflare/turnstile/rails/locales/tr.yml
61
+ - lib/cloudflare/turnstile/rails/locales/zh.yml
48
62
  - lib/cloudflare/turnstile/rails/railtie.rb
49
63
  - lib/cloudflare/turnstile/rails/verification.rb
50
64
  - lib/cloudflare/turnstile/rails/version.rb