Skip to content

Commit cd33aa9

Browse files
authored
tweak: format base locale with slang normalize (#344)
1 parent e3ef616 commit cd33aa9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

slang/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,6 +1822,8 @@ dart run slang edit <type> <params...>
18221822
To keep the order of the keys consistent, you can normalize the translations.
18231823
They will follow the same order as the base locale.
18241824

1825+
As a side effect, this command also reformats the translation file/files.
1826+
18251827
```sh
18261828
dart run slang normalize [--locale=fr-FR]
18271829
```

slang/lib/src/runner/normalize.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import 'package:slang/src/utils/log.dart' as log;
1111
const _supportedFiles = [FileType.json, FileType.yaml];
1212

1313
/// Normalizes the translation files according to the base locale.
14+
///
15+
/// As a side effect, this command also reformats the translation file/files.
1416
Future<void> runNormalize({
1517
required SlangFileCollection fileCollection,
1618
required List<String> arguments,
@@ -40,10 +42,6 @@ Future<void> runNormalize({
4042
log.info('Target: all locales');
4143

4244
for (final locale in translationMap.getLocales()) {
43-
if (locale == fileCollection.config.baseLocale) {
44-
continue;
45-
}
46-
4745
await _normalizeLocale(
4846
fileCollection: fileCollection,
4947
locale: locale,

0 commit comments

Comments
 (0)