getBaseLocaleJson method

Map<String, String>? getBaseLocaleJson()

Implementation

Map<String, String>? getBaseLocaleJson() {
  final baseLocale = _configManager.baseLocale;
  if (isVerbose) stdout.writeln('📂 baseLocale: $baseLocale');
  final localFile = getFileByLocale(baseLocale);
  if (isVerbose) stdout.writeln('📂 Found base locale file: ${localFile?.path}');
  final baseLocaleContent = localFile?.readAsStringSync();
  if (baseLocaleContent == null || baseLocaleContent.isEmpty) {
    return null;
  }
  final contents = Map<String, String>.from(jsonDecode(baseLocaleContent));
  return contents..removeWhere((key, value) => key.startsWith('@'));
}