Skip to content

Commit 4f115f4

Browse files
authored
chore: English in Issues & PRs (#24300)
1 parent e233b67 commit 4f115f4

File tree

4 files changed

+107
-1
lines changed

4 files changed

+107
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
messages:
2+
- role: system
3+
content: |
4+
Detect if a GitHub PR comment is written predominantly in a non-English language (especially German).
5+
6+
Return false if:
7+
- The comment is very brief (1-5 words)
8+
- The comment mixes English with technical terms (e.g., "Bundesnetzagentur", "EinspeisevergΓΌtung")
9+
- You are uncertain
10+
- role: user
11+
content: |
12+
Should this comment be in English?
13+
14+
{{comment}}
15+
16+
model: openai/gpt-4o-mini
17+
responseFormat: json_schema
18+
jsonSchema: |-
19+
{
20+
"name": "language_check",
21+
"strict": true,
22+
"schema": {
23+
"type": "object",
24+
"properties": {
25+
"is_non_english": {
26+
"type": "boolean"
27+
}
28+
},
29+
"required": ["is_non_english"],
30+
"additionalProperties": false
31+
}
32+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Language Reminder
2+
3+
on:
4+
pull_request_review_comment:
5+
types: [created]
6+
issue_comment:
7+
types: [created]
8+
issues:
9+
types: [opened]
10+
11+
permissions:
12+
pull-requests: write
13+
issues: write
14+
contents: read
15+
models: read
16+
17+
jobs:
18+
check-language:
19+
name: Check Comment Language
20+
runs-on: ubuntu-latest
21+
if: github.event.issue.pull_request || github.event.pull_request
22+
23+
steps:
24+
- uses: actions/checkout@v5
25+
26+
- name: Check language
27+
id: language_check
28+
uses: actions/ai-inference@v2
29+
with:
30+
model: openai/gpt-4o-mini
31+
prompt-file: .github/prompts/language-check.prompt.yml
32+
input: |
33+
comment: ${{ github.event.comment.body }}
34+
35+
- name: Post reminder if non-English
36+
if: steps.language_check.outputs.response != ''
37+
uses: actions/github-script@v8
38+
with:
39+
script: |
40+
const analysis = JSON.parse('${{ steps.language_check.outputs.response }}');
41+
console.log('Analysis:', analysis);
42+
43+
if (analysis.is_non_english) {
44+
const comment = context.payload.comment;
45+
await github.rest.pulls.createReviewComment({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
pull_number: context.payload.pull_request.number,
49+
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).`,
50+
commit_id: comment.commit_id,
51+
path: comment.path,
52+
in_reply_to: comment.id
53+
});
54+
}

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ make ui build
134134
./evcc --config tests/simulator.evcc.yaml
135135
```
136136

137+
## Communication Language
138+
139+
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:
140+
141+
- **Pull Requests**
142+
- πŸ‡¬πŸ‡§ English required
143+
- **Issues**
144+
- πŸ‡¬πŸ‡§ English recommended
145+
- πŸ‡©πŸ‡ͺ German acceptable to start, must switch to English after first English comment
146+
- **GitHub Discussions**
147+
- πŸ‡¬πŸ‡§ πŸ‡©πŸ‡ͺ Both English and German allowed
148+
149+
πŸ’¬ _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._
150+
151+
Thank you all for helping make evcc accessible! 🌍
152+
137153
## Adding or modifying translations
138154

139155
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.

β€Žassets/js/views/Issue.vueβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@
5454

5555
<form v-if="helpType" @submit.prevent="handleFormSubmit">
5656
<!-- Essential Form Section -->
57-
<div class="d-flex justify-content-between align-items-center mb-4">
57+
<div class="d-flex justify-content-between align-items-center mb-3">
5858
<h4>
5959
{{ $tt("issue.subTitle") }}
6060
</h4>
6161
</div>
6262

63+
<p class="text-muted mb-4">
64+
πŸ‡¬πŸ‡§ Please write your issue in English so everyone can participate.
65+
</p>
66+
6367
<!-- Two Column Layout -->
6468
<div class="row mb-5 g-5">
6569
<!-- Left Column: Form Fields -->

0 commit comments

Comments
Β (0)