mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
fix: Move copying translation files before npm run build in Docker (#30099)
This commit is contained in:
@@ -45,10 +45,10 @@ const ROOT_DIR = path.resolve(__dirname, '..');
|
||||
const TRANSLATIONS_DIR = path.resolve(__dirname, '../superset/translations');
|
||||
|
||||
const getAvailableTranslationCodes = () => {
|
||||
const LOCALE_CODE_MAPPING = {
|
||||
zh: 'zh-cn',
|
||||
};
|
||||
try {
|
||||
if (process.env.BUILD_TRANSLATIONS === 'true') {
|
||||
const LOCALE_CODE_MAPPING = {
|
||||
zh: 'zh-cn',
|
||||
};
|
||||
const files = fs.readdirSync(TRANSLATIONS_DIR);
|
||||
return files
|
||||
.filter(file =>
|
||||
@@ -57,10 +57,9 @@ const getAvailableTranslationCodes = () => {
|
||||
.filter(dirName => !dirName.startsWith('__'))
|
||||
.map(dirName => dirName.replace('_', '-'))
|
||||
.map(dirName => LOCALE_CODE_MAPPING[dirName] || dirName);
|
||||
} catch (err) {
|
||||
console.error('Error reading the directory:', err);
|
||||
return [];
|
||||
}
|
||||
// Indicates to the MomentLocalesPlugin that we only want to keep 'en'.
|
||||
return [];
|
||||
};
|
||||
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user