Module: I18nFeedback

Defined in:
lib/i18n_feedback.rb,
lib/i18n_feedback/engine.rb,
lib/i18n_feedback/widget.rb,
lib/i18n_feedback/marking.rb,
lib/i18n_feedback/version.rb,
lib/i18n_feedback/middleware.rb,
lib/i18n_feedback/configuration.rb,
app/models/i18n_feedback/suggestion.rb,
app/helpers/i18n_feedback/tag_helper.rb,
app/models/i18n_feedback/application_record.rb,
app/controllers/i18n_feedback/application_controller.rb,
app/controllers/i18n_feedback/suggestions_controller.rb,
lib/generators/i18n_feedback/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, TagHelper, Widget Classes: ApplicationController, ApplicationRecord, Configuration, Engine, Middleware, Suggestion, SuggestionsController

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.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.

Returns:

  • (Boolean)


26
27
28
# File 'lib/i18n_feedback.rb', line 26

def available?(request)
  config.environment_enabled? && !!config.enabled.call(request)
end

.configObject



15
16
17
# File 'lib/i18n_feedback.rb', line 15

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



19
20
21
# File 'lib/i18n_feedback.rb', line 19

def configure
  yield config
end