From 576baf7bae9f641a7ff161c30aa65047522f953c Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 12 Sep 2023 12:02:34 +0100 Subject: [PATCH 1/7] add shasums --- content/asciidoc-pages/about/index.zh-CN.adoc | 1 + content/asciidoc-pages/docs/faq/index.de.adoc | 2 +- content/asciidoc-pages/docs/faq/index.fr.adoc | 1 + content/asciidoc-pages/docs/qvs-policy/index.de.adoc | 5 +++-- content/asciidoc-pages/temurin/buttons/index.adoc | 1 - .../asciidoc-pages/temurin/commercial-support/index.de.adoc | 1 + .../asciidoc-pages/temurin/commercial-support/index.es.adoc | 1 + .../temurin/commercial-support/index.zh-CN.adoc | 1 + 8 files changed, 9 insertions(+), 4 deletions(-) diff --git a/content/asciidoc-pages/about/index.zh-CN.adoc b/content/asciidoc-pages/about/index.zh-CN.adoc index bee096a20..9f9ee7b71 100644 --- a/content/asciidoc-pages/about/index.zh-CN.adoc +++ b/content/asciidoc-pages/about/index.zh-CN.adoc @@ -35,3 +35,4 @@ Eclipse Adoptium 提供高性能的运行时二进制文件,这些文件符合 * 构建脚本和其他用来生成二进制文件、门户网站和构建基础架构的代码已获得 https://www.apache.org/licenses/LICENSE-2.0[Apache License, Version 2.0] 许可. * OpenJDK 代码本身已获得 https://openjdk.java.net/legal/gplv2+ce.html[GPL v2 with Classpath Exception] (GPLv2+CE) 和 https://openjdk.java.net/legal/assembly-exception.html[GPL v2 with Assembly Exception] (GPLv2+Assembly) 许可. +:page-based-on: 50e5dbed709fcbf4e2b5f225c9da68a17ebb301e diff --git a/content/asciidoc-pages/docs/faq/index.de.adoc b/content/asciidoc-pages/docs/faq/index.de.adoc index 35d540fcf..5dbc99c55 100644 --- a/content/asciidoc-pages/docs/faq/index.de.adoc +++ b/content/asciidoc-pages/docs/faq/index.de.adoc @@ -1,6 +1,6 @@ = Frequently Asked Questions :page-authors: gdams, HanSolo, sw-fox, aumann, hendrikebbers -:page-based-on: 56f8f9b0dd04a8cadd21fa9b68ee86430949c0b7 +:page-based-on: 50dc526fadcdd7dd03b386f112ac1ab4043bb554 Auf dieser Seite haben wir versucht häufig gestellte Fragen (FAQs) für die Community zu beantworten. Alle weiteren Fragen können jederzeit gerne in unsere https://adoptium.net/slack.html[Slack-Channel] gestellt diff --git a/content/asciidoc-pages/docs/faq/index.fr.adoc b/content/asciidoc-pages/docs/faq/index.fr.adoc index a60645420..1b730a6e1 100644 --- a/content/asciidoc-pages/docs/faq/index.fr.adoc +++ b/content/asciidoc-pages/docs/faq/index.fr.adoc @@ -1,5 +1,6 @@ = Frequently Asked Questions :page-authors: xavierfacq +:page-based-on: 56f8f9b0dd04a8cadd21fa9b68ee86430949c0b7 Nous avons rassemblé quelques questions fréquemment posées (FAQ) dans ce document. Si vous souhaitez nous parler de ces sujets ou poser des questions supplémentaires, diff --git a/content/asciidoc-pages/docs/qvs-policy/index.de.adoc b/content/asciidoc-pages/docs/qvs-policy/index.de.adoc index 962f40d74..44c5e07e7 100644 --- a/content/asciidoc-pages/docs/qvs-policy/index.de.adoc +++ b/content/asciidoc-pages/docs/qvs-policy/index.de.adoc @@ -4,7 +4,7 @@ :orgname: Eclipse Adoptium :lang: en :page-authors: gdams, HanSolo -:page-based-on: 50dc526fadcdd7dd03b386f112ac1ab4043bb554 +:page-based-on: edd131f41d548b815a7edbcf59848b8161fbc9e6 == Überblick @@ -21,7 +21,8 @@ at no charge as open source licensed software. Sie können die AQAvit-Software g Nominierte https://github.com/adoptium/aqa-tests/releases[Versionen der AQAvit Qualitätstestsuite^] -(QVS) sind verfügbar unter der Eclipse Foundation Quality Verification Suite License (QVSL). Ein Softwareprodukt gilt als von der AQAvit QVS "verifiziert", wenn es alle Anforderungen der AQAvit QVS, wie in der QVSL beschrieben, vollständig erfüllt und einhält. +(QVS) sind verfügbar unter der +https://www.eclipse.org/legal/eclipse-foundation-quality-verification-suite-license.php[Eclipse Foundation Quality Verification Suite License^] (QVSL). Ein Softwareprodukt gilt als von der AQAvit QVS "verifiziert", wenn es alle Anforderungen der AQAvit QVS, wie in der QVSL beschrieben, vollständig erfüllt und einhält. Es ist nicht notwendig, ein Mitglied der Adoptium-Arbeitsgruppe zu sein, um ein AQAvit-geprüftes Softwareprodukt zu erstellen. diff --git a/content/asciidoc-pages/temurin/buttons/index.adoc b/content/asciidoc-pages/temurin/buttons/index.adoc index 619913d0b..998cd7821 100644 --- a/content/asciidoc-pages/temurin/buttons/index.adoc +++ b/content/asciidoc-pages/temurin/buttons/index.adoc @@ -1,5 +1,4 @@ = Temurin(TM) Download Buttons - :page-authors: tellison, gdams :keywords: buttons diff --git a/content/asciidoc-pages/temurin/commercial-support/index.de.adoc b/content/asciidoc-pages/temurin/commercial-support/index.de.adoc index ca4d89ac5..18cf13da7 100644 --- a/content/asciidoc-pages/temurin/commercial-support/index.de.adoc +++ b/content/asciidoc-pages/temurin/commercial-support/index.de.adoc @@ -1,5 +1,6 @@ = Commercial Support Options for Eclipse Temurin(TM) :page-authors: gdams, tellison, hendrikebbers +:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 Es gibt verschiedene kommerzielle Supportoptionen für Eclipse Temurin. Bitte beachten Sie, dass keiner der folgenden Anbieter vom Adoptium(R) Projekt evaluiert wurde oder offiziell empfohlen wird. Jeder kommerzielle Supportanbieter hat in der Regel unterschiedliche Schwerpunkte und Anwendungsfälle für seine Produkte. Daher wird empfohlen, jede Option sorgfältig im Hinblick auf Ihre spezifischen Bedürfnisse und Anforderungen hin zu evaluieren. diff --git a/content/asciidoc-pages/temurin/commercial-support/index.es.adoc b/content/asciidoc-pages/temurin/commercial-support/index.es.adoc index 7e0ddb435..0185c43d6 100644 --- a/content/asciidoc-pages/temurin/commercial-support/index.es.adoc +++ b/content/asciidoc-pages/temurin/commercial-support/index.es.adoc @@ -1,5 +1,6 @@ = Commercial Support Options for Eclipse Temurin(TM) :page-authors: gdams, tellison, hendrikebbers +:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 Actualmente, hay disponible una variedad de opciones comerciales para el soporte de Eclipse Temurin. Es importante señalar que ninguno de estos proveedores ha sido evaluado ni cuenta con el respaldo oficial del proyecto Adoptium(R). Cada proveedor de soporte comercial tiende a atender diferentes casos de uso típicos, por lo que se recomienda que investigue cuidadosamente cada opción en función de sus necesidades y requisitos específicos. diff --git a/content/asciidoc-pages/temurin/commercial-support/index.zh-CN.adoc b/content/asciidoc-pages/temurin/commercial-support/index.zh-CN.adoc index de34b68fd..55e41d2df 100644 --- a/content/asciidoc-pages/temurin/commercial-support/index.zh-CN.adoc +++ b/content/asciidoc-pages/temurin/commercial-support/index.zh-CN.adoc @@ -46,3 +46,4 @@ Red Hat的客户可以通过订阅获得对关键的Java生产环境提供的24x |=== 商业支持供应商可以通过 https://github.com/adoptium/adoptium.net/issues/new/choose[提交请求] 以加入此列表。 +:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 From 83496e116edeab4662c6a3223a37fb876717e29b Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 12 Sep 2023 13:29:40 +0100 Subject: [PATCH 2/7] Add shasum to content/asciidoc-pages/temurin/commercial-support/index.de.adoc --- content/asciidoc-pages/temurin/commercial-support/index.de.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/asciidoc-pages/temurin/commercial-support/index.de.adoc b/content/asciidoc-pages/temurin/commercial-support/index.de.adoc index 18cf13da7..a5d9944fd 100644 --- a/content/asciidoc-pages/temurin/commercial-support/index.de.adoc +++ b/content/asciidoc-pages/temurin/commercial-support/index.de.adoc @@ -1,6 +1,5 @@ = Commercial Support Options for Eclipse Temurin(TM) :page-authors: gdams, tellison, hendrikebbers -:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 Es gibt verschiedene kommerzielle Supportoptionen für Eclipse Temurin. Bitte beachten Sie, dass keiner der folgenden Anbieter vom Adoptium(R) Projekt evaluiert wurde oder offiziell empfohlen wird. Jeder kommerzielle Supportanbieter hat in der Regel unterschiedliche Schwerpunkte und Anwendungsfälle für seine Produkte. Daher wird empfohlen, jede Option sorgfältig im Hinblick auf Ihre spezifischen Bedürfnisse und Anforderungen hin zu evaluieren. @@ -42,3 +41,4 @@ Besuchen Sie https://developers.redhat.com/java/red-hat-and-java?utm_source=adop |=== Kommerzielle Anbieter können eine https://github.com/adoptium/adoptium.net/issues/new/choose[Anfrage stellen], um zu dieser Liste hinzugefügt zu werden. +:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 From e917f77e7dbe4a1aa3aa0a04d12d4b539b49f110 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 12 Sep 2023 13:39:04 +0100 Subject: [PATCH 3/7] add tool --- .github/workflows/locale-checker.py | 138 ++++++++++++++++++ .github/workflows/locale-checker.yml | 31 ++++ content/asciidoc-pages/about/index.zh-CN.adoc | 2 +- .../temurin/commercial-support/index.de.adoc | 2 +- .../commercial-support/index.zh-CN.adoc | 2 +- 5 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/locale-checker.py create mode 100644 .github/workflows/locale-checker.yml diff --git a/.github/workflows/locale-checker.py b/.github/workflows/locale-checker.py new file mode 100644 index 000000000..e0844c008 --- /dev/null +++ b/.github/workflows/locale-checker.py @@ -0,0 +1,138 @@ +import os +import re +import subprocess + +CONTENT_DIR = "content/asciidoc-pages" +REPO = "adoptium/adoptium.net" + +# List of locale leads for each locale +locale_leads = { + "de": "@hendrikebbers", + "fr": "@xavierfacq", + "zh-CN": "@zdtsw", +} + +def get_shasum(file_path): + with open(file_path, 'r') as f: + content = f.read() + match = re.search(r":page-based-on:\s+(\S+)", content) + return match.group(1) if match else None + +def get_shasum_from_git(file_path): + shasum = None + if os.path.exists(file_path): + shasum = os.popen(f"git log -1 --format=%H {file_path}").read().strip() + return shasum + +def addLocalizedShasum(english_shasum, locale, root): + # Add the shasum to the localized file + localized_file = os.path.join(root, f"index.{locale}.adoc") + with open(localized_file, 'r') as f: + content = f.read() + match = re.search(r":page-based-on:\s+(\S+)", content) + if match: + print(f"Updating {localized_file} with shasum {english_shasum}") + content = content.replace(match.group(1), english_shasum) + with open(localized_file, 'w') as f: + f.write(content) + else: + print(f"Adding shasum {english_shasum} to {localized_file}") + with open(localized_file, 'r') as f: + content = f.readlines() + + # Find the line number where ':page-authors:' exists + line_number = next((index for index, line in enumerate(content) if ':page-authors:' in line), None) + + # Insert shasum after the line with ':page-authors:' + if line_number is not None: + content.insert(line_number + 1, f":page-based-on: {english_shasum}\n") + + # Write the updated content back to the file + with open(localized_file, 'w') as f: + f.writelines(content) + + +def main(): + for root, _, files in os.walk(CONTENT_DIR): + english_file = os.path.join(root, "index.adoc") + + if "index.adoc" not in files: + continue + + english_shasum = get_shasum_from_git(english_file) + if not english_shasum: + continue + + outdated_locales = [] + + localized_file_pattern = re.compile(r'^index\..+\.adoc$') + for localized_file in files: + if localized_file_pattern.match(localized_file): + file_path = os.path.join(root.replace('.index.adoc', ''), localized_file) + local_shasum = get_shasum(file_path) + + if local_shasum != english_shasum: + locale = localized_file.split(".")[1] + outdated_locales.append(locale) + + if outdated_locales: + # Check if an issue already exists for this file + check_issue = os.popen(f"gh issue list -R {REPO} --search 'Translation review required after updates to {os.path.relpath(english_file, CONTENT_DIR)}' --state open").read().strip() + if check_issue: + print(f"An issue already exists for {english_file}: {check_issue}") + continue + + # Create an issue for this file + print(f"Creating issue for {english_file}") + + title = f"Translation review required after updates to {os.path.relpath(english_file, CONTENT_DIR)}" + + body = f"The English version of this file has been updated. 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 += f"View the Latest version of the file [here](https://github.com/{REPO}/blob/main/{english_file}).\n\n" + body += f"| Locale | File | Locale Lead |\n" + body += f"| ------ | ---- | ----------- |\n" + for locale in outdated_locales: + localized_shasum = locale.split(" ")[0].strip() + locale = locale.split(" ")[1] + # get locale lead + locale_lead = locale_leads.get(locale) + if locale_lead is None: + locale_lead = "n/a" + body += f'| {locale} | [{f"index.{locale}.adoc"}](https://github.com/{REPO}/blob/main/{os.path.join(root, f"index.{locale}.adoc")}) | {locale_lead}\n' + body += "\n" + body += "---\n\n" + + for locale in outdated_locales: + localized_shasum = locale.split(" ")[0] + locale = locale.split(" ")[1] + body += f"### View the changes to the English file since the last {locale} update\n\n" + body += f"
\n" + body += f"View Diff\n\n" + # Generate diff between English file and the English version of the localized file + body += "```diff\n" + body += os.popen(f"git diff {localized_shasum}..{english_shasum} -- {english_file}").read() + body += "```\n\n" + body += f"
\n\n" + + # Generate Issue + subprocess.run([ + "gh", "issue", "create", + "--repo", REPO, + "--title", title, + "--body", body, + "--label", "translation,help wanted", + ]) + +if __name__ == "__main__": + main() diff --git a/.github/workflows/locale-checker.yml b/.github/workflows/locale-checker.yml new file mode 100644 index 000000000..8fce2ee97 --- /dev/null +++ b/.github/workflows/locale-checker.yml @@ -0,0 +1,31 @@ +name: Locale Checker + +on: + workflow_dispatch: + push: + paths: [ content/asciidoc-pages/** ] + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + issues: write + pull-requests: write + +jobs: + locale-checker: + if: github.repository_owner == 'adoptium' + name: Check Locales for Changes + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + with: + persist-credentials: false + + - name: Check asciidoc docs + run: python3 .github/workflows/locale-checker.py diff --git a/content/asciidoc-pages/about/index.zh-CN.adoc b/content/asciidoc-pages/about/index.zh-CN.adoc index 9f9ee7b71..21fd72375 100644 --- a/content/asciidoc-pages/about/index.zh-CN.adoc +++ b/content/asciidoc-pages/about/index.zh-CN.adoc @@ -1,5 +1,6 @@ = About Eclipse Adoptium(R) :page-authors: zdtsw, gdams +:page-based-on: 50e5dbed709fcbf4e2b5f225c9da68a17ebb301e Eclipse Adoptium 作为顶级项目的使命是生产高质量的 Java 运行时和相关技术,以应用于 Java 生态系统。 @@ -35,4 +36,3 @@ Eclipse Adoptium 提供高性能的运行时二进制文件,这些文件符合 * 构建脚本和其他用来生成二进制文件、门户网站和构建基础架构的代码已获得 https://www.apache.org/licenses/LICENSE-2.0[Apache License, Version 2.0] 许可. * OpenJDK 代码本身已获得 https://openjdk.java.net/legal/gplv2+ce.html[GPL v2 with Classpath Exception] (GPLv2+CE) 和 https://openjdk.java.net/legal/assembly-exception.html[GPL v2 with Assembly Exception] (GPLv2+Assembly) 许可. -:page-based-on: 50e5dbed709fcbf4e2b5f225c9da68a17ebb301e diff --git a/content/asciidoc-pages/temurin/commercial-support/index.de.adoc b/content/asciidoc-pages/temurin/commercial-support/index.de.adoc index a5d9944fd..18cf13da7 100644 --- a/content/asciidoc-pages/temurin/commercial-support/index.de.adoc +++ b/content/asciidoc-pages/temurin/commercial-support/index.de.adoc @@ -1,5 +1,6 @@ = Commercial Support Options for Eclipse Temurin(TM) :page-authors: gdams, tellison, hendrikebbers +:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 Es gibt verschiedene kommerzielle Supportoptionen für Eclipse Temurin. Bitte beachten Sie, dass keiner der folgenden Anbieter vom Adoptium(R) Projekt evaluiert wurde oder offiziell empfohlen wird. Jeder kommerzielle Supportanbieter hat in der Regel unterschiedliche Schwerpunkte und Anwendungsfälle für seine Produkte. Daher wird empfohlen, jede Option sorgfältig im Hinblick auf Ihre spezifischen Bedürfnisse und Anforderungen hin zu evaluieren. @@ -41,4 +42,3 @@ Besuchen Sie https://developers.redhat.com/java/red-hat-and-java?utm_source=adop |=== Kommerzielle Anbieter können eine https://github.com/adoptium/adoptium.net/issues/new/choose[Anfrage stellen], um zu dieser Liste hinzugefügt zu werden. -:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 diff --git a/content/asciidoc-pages/temurin/commercial-support/index.zh-CN.adoc b/content/asciidoc-pages/temurin/commercial-support/index.zh-CN.adoc index 55e41d2df..59d4412e4 100644 --- a/content/asciidoc-pages/temurin/commercial-support/index.zh-CN.adoc +++ b/content/asciidoc-pages/temurin/commercial-support/index.zh-CN.adoc @@ -1,5 +1,6 @@ = Commercial Support Options for Eclipse Temurin(TM) :page-authors: zdtsw, tellison +:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 对于Eclipse Temurin,我们提供多种商业支持选项。 需要注意的是,以下列举的供应商并未经过Adoptium(R)项目的评估,也没有得到Adoptium(R)项目正式认可。 @@ -46,4 +47,3 @@ Red Hat的客户可以通过订阅获得对关键的Java生产环境提供的24x |=== 商业支持供应商可以通过 https://github.com/adoptium/adoptium.net/issues/new/choose[提交请求] 以加入此列表。 -:page-based-on: 4f7e0d66e577a9c619e38c6d670d86f9c4736874 From b6275b95643712ead2d46f5797cc39ffda964c2b Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 12 Sep 2023 14:31:39 +0100 Subject: [PATCH 4/7] linter fixes --- .github/workflows/locale-checker.py | 90 ++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/.github/workflows/locale-checker.py b/.github/workflows/locale-checker.py index e0844c008..230bb57e0 100644 --- a/.github/workflows/locale-checker.py +++ b/.github/workflows/locale-checker.py @@ -12,50 +12,60 @@ "zh-CN": "@zdtsw", } + def get_shasum(file_path): - with open(file_path, 'r') as f: + with open(file_path, "r") as f: content = f.read() match = re.search(r":page-based-on:\s+(\S+)", content) return match.group(1) if match else None + def get_shasum_from_git(file_path): shasum = None if os.path.exists(file_path): shasum = os.popen(f"git log -1 --format=%H {file_path}").read().strip() return shasum + def addLocalizedShasum(english_shasum, locale, root): # Add the shasum to the localized file localized_file = os.path.join(root, f"index.{locale}.adoc") - with open(localized_file, 'r') as f: + with open(localized_file, "r") as f: content = f.read() match = re.search(r":page-based-on:\s+(\S+)", content) if match: print(f"Updating {localized_file} with shasum {english_shasum}") content = content.replace(match.group(1), english_shasum) - with open(localized_file, 'w') as f: + with open(localized_file, "w") as f: f.write(content) else: print(f"Adding shasum {english_shasum} to {localized_file}") - with open(localized_file, 'r') as f: + with open(localized_file, "r") as f: content = f.readlines() # Find the line number where ':page-authors:' exists - line_number = next((index for index, line in enumerate(content) if ':page-authors:' in line), None) + line_number = next( + ( + index + for index, line in enumerate(content) + if ":page-authors:" in line + ), + None, + ) # Insert shasum after the line with ':page-authors:' if line_number is not None: content.insert(line_number + 1, f":page-based-on: {english_shasum}\n") # Write the updated content back to the file - with open(localized_file, 'w') as f: + with open(localized_file, "w") as f: f.writelines(content) def main(): for root, _, files in os.walk(CONTENT_DIR): english_file = os.path.join(root, "index.adoc") - + if "index.adoc" not in files: continue @@ -65,10 +75,12 @@ def main(): outdated_locales = [] - localized_file_pattern = re.compile(r'^index\..+\.adoc$') + localized_file_pattern = re.compile(r"^index\..+\.adoc$") for localized_file in files: if localized_file_pattern.match(localized_file): - file_path = os.path.join(root.replace('.index.adoc', ''), localized_file) + file_path = os.path.join( + root.replace(".index.adoc", ""), localized_file + ) local_shasum = get_shasum(file_path) if local_shasum != english_shasum: @@ -77,7 +89,17 @@ def main(): if outdated_locales: # Check if an issue already exists for this file - check_issue = os.popen(f"gh issue list -R {REPO} --search 'Translation review required after updates to {os.path.relpath(english_file, CONTENT_DIR)}' --state open").read().strip() + check_issue = ( + os.popen( + # split this line into two to avoid a bug in the GitHub CLI + "gh issue list " + + f"-R {REPO} " + + f"--search 'Translation review required after updates to {os.path.relpath(english_file, CONTENT_DIR)}' " + + "--state open" + ) + .read() + .strip() + ) if check_issue: print(f"An issue already exists for {english_file}: {check_issue}") continue @@ -87,21 +109,26 @@ def main(): title = f"Translation review required after updates to {os.path.relpath(english_file, CONTENT_DIR)}" - body = f"The English version of this file has been updated. The following localised versions are potentially out of date:\n\n" + 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")) + 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}" + outdated_locales[ + outdated_locales.index(locale) + ] = f"{localized_shasum} {locale}" body += f"+ {localized_shasum} ({locale})\n" body += "```\n\n" body += f"View the Latest version of the file [here](https://github.com/{REPO}/blob/main/{english_file}).\n\n" - body += f"| Locale | File | Locale Lead |\n" - body += f"| ------ | ---- | ----------- |\n" + body += "| Locale | File | Locale Lead |\n" + body += "| ------ | ---- | ----------- |\n" for locale in outdated_locales: localized_shasum = locale.split(" ")[0].strip() locale = locale.split(" ")[1] @@ -117,22 +144,33 @@ def main(): localized_shasum = locale.split(" ")[0] locale = locale.split(" ")[1] body += f"### View the changes to the English file since the last {locale} update\n\n" - body += f"
\n" - body += f"View Diff\n\n" + body += "
\n" + body += "View Diff\n\n" # Generate diff between English file and the English version of the localized file body += "```diff\n" - body += os.popen(f"git diff {localized_shasum}..{english_shasum} -- {english_file}").read() + body += os.popen( + f"git diff {localized_shasum}..{english_shasum} -- {english_file}" + ).read() body += "```\n\n" - body += f"
\n\n" + body += "
\n\n" # Generate Issue - subprocess.run([ - "gh", "issue", "create", - "--repo", REPO, - "--title", title, - "--body", body, - "--label", "translation,help wanted", - ]) + subprocess.run( + [ + "gh", + "issue", + "create", + "--repo", + REPO, + "--title", + title, + "--body", + body, + "--label", + "translation,help wanted", + ] + ) + if __name__ == "__main__": main() From 46e9c1a2ccbe1787896172f06c42fd48b1563cfb Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 12 Sep 2023 18:20:27 +0100 Subject: [PATCH 5/7] linter fixes --- .github/workflows/locale-checker.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/locale-checker.py b/.github/workflows/locale-checker.py index 230bb57e0..e1a4110f0 100644 --- a/.github/workflows/locale-checker.py +++ b/.github/workflows/locale-checker.py @@ -92,10 +92,11 @@ def main(): check_issue = ( os.popen( # split this line into two to avoid a bug in the GitHub CLI - "gh issue list " + - f"-R {REPO} " + - f"--search 'Translation review required after updates to {os.path.relpath(english_file, CONTENT_DIR)}' " + - "--state open" + "gh issue list " + + f"-R {REPO} " + + "--search 'Translation review required after updates to " + + f"{os.path.relpath(english_file, CONTENT_DIR)}' " + + "--state open" ) .read() .strip() @@ -126,7 +127,8 @@ def main(): ] = f"{localized_shasum} {locale}" body += f"+ {localized_shasum} ({locale})\n" body += "```\n\n" - body += f"View the Latest version of the file [here](https://github.com/{REPO}/blob/main/{english_file}).\n\n" + body += "View the Latest 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" for locale in outdated_locales: @@ -136,7 +138,10 @@ def main(): locale_lead = locale_leads.get(locale) if locale_lead is None: locale_lead = "n/a" - body += f'| {locale} | [{f"index.{locale}.adoc"}](https://github.com/{REPO}/blob/main/{os.path.join(root, f"index.{locale}.adoc")}) | {locale_lead}\n' + url = f"https://github.com/{REPO}/blob/main/{os.path.join(root, f'index.{locale}.adoc')}" + body += ( + f'| {locale} | [{f"index.{locale}.adoc"}]({url}) | {locale_lead}\n' + ) body += "\n" body += "---\n\n" From 334c301f66daf41dd4b9b4cb9f3ab3248ea783c9 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 12 Sep 2023 21:09:30 +0100 Subject: [PATCH 6/7] fixup --- .github/workflows/locale-checker.py | 2 ++ content/asciidoc-pages/docs/faq/index.de.adoc | 6 +++--- locales/de/asciidoc.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/locale-checker.py b/.github/workflows/locale-checker.py index e1a4110f0..648b948f9 100644 --- a/.github/workflows/locale-checker.py +++ b/.github/workflows/locale-checker.py @@ -88,6 +88,8 @@ def main(): outdated_locales.append(locale) if outdated_locales: + # Print the list of outdated locales + print(f"Outdated locales for {english_file}: {outdated_locales}") # Check if an issue already exists for this file check_issue = ( os.popen( diff --git a/content/asciidoc-pages/docs/faq/index.de.adoc b/content/asciidoc-pages/docs/faq/index.de.adoc index c3fea5ef2..be942a3a7 100644 --- a/content/asciidoc-pages/docs/faq/index.de.adoc +++ b/content/asciidoc-pages/docs/faq/index.de.adoc @@ -1,12 +1,12 @@ = Frequently Asked Questions :page-authors: gdams, HanSolo, sw-fox, aumann, hendrikebbers, xavierfacq -:page-based-on: 50dc526fadcdd7dd03b386f112ac1ab4043bb554 +:page-based-on: 7ca352f4545cad6fd03722c9206d31da76063d4a Auf dieser Seite haben wir versucht häufig gestellte Fragen (FAQs) für die Community zu beantworten. Alle weiteren Fragen können jederzeit gerne in unsere https://adoptium.net/slack.html[Slack-Channel] gestellt oder per Ticket im https://github.com/adoptium/adoptium-support[Support-Kanal] eingereicht werden. -== Wo kann man die neuesten Adoptium® JDKs finden? +== Wo kann man die neuesten Adoptium(R) JDKs finden? Die JDKs von Adoptium heißen Eclipse Temurin. Die von uns empfohlenen Versionen kann man direkt https://adoptium.net/temurin/releases/[auf unserer Seite] finden. @@ -19,7 +19,7 @@ von Cloud-Anbietern zu verwenden. Linux-Installationsprogramme sind unter `packages.adoptium.net` verfügbar. Weitere Informationen hierzu finden Sie https://adoptium.net/installation/linux[in diesem Leitfaden]. -== Gibt es statische Links für Temurin™ Builds? +== Gibt es statische Links für Temurin(TM) Builds? Das https://github.com/adoptium/api.adoptium.net/blob/main/docs/cookbook.adoc#example-two-linking-to-the-latest-jdk-or-jre[Adoptium API cookbook] beinhatet Beispiele zu statischen und stabilen URLs die zu spezifischen Temurin Versionen verlinken. Zusätzlich bieten wir https://adoptium.net/en-GB/temurin/buttons/[HTML Buttons] an, die auf Temurin downloads verweisen. diff --git a/locales/de/asciidoc.json b/locales/de/asciidoc.json index bc4a4d631..95169947c 100644 --- a/locales/de/asciidoc.json +++ b/locales/de/asciidoc.json @@ -1,4 +1,4 @@ { "asciidoc.template.warn.default.locale": "Dies ist die englische Version der Seite, da aktuell noch keine deutsche Übersetzung verfügbar ist. Du kannst uns helfen diese Seite in deutsch bereitzustellen. In unserem Leitfaden zu Übersetzungen findest du mehr Informationen.", - "asciidoc.template.warn.outdated": "Die deutsche Übersetzung dieser Seite basiert auf einem nicht mehr aktuellen englischen Text. Daher ist es Möglich, dass Teile des Textes nicht mehr zutreffen. Du kannst helfen die Seite aktuell zu halten und eine überarbeitete Übersetzung der aktuellen englischen Seite/lastEnglishVersionLink> bereitzustellen. In unserem Leitfaden zu Übersetzungen findest du mehr Informationen." + "asciidoc.template.warn.outdated": "Die deutsche Übersetzung dieser Seite basiert auf einem nicht mehr aktuellen englischen Text. Daher ist es Möglich, dass Teile des Textes nicht mehr zutreffen. Du kannst helfen die Seite aktuell zu halten und eine überarbeitete Übersetzung der aktuellen englischen Seite bereitzustellen. In unserem Leitfaden zu Übersetzungen findest du mehr Informationen." } \ No newline at end of file From fa24fe3a0d5db4cf1444937d6b62c44944c9fd79 Mon Sep 17 00:00:00 2001 From: George Adams Date: Fri, 15 Sep 2023 12:36:02 +0100 Subject: [PATCH 7/7] review changes --- .github/workflows/locale-checker.py | 10 ++++++---- .github/workflows/locale-checker.yml | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/locale-checker.py b/.github/workflows/locale-checker.py index 648b948f9..7d2041b64 100644 --- a/.github/workflows/locale-checker.py +++ b/.github/workflows/locale-checker.py @@ -14,6 +14,8 @@ def get_shasum(file_path): + if not os.path.exists(file_path): + return None with open(file_path, "r") as f: content = f.read() match = re.search(r":page-based-on:\s+(\S+)", content) @@ -134,8 +136,8 @@ def main(): body += "| Locale | File | Locale Lead |\n" body += "| ------ | ---- | ----------- |\n" for locale in outdated_locales: - localized_shasum = locale.split(" ")[0].strip() - locale = locale.split(" ")[1] + localized_shasum = locale.split()[0].strip() + locale = locale.split()[1].strip() # get locale lead locale_lead = locale_leads.get(locale) if locale_lead is None: @@ -148,8 +150,8 @@ def main(): body += "---\n\n" for locale in outdated_locales: - localized_shasum = locale.split(" ")[0] - locale = locale.split(" ")[1] + localized_shasum = locale.split()[0].strip() + locale = locale.split()[1].strip() body += f"### View the changes to the English file since the last {locale} update\n\n" body += "
\n" body += "View Diff\n\n" diff --git a/.github/workflows/locale-checker.yml b/.github/workflows/locale-checker.yml index 8fce2ee97..17a015afb 100644 --- a/.github/workflows/locale-checker.yml +++ b/.github/workflows/locale-checker.yml @@ -13,7 +13,6 @@ concurrency: permissions: contents: write issues: write - pull-requests: write jobs: locale-checker: