-
Notifications
You must be signed in to change notification settings - Fork 187
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
Review GHA for i18n consistency check #551
Conversation
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.
@yuhattor left a couple of questions inline in this PR.
Note that I only read this script once, so I only have a rudimentary idea so far about how it works.
@@ -79,6 +80,7 @@ jobs: | |||
fi | |||
done | |||
- name: Create Issue | |||
if: ${{ <expression> }} |
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.
This is not working as is.
However i was wondering if here we could test for the existence of issue.md
and only run this entire step if that file exists?
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.
That implementation should be in place below, but it doesn't seem to be working.
If there were a similar issue, it would update the new edits as a comment to that issue, so that a new issue would not be created.
Also, since the script is doing the checking for the issue's existence here, there should be an Action in the previous section to make that determination. The process would be like splitting the existing code.
if expr "$existing_issue_id" : '^[0-9]*$' >/dev/null; then
gh issue comment "$existing_issue_id" -F issue.md -R $GITHUB_REPOSITORY
else
gh issue create -t "$issue_title" -F issue.md -R $GITHUB_REPOSITORY -l documentation
fi
Sorry for being late to reply. I'm starting to review now! Thank you for your PR! |
…y again * Refactor code * FIx bugs * Update token * Update scripts * Small fix
@spier Please check my update on this So far, it has worked properly.
Here's sample |
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.
Thanks for your work on this @yuhattor.
I think I found (and fixed) some bugs.
Also added some more documentation.
# Get the translated file name and check if it exists | ||
i18n_filename=$(echo "$file" | sed 's/patterns\/2-structured/translation\/${{matrix.language}}\/patterns/g') | ||
# Declare the flags | ||
declare -A flags=( ["ja"]=":jp: Japanese" ["zh"]=":cn: Chinese") |
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.
Where to lookup the icons to use here?
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.
content_header=$(echo "$(cat "$file")" | grep -E '^title+' | sort -r | head -n1) | ||
|
||
if [[ $((original_updated_at - i18n_content_updated_at)) -ge 1 ]]; then | ||
content_header=$(grep -E '^title+' "$file" | sort -r | head -n1) |
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.
Doesn't look like the title extract works right now
However let's leave this in here, as we may be adding a frontmatter to all patterns anyways, at which point this should work :)
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.
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.
Very pretty!
Thank you for the addition, will comment on it soon...! |
LGTM! thanks Co-authored-by: Sebastian Spier <[email protected]>
Co-authored-by: Sebastian Spier <[email protected]>
LGTM! Co-authored-by: Sebastian Spier <[email protected]>
Thank you for working on this @yuhattor! Please approve the PR when it looks good to go from your side. |
Thank you! After some aditions... Now I confirmed that it works properly. Thank you @spier for the contribution!! |
This PR is making minor cosmetic modifications to the new GHA that checks the consistency of the translations.
See file:
.github/workflows/i18n-consistency-checker.yaml
Main purpose of this PR is for me to understand what the GHA does, and to allow me to ask question to @yuhattor (who created this GHA). That way we have some written documentation that others can refer to later.