Skip to content

Commit 4fc27da

Browse files
committed
feat: replexica show files now shows both source and target paths
1 parent 44b4cca commit 4fc27da

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.changeset/green-swans-flash.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@replexica/cli": minor
3+
"replexica": minor
4+
---
5+
6+
replexica show files now shows both source and target paths

packages/cli/src/cli/show/files.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ export default new Command()
2525
const buckets = getBuckets(i18nConfig);
2626
for (const bucket of buckets) {
2727
for (const pathPattern of bucket.pathPatterns) {
28-
const sourcePathPattern = pathPattern.replace(/\[locale\]/g, i18nConfig.locale.source);
29-
console.log(sourcePathPattern);
28+
const sourcePath = pathPattern.replace(/\[locale\]/g, i18nConfig.locale.source);
29+
const targetPaths = i18nConfig.locale.targets.map((targetLocale) => pathPattern.replace(/\[locale\]/g, targetLocale));
30+
[sourcePath, ...targetPaths]
31+
.forEach((path) => {
32+
console.log(path);
33+
});
3034
}
3135
}
3236
} catch (error: any) {

0 commit comments

Comments
 (0)