-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
chore: add locale sort/check script #5339
Conversation
✅ Deploy Preview for koda-nuxt ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls also commit the changes on locales/** after execute the script.
script/checkLocale.mjs
Outdated
table.push([key, checkResult[key]]) | ||
}) | ||
console.table(table) | ||
throw new Error('Missing Translations') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need to throw an error when executing this script. We do know that some translation keys are missing in some language files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw which key in which file by local, please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, I plan to add this script to the commit hook, but seems now we are missing plenty of keys with other locales
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roiLeo actually it will display the message in console like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compared to eslint
command we can't see the the full list here, so I'll have to run it again and again to check & fix missing keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm yes cuz we are missing a lot of translations now...
maybe we can generate a log.json
file to log all the missing locales and keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! or add a parameter to check specific file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow!
This look pretty cool
maybe we can improve table columns with more details
Integrate to CI can come later, nice work ;)
Maybe bad file format (UTF-8 BOM), should be utf-8 |
Code Climate has analyzed commit 7e6d289 and detected 0 issues on this pull request. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why but when I run the command it changes all locales files could you take a look?
@roiLeo it's expected. this script will check and sort the translation keys await resortJson()
const checkResult = await checkLocale() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ top! nice work
✅ wfm
woah |
pay 30 usd |
😍 Perfect, I’ve sent the payout 🪅 Let’s grab another issue and get rewarded! |
Thank you for your contribution to the KodaDot NFT gallery.
anyone has idea on how to integrate to CI? 🤔️
what this script do:
en
as default)👇 _ Let's make a quick check before the contribution.
PR Type
Context
Before submitting pull request, please make sure:
Optional
Had issue bounty label?
Community participation
Screenshot 📸