load static method

Instantiate language configuration.

Implementation

static Future<LanguageConfig> load(Language lang) async {
  final path = 'packages/hyphenatorx/assets/${lang.name}.json';

  final data =
    await rootBundle.loadStructuredData<Map<String, dynamic>>(path, (e) async => json.decode(e));

  return LanguageConfig(data);
}