Class: PolyglotFlutter::IO::L10n

Inherits:
Object
  • Object
show all
Defined in:
lib/flutter_polyglot_cli/io/l10n.rb

Class Method Summary collapse

Class Method Details

.write(l10n_path, arb_path, mandatory_language, output_localization_file) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/flutter_polyglot_cli/io/l10n.rb', line 6

def write(l10n_path, arb_path, mandatory_language, output_localization_file)
  data = {
      'arb-dir' => arb_path,
      'template-arb-file' => "intl_#{mandatory_language.downcase}.arb",
      'output-localization-file' => "#{output_localization_file}.dart",
  }
  File.open(l10n_path, 'w') { |file| YAML.dump(data, file) }
end