Module: Locallingo

Defined in:
lib/locallingo.rb,
lib/locallingo/cli.rb,
lib/locallingo/manager.rb,
lib/locallingo/rubocop.rb,
lib/locallingo/version.rb,
lib/locallingo/reporter.rb,
lib/locallingo/settings.rb,
lib/locallingo/state_store.rb,
lib/locallingo/configuration.rb,
lib/locallingo/key_flattener.rb,
lib/locallingo/json_extraction.rb,
lib/locallingo/quality_checker.rb,
lib/locallingo/providers/ruby_llm.rb,
lib/locallingo/validators/missing.rb,
lib/locallingo/quality/terminology.rb,
lib/locallingo/validators/outdated.rb,
lib/locallingo/quality/static_rules.rb,
lib/locallingo/validators/manual_edits.rb,
lib/locallingo/quality/british_spellings.rb,
lib/locallingo/validators/duplicate_values.rb

Overview

Locallingo — AI-assisted i18n translation, drift detection and quality linting.

The public entry points are the lingo CLI (exe/lingo → Locallingo::CLI) and, programmatically, Locallingo::Manager / Locallingo::QualityChecker, both driven by a Locallingo::Configuration loaded from .locallingo.yml.

Defined Under Namespace

Modules: JsonExtraction, KeyFlattener, Providers, Quality, RuboCop, Validators Classes: CLI, Configuration, Error, Manager, MissingCredentialsError, QualityChecker, Reporter, Settings, StateStore

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.configuration(root_path: Dir.pwd, package: nil) ⇒ Object

Load the configuration for root_path (defaults to the current directory), optionally scoped to a package path from the packages: list.



36
37
38
# File 'lib/locallingo.rb', line 36

def self.configuration(root_path: Dir.pwd, package: nil)
  Configuration.load(root_path:, package:)
end

.configure {|settings| ... } ⇒ Object

Configure the gem from Ruby — the credentials path for apps whose keys don't live in ENV (call it from a Rails initializer or a .locallingo.rb setup file next to .locallingo.yml; the CLI loads the latter on start).

Yields:



48
49
50
51
# File 'lib/locallingo.rb', line 48

def self.configure
  yield settings
  settings
end

.reset_settings!Object



53
54
55
# File 'lib/locallingo.rb', line 53

def self.reset_settings!
  @settings = nil
end

.settingsObject

Code-level settings (provider credentials) — see Locallingo::Settings.



41
42
43
# File 'lib/locallingo.rb', line 41

def self.settings
  @settings ||= Settings.new
end