Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNV-37597: Fix i18n in pre-commit #1932

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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ console-extensions.md
!.yarn/versions
.idea/
scripts/ca.crt
scripts/console-client-secret
scripts/console-client-secret
*.json-*
7 changes: 6 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
git add locales/en/plugin__kubevirt-plugin.json

translation_file_diff=$(git diff --name-only locales/en/plugin__kubevirt-plugin.json)

if [ -n "$translation_file_diff" ]; then
git add $translation_file_diff
fi
6 changes: 4 additions & 2 deletions i18n-scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ module.exports = {
try {
const files = await fs.promises.readdir(directory);
for (const file of files) {
const filePath = path.join(directory, file);
argFunction(filePath, packageDir);
if (!file.endsWith("-r")) {
const filePath = path.join(directory, file);
argFunction(filePath, packageDir);
}
}
} catch (e) {
console.error(`Failed to parseFolder ${directory}:`, e);
Expand Down
Loading