From 4f115f42a88f3bcb4e86595b6cf13f4f5f6d9d1b Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Tue, 14 Oct 2025 08:10:55 +0200 Subject: [PATCH] chore: English in Issues & PRs (#24300) --- .github/prompts/language-check.prompt.yml | 32 ++++++++++++++ .github/workflows/language-reminder.yml | 54 +++++++++++++++++++++++ CONTRIBUTING.md | 16 +++++++ assets/js/views/Issue.vue | 6 ++- 4 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 .github/prompts/language-check.prompt.yml create mode 100644 .github/workflows/language-reminder.yml diff --git a/.github/prompts/language-check.prompt.yml b/.github/prompts/language-check.prompt.yml new file mode 100644 index 000000000..e22d7ec6b --- /dev/null +++ b/.github/prompts/language-check.prompt.yml @@ -0,0 +1,32 @@ +messages: + - role: system + content: | + Detect if a GitHub PR comment is written predominantly in a non-English language (especially German). + + Return false if: + - The comment is very brief (1-5 words) + - The comment mixes English with technical terms (e.g., "Bundesnetzagentur", "Einspeisevergütung") + - You are uncertain + - role: user + content: | + Should this comment be in English? + + {{comment}} + +model: openai/gpt-4o-mini +responseFormat: json_schema +jsonSchema: |- + { + "name": "language_check", + "strict": true, + "schema": { + "type": "object", + "properties": { + "is_non_english": { + "type": "boolean" + } + }, + "required": ["is_non_english"], + "additionalProperties": false + } + } diff --git a/.github/workflows/language-reminder.yml b/.github/workflows/language-reminder.yml new file mode 100644 index 000000000..5eeb714b4 --- /dev/null +++ b/.github/workflows/language-reminder.yml @@ -0,0 +1,54 @@ +name: Language Reminder + +on: + pull_request_review_comment: + types: [created] + issue_comment: + types: [created] + issues: + types: [opened] + +permissions: + pull-requests: write + issues: write + contents: read + models: read + +jobs: + check-language: + name: Check Comment Language + runs-on: ubuntu-latest + if: github.event.issue.pull_request || github.event.pull_request + + steps: + - uses: actions/checkout@v5 + + - name: Check language + id: language_check + uses: actions/ai-inference@v2 + with: + model: openai/gpt-4o-mini + prompt-file: .github/prompts/language-check.prompt.yml + input: | + comment: ${{ github.event.comment.body }} + + - name: Post reminder if non-English + if: steps.language_check.outputs.response != '' + uses: actions/github-script@v8 + with: + script: | + const analysis = JSON.parse('${{ steps.language_check.outputs.response }}'); + console.log('Analysis:', analysis); + + if (analysis.is_non_english) { + const comment = context.payload.comment; + await github.rest.pulls.createReviewComment({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + body: `@${comment.user.login} 🇬🇧 Please use English so everyone can participate. See [Contributing Guidelines](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/master/CONTRIBUTING.md#communication-language).`, + commit_id: comment.commit_id, + path: comment.path, + in_reply_to: comment.id + }); + } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 30b204a73..ebc3cefb3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -134,6 +134,22 @@ make ui build ./evcc --config tests/simulator.evcc.yaml ``` +## Communication Language + +evcc has a large German-speaking user base, but we want to be open and accessible to everyone in the global community. To balance these needs: + +- **Pull Requests** + - 🇬🇧 English required +- **Issues** + - 🇬🇧 English recommended + - 🇩🇪 German acceptable to start, must switch to English after first English comment +- **GitHub Discussions** + - 🇬🇧 🇩🇪 Both English and German allowed + +💬 _Non-German speakers: We strongly encourage you to ask participants to switch to English. For pull requests, we have a language check bot that does this automatically._ + +Thank you all for helping make evcc accessible! 🌍 + ## Adding or modifying translations evcc already includes many translations for the UI. We're using [Weblate](https://hosted.weblate.org/projects/evcc/evcc/) to maintain translations. Feel free to add more languages or verify and edit existing translations. Weblate will automatically push all modifications to the evcc repository where they get reviewed and merged. diff --git a/assets/js/views/Issue.vue b/assets/js/views/Issue.vue index 9d2af5208..130f0553d 100644 --- a/assets/js/views/Issue.vue +++ b/assets/js/views/Issue.vue @@ -54,12 +54,16 @@
-
+

{{ $tt("issue.subTitle") }}

+

+ 🇬🇧 Please write your issue in English so everyone can participate. +

+