Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"paths": {
"<%= camelCase(name) %>": "./"
}
},
"translations": [
"translations/zh-CN.json"
]
}
10 changes: 6 additions & 4 deletions src/legacy/server/i18n/get_translations_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ export async function getTranslationPaths({ cwd, glob }) {
try {
const content = await readFileAsync(entryFullPath, 'utf8');
const { translations } = JSON.parse(content);
translations.forEach(translation => {
const translationFullPath = resolve(pluginBasePath, translation);
translationPaths.push(translationFullPath);
});
if (translations && translations.length) {
translations.forEach(translation => {
const translationFullPath = resolve(pluginBasePath, translation);
translationPaths.push(translationFullPath);
});
}
} catch (err) {
throw new Error(`Failed to parse .i18nrc.json file at ${entryFullPath}`);
}
Expand Down