Skip to content

Commit

Permalink
fix error reading any locales folder
Browse files Browse the repository at this point in the history
  • Loading branch information
apinprastya committed Aug 19, 2019
1 parent 1c90fe2 commit 3790ea8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.1.2

- fix extension read all json from any locales folder

## 0.1.1

- hot fix generate not working
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "flutter-internationalize",
"displayName": "flutter-internationalize",
"description": "Flutter internationalizing tools",
"version": "0.1.1",
"version": "0.1.2",
"publisher": "apin",
"author": "Apin Prastya <apin.klas@gmail.com> (https://lekapin.com)",
"icon": "resources/icon.png",
Expand Down
4 changes: 2 additions & 2 deletions src/localemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LocaleManager {
if (folders.length == 1) {
this.rootPath = folders[0].uri.path;
this.rootFsPath = folders[0].uri.fsPath;
const a = await workspace.findFiles('**/locales/desc.json', '**/flutter_assets/locales/*.json', 5)
const a = await workspace.findFiles('locales/desc.json', null, 5)
if (a.length === 0) {
if (!fs.existsSync(path.join(this.rootFsPath, 'locales')))
fs.mkdirSync(path.join(this.rootFsPath, 'locales'))
Expand Down Expand Up @@ -74,7 +74,7 @@ class LocaleManager {
async readLocaleFile(descFileUri) {
this.description = await this.loadText(descFileUri);
this.load(this.description, true)
const allLocFiles = (await workspace.findFiles('**/locales/*.json', '**/flutter_assets/locales/*.json', 50)).
const allLocFiles = (await workspace.findFiles('locales/*.json', null, 50)).
filter(v => !v.path.endsWith('desc.json') && !path.basename(v.path).startsWith('text_'))
this.totalCount = allLocFiles.length;
allLocFiles.forEach(v => {
Expand Down

0 comments on commit 3790ea8

Please sign in to comment.