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

mgr/dashboard: Add i18n validation script #25179

Merged
merged 1 commit into from Nov 28, 2018
Merged

Conversation

tspmelo
Copy link
Contributor

@tspmelo tspmelo commented Nov 20, 2018

This will check if there are new strings and ask the developer to commit those.

Signed-off-by: Tiago Melo <tmelo@suse.com>

Copy link
Member

@callithea callithea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the script locally, worked for me :)

count=`git status | grep "messages.xlf" -c`

if [ $count == 1 ]; then
echo "Please run 'npm run i18n' and commit the modified 'messages.xlf' file."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point npm run i18n has already been run and messages.xlf is up to date, isn't it?

Suggested change
echo "Please run 'npm run i18n' and commit the modified 'messages.xlf' file."
echo "The translation template file 'messages.xlf' has been modified. Please commit the changes."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is more focused in being used in jenkins, so this message is going to be read after a failing ceph dashboard tests. Then the developer will need to run the script locally.

@tspmelo
Copy link
Contributor Author

tspmelo commented Nov 22, 2018

I moved the validation to the existing run-frontend-unittests.sh, this will reduce the number of scripts we need to run.
The change is in a temporary commit, if everyone agrees with the changes I will squash them.

@tspmelo
Copy link
Contributor Author

tspmelo commented Nov 22, 2018

@p-na I added a new validation to run-frontend-unittests.sh that will check if the strings have any extra white-space in the beginning or end of the string.

Copy link
Contributor

@LenzGr LenzGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you.

@tchaikov
Copy link
Contributor

retest this please

This will check if there are new strings, validate them and ask the developer
to commit and fix those.

Signed-off-by: Tiago Melo <tmelo@suse.com>
Copy link
Member

@s0nea s0nea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me :)

@LenzGr LenzGr merged commit ebd9a16 into ceph:master Nov 28, 2018
@tspmelo tspmelo deleted the wip-check-i18n branch November 28, 2018 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants