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,
lib/generators/i18n_proofreading/migration_helpers.rb,
app/controllers/i18n_proofreading/widgets_controller.rb,
app/controllers/i18n_proofreading/dashboard_controller.rb,
app/controllers/i18n_proofreading/application_controller.rb,
app/controllers/i18n_proofreading/submissions_controller.rb,
app/controllers/i18n_proofreading/suggestions_controller.rb,
app/controllers/concerns/i18n_proofreading/request_context.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, RequestContext, Seeds, TagHelper, Widget Classes: ApplicationController, ApplicationRecord, Configuration, DashboardController, Engine, Middleware, SubmissionsController, Suggestion, SuggestionsController, WidgetsController
Constant Summary collapse
- VERSION =
'0.11.2'
Class Method Summary collapse
- .admin?(request) ⇒ Boolean
-
.available?(request) ⇒ Boolean
Is the tool available for this request? True only in an enabled environment and when the host's
enabledpredicate passes. -
.base_controller ⇒ Object
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. - .config ⇒ Object
- .configure {|config| ... } ⇒ Object
Class Method Details
.admin?(request) ⇒ Boolean
42 43 44 |
# File 'lib/i18n_proofreading.rb', line 42 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 |
.base_controller ⇒ Object
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.
The class I18nProofreading::DashboardController inherits from. Resolved on
every call rather than memoized, so a host that reassigns
base_controller_class in a reloadable initializer is not pinned to a stale,
unloaded constant.
38 39 40 |
# File 'lib/i18n_proofreading.rb', line 38 def base_controller config.base_controller_class.to_s.constantize 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 |