Skip to content

Commit

Permalink
Japanese page update (#566)
Browse files Browse the repository at this point in the history
Japanese consistency-check-update

* Update translation - content/ja/_index.md
* Update translation - content/ja/about/members.md
* Update translation - content/en/stories/_index.md
* Update translation  - content/en/community/services.md
* Update translation - content/en/about/board/_index.md
  • Loading branch information
yuhattor committed Jun 19, 2023
1 parent 8c98017 commit d6bbc54
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 75 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/i18n-consistency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,45 @@ jobs:
id: check-consistency
run: |
# Set the issue header
issue="# i18n Contents Consistency Issue\\n\\n\
issue="\
# i18n Contents Consistency Issue\\n\
\\n\
The following files may have consistency issues with the English version. Please check and update the files.\\n\
This issue is created when there is an update to content/en. It compares the git update history to let you know what updates are overdue. The issue should be closed when the update is complete.\\n\\n"
# Loop through all the files in the English directory
for file in content/en/**/*.md; do
\\n\
This issue is created when there is an update to content/en. It compares the git update history to let you know what updates are overdue. The issue should be closed when the update is complete.\\n"
for file in $(find content/en -name '*.md'); do
# Get the translated file name and check if it exists
i18n_filename=$(echo "$file" | sed -e "s/\/en\//\/${{matrix.language}}\//")
if [[ ! -e "$i18n_filename" ]]; then
continue
continue
fi
# Loop through all the files in the English directory
# Get the last updated date of the original file and the translated file
original_updated_at=$(date -d "$(git log -1 --format=%cd --date=iso $file)" +%s)
i18n_content_updated_at=$(date -d "$(git log -1 --format=%cd --date=iso $i18n_filename)" +%s)
# print the last updated date of the original file and the translated file
# Check if the translated file is updated after the original file
if [[ $(($original_updated_at - $i18n_content_updated_at)) -ge 1 ]]; then
# Get the title of the content
content_header=$(echo "$(cat "$file")" | grep -E '^title+' | sort -r | head -n1)
content_title=$(echo "$content_header" | sed 's/title: //g')
# Get the days since the translated file is overdue
days_since_overdue_updates=$(($(( $(date +%s) - $original_updated_at))/ 60 / 60 / 24))
# Get the diff between the original file and the translated file
original_last_update_hash=$(git log -1 --format=%H $file)
i18n_last_update_hash=$(git log --until i18n_content_updated_at -1 --format=%H)
result=$(echo "$(git diff ${i18n_last_update_hash} ${original_last_update_hash} $file)" | sed '1,4 s/^/# /')
# Get the parent hash of the original last update hash
parent_hash=$(git log -1 --format=%P $original_last_update_hash)
# Get the diff between the original file and the translated file
result=$(echo "$(git diff ${parent_hash} HEAD $file)" | sed '1,4 s/^/# /')
echo -e "$result"
# Add the contents to the issue.md file
issue+="<details><summary><b>$content_title</b> ($file)</summary>\\n\\n"
issue+="- Original File(en): [$file](https://github.com/$GITHUB_REPOSITORY/blob/master/$file)\\n"
Expand All @@ -70,6 +77,10 @@ jobs:
issue=""
fi
done
- name: Create Issue
run: |
# Declare the flags
Expand Down
2 changes: 1 addition & 1 deletion content/ja/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ title: "InnerSource Commons"
<div class="col-md-5 offset-md-1">
<p class="h2 section-title">最新情報はこちら</p>
<p class="mb-4">
コミュニティ活動のほとんどは、<a href="https://innersourcecommons.org/slack//">Slack</a> で行われています。また、メールの定期購読や、 <a href="https://twitter.com/InnerSourceOrg">Twitter</a>、 <a href="https://www.linkedin.com/company/innersourcecommons">LinkedIn</a> のフォロー、<a href="https://www.youtube.com/channel/UCoSPSd6Or4F_vpjo4SmyoEA">YouTube</a>チャンネルの登録やによって、InnerSource Commons のニュース、イベントについての情報を取得することができます。</p>
コミュニティ活動のほとんどは、<a href="https://innersourcecommons.org/slack/">Slack</a> で行われています。また、メールの定期購読や、 <a href="https://twitter.com/InnerSourceOrg">Twitter</a>、 <a href="https://www.linkedin.com/company/innersourcecommons">LinkedIn</a> のフォロー、<a href="https://www.youtube.com/channel/UCoSPSd6Or4F_vpjo4SmyoEA">YouTube</a>チャンネルの登録やによって、InnerSource Commons のニュース、イベントについての情報を取得することができます。</p>
<p class="h3 section-title">メールを定期購読する</p>
{{< contact-form >}}
</div>
Expand Down

0 comments on commit d6bbc54

Please sign in to comment.