Skip to content

Commit 55ad0ff

Browse files
authored
Merge pull request #30 from shovelmn12/master
Feature: Multi base file support
2 parents 8c75419 + 96f505e commit 55ad0ff

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.1.1
2+
3+
- add multi base file support (by [shovelmn12](https://github.com/MohiuddinM/i18n/pull/30))
4+
15
## 4.1.0
26

37
- add doc comments for generated keys (by [chenasraf](https://github.com/MohiuddinM/i18n/pull/29))

lib/builder.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ class YamlBasedBuilder implements Builder {
4040

4141
final allFiles = await buildStep.findAssets(Glob('**.i18n.yaml')).toList();
4242
final defaultFile = allFiles.firstWhere(
43-
(e) => !e.uri.pathSegments.last.contains('_'),
43+
(e) {
44+
final name = e.uri.pathSegments.last.replaceAll(".i18n.yaml", "");
45+
46+
return !name.contains('_') && currentFile.pathSegments.last.replaceAll(".i18n.yaml", "").startsWith(name);
47+
},
4448
);
4549

4650
if (currentFile != defaultFile) {

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: i18n
22
description: Simple i18n solution for dart and flutter. Uses code generation to generate translations as dart classes. Efficient and works with autocomplete!
3-
version: 4.1.0
3+
version: 4.1.1
44
homepage: https://github.com/MohiuddinM/i18n
55

66
environment:

0 commit comments

Comments
 (0)