chore: English in Issues & PRs (#24300)
This commit is contained in:
parent
e233b67e3a
commit
4f115f42a8
4 changed files with 107 additions and 1 deletions
32
.github/prompts/language-check.prompt.yml
vendored
Normal file
32
.github/prompts/language-check.prompt.yml
vendored
Normal file
|
|
@ -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
|
||||
}
|
||||
}
|
||||
54
.github/workflows/language-reminder.yml
vendored
Normal file
54
.github/workflows/language-reminder.yml
vendored
Normal file
|
|
@ -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
|
||||
});
|
||||
}
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -54,12 +54,16 @@
|
|||
|
||||
<form v-if="helpType" @submit.prevent="handleFormSubmit">
|
||||
<!-- Essential Form Section -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h4>
|
||||
{{ $tt("issue.subTitle") }}
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<p class="text-muted mb-4">
|
||||
🇬🇧 Please write your issue in English so everyone can participate.
|
||||
</p>
|
||||
|
||||
<!-- Two Column Layout -->
|
||||
<div class="row mb-5 g-5">
|
||||
<!-- Left Column: Form Fields -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue