Module: I18nProofreading
- Defined in:
- lib/i18n_proofreading.rb,
lib/i18n_proofreading/seeds.rb,
lib/i18n_proofreading/engine.rb,
lib/i18n_proofreading/widget.rb,
lib/i18n_proofreading/marking.rb,
lib/i18n_proofreading/version.rb,
lib/i18n_proofreading/middleware.rb,
lib/i18n_proofreading/configuration.rb,
app/models/i18n_proofreading/suggestion.rb,
app/helpers/i18n_proofreading/tag_helper.rb,
app/models/i18n_proofreading/application_record.rb,
app/controllers/i18n_proofreading/widgets_controller.rb,
app/controllers/i18n_proofreading/application_controller.rb,
app/controllers/i18n_proofreading/suggestions_controller.rb,
lib/generators/i18n_proofreading/install/install_generator.rb
Overview
In-context translation proofreading for Rails. Renders each i18n key alongside its text in the chosen environments, lets a proofreader click any string and suggest a better wording, and stores the suggestions for a developer to apply.
Defined Under Namespace
Modules: Generators, Marking, Seeds, TagHelper, Widget Classes: ApplicationController, ApplicationRecord, Configuration, Engine, Middleware, Suggestion, SuggestionsController, WidgetsController
Constant Summary collapse
- VERSION =
'0.10.6'
Class Method Summary collapse
-
.admin?(request) ⇒ Boolean
May this request browse and triage the dashboard? Independent of
available?— the dashboard has its own gate so maintainers can review suggestions from production even where the widget itself is off. -
.available?(request) ⇒ Boolean
Is the tool available for this request? True only in an enabled environment and when the host's
enabledpredicate passes. - .config ⇒ Object
- .configure {|config| ... } ⇒ Object
Class Method Details
.admin?(request) ⇒ Boolean
May this request browse and triage the dashboard? Independent of
available? — the dashboard has its own gate so maintainers can review
suggestions from production even where the widget itself is off.
34 35 36 |
# File 'lib/i18n_proofreading.rb', line 34 def admin?(request) !!config..call(request) end |
.available?(request) ⇒ Boolean
Is the tool available for this request? True only in an enabled environment
and when the host's enabled predicate passes. Checked on the server for
every marker, endpoint, and injection, so the client can never turn it on.
27 28 29 |
# File 'lib/i18n_proofreading.rb', line 27 def available?(request) config.environment_enabled? && !!config.enabled.call(request) end |
.config ⇒ Object
16 17 18 |
# File 'lib/i18n_proofreading.rb', line 16 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
20 21 22 |
# File 'lib/i18n_proofreading.rb', line 20 def configure yield config end |