Skip to content

Commit

Permalink
Fix ts definitions for locale pt-BR (#524)
Browse files Browse the repository at this point in the history
Co-authored-by: REYES LOPEZ, HECTOR <hector.reyes@gruposantander.com>
  • Loading branch information
hreyeslo and REYES LOPEZ, HECTOR committed Mar 5, 2024
1 parent 1473534 commit f74de4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@babel/preset-env": "^7.20.2",
"@popperjs/core": "^2.10.2",
"@testing-library/jest-dom": "^5.16.1",
"@types/lodash": "^4.14.191",
"animejs": "^3.2.1",
"autoprefixer": "^10.4.13",
"babel-eslint": "^10.1.0",
Expand All @@ -33,6 +34,7 @@
"glob": "^7.1.7",
"html-webpack-plugin": "^5.3.1",
"jest": "^26.6.3",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^1.6.0",
"node-gzip": "^1.1.2",
"open-cli": "^6.0.1",
Expand Down
3 changes: 2 additions & 1 deletion scripts/generateLocaleTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const readdir = util.promisify(fs.readdir);
const writeFile = util.promisify(fs.writeFile);
const readFile = util.promisify(fs.readFile);
const ejs = require('ejs');
const _ = require('lodash');

let srcPath = path.resolve(__dirname, '../src');
let distPath = path.resolve(__dirname, '../dist/locale');
Expand All @@ -17,7 +18,7 @@ module.exports = async () => {
return fileNames.map((fileName) => {
let localeName = fileName.replace(/\.js/, '');
let typeName = `${localeName}.d.ts`;
return writeFile(path.join(distPath, typeName), ejs.render(template, {locale: localeName}));
return writeFile(path.join(distPath, typeName), ejs.render(template, {locale: _.camelCase(localeName)}));
});
};

Expand Down

0 comments on commit f74de4c

Please sign in to comment.