Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Commit

Permalink
Release 0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
bauerj committed Dec 15, 2020
1 parent c1c4740 commit dd40a24
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions bin/release.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'dart:convert';
import 'dart:io';

import 'package:i18n_extension/i18n_getstrings.dart';

void main(List<String> arguments) async {
var strings = GetI18nStrings("./lib").run();
for (var translationFile in new Directory('./assets/locales/').listSync()) {
var translation =
json.decode(new File(translationFile.path).readAsStringSync());
for (var source in strings) {
var i = 0;
if (!translation.containsKey(source)) {
translation[source] = null;
i++;
}
if (i>0) {
print("$i new string(s) to translate in $translationFile");
JsonEncoder encoder = new JsonEncoder.withIndent(' '*4);
File(translationFile.path).writeAsStringSync(encoder.convert(translation));
}
}
}
}

0 comments on commit dd40a24

Please sign in to comment.