Module: Bisu
- Extended by:
- Bisu
- Included in:
- Bisu
- Defined in:
- lib/bisu.rb,
lib/bisu/config.rb,
lib/bisu/logger.rb,
lib/bisu/version.rb,
lib/bisu/localizer.rb,
lib/bisu/dictionary.rb,
lib/bisu/source/url.rb,
lib/bisu/source/tolgee.rb,
lib/bisu/source/one_sky.rb,
lib/bisu/source/google_sheet.rb
Defined Under Namespace
Modules: Logger, Source Classes: Config, Dictionary, Localizer
Constant Summary collapse
- VERSION =
'2.3.0'
- VERSION_UPDATED_AT =
'2024-03-20'
Instance Method Summary collapse
Instance Method Details
#run(options) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bisu.rb', line 19 def run() = () if config_file = open_file("translatable.yml", "r", true) config = Bisu::Config.new(hash: YAML::load(config_file)) dictionary = dictionary_for(config: config.dictionary, options: ) localizer = Bisu::Localizer.new(dictionary, config.type) config.localize_files do |in_path, out_path, locale, language, fallback_language| unless dictionary.has_language?(language) Logger.error("Unknown language #{language}") return false end fallback_languages = ([fallback_language] + [[:default_language]]).compact localize_file(localizer, locale, language, fallback_languages, in_path, out_path) end end Logger.print_summary if [:strict] && Logger.summary[:warn] > 0 Logger.error("Found a warning while in strict mode") end end |