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

Locale checker - updates from feedback #2228

Merged
merged 2 commits into from
Sep 18, 2023
Merged
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
34 changes: 17 additions & 17 deletions .github/workflows/locale-checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,7 @@ def main():

body = "The English version of this file has been updated. "
body += "The following localised versions are potentially out of date:\n\n"
body += "```diff\n"
body += f"- {english_shasum} (English latest)\n"
for locale in outdated_locales:
localized_shasum = get_shasum(
os.path.join(root, f"index.{locale}.adoc")
)
# If localized file is None then we need to create a pull request to add the shasum to the file
if localized_shasum is None:
addLocalizedShasum(english_shasum, locale, root)
# Add localized shasum to outdated_locales
outdated_locales[
outdated_locales.index(locale)
] = f"{localized_shasum} {locale}"
body += f"+ {localized_shasum} ({locale})\n"
body += "```\n\n"
body += "View the Latest version of the file "
body += "View the Latest English version of the file "
body += f"[here](https://github.com/{REPO}/blob/main/{english_file}).\n\n"
body += "| Locale | File | Locale Lead |\n"
body += "| ------ | ---- | ----------- |\n"
Expand All @@ -147,6 +132,21 @@ def main():
f'| {locale} | [{f"index.{locale}.adoc"}]({url}) | {locale_lead}\n'
)
body += "\n"
body += "```diff\n"
body += f"- {english_shasum} (English latest)\n"
for locale in outdated_locales:
localized_shasum = get_shasum(
os.path.join(root, f"index.{locale}.adoc")
)
# If localized file is None then we need to create a pull request to add the shasum to the file
if localized_shasum is None:
addLocalizedShasum(english_shasum, locale, root)
# Add localized shasum to outdated_locales
outdated_locales[
outdated_locales.index(locale)
] = f"{localized_shasum} {locale}"
body += f"+ {localized_shasum} ({locale})\n"
body += "```\n\n"
body += "---\n\n"

for locale in outdated_locales:
Expand Down Expand Up @@ -176,7 +176,7 @@ def main():
"--body",
body,
"--label",
"translation,help wanted",
"translation,help wanted, good first issue",
]
)

Expand Down