-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Iternio-Planning-AB:master' into master
- Loading branch information
Showing
9 changed files
with
421 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# Workflow: JSON Validation for ABRP Translations | ||
# Purpose: | ||
# Automatically validates JSON formatting in translation files and provides | ||
# helpful feedback when issues are found. Comments on the PR with validation results. | ||
# | ||
# Frequency: | ||
# - Runs on every PR that modifies JSON files | ||
# | ||
# Prerequisites: | ||
# - None, uses default GitHub token for authentication | ||
|
||
name: Validate JSON | ||
run-name: "JSON Validation for PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}" | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**.json' | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: read | ||
|
||
jobs: | ||
validate-json: | ||
name: Validate Translation Files | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get Changed Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
files: '**.json' | ||
|
||
- name: Validate JSON Files | ||
id: validate | ||
run: | | ||
ERROR_LOG="" | ||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | ||
if [ -f "$file" ]; then | ||
echo "Validating $file" | ||
ERROR_OUTPUT=$(jq empty "$file" 2>&1 || true) | ||
if [ ! -z "$ERROR_OUTPUT" ]; then | ||
LINE_NUM=$(echo "$ERROR_OUTPUT" | grep -o "line [0-9]*" | cut -d' ' -f2) | ||
ERROR_LOG="$ERROR_LOG\n• $file (line $LINE_NUM): $ERROR_OUTPUT" | ||
fi | ||
fi | ||
done | ||
if [ ! -z "$ERROR_LOG" ]; then | ||
echo "error_log<<EOF" >> $GITHUB_ENV | ||
echo "$ERROR_LOG" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
exit 1 | ||
fi | ||
- name: Comment Validation Results | ||
if: always() | ||
uses: actions/github-script@v7 | ||
env: | ||
ERROR_LOG: ${{ env.error_log }} | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const output = failure() ? | ||
`### ❌ JSON Validation Failed | ||
Hello @${{ github.actor }}, thank you for your translation contribution! We found some formatting issues: | ||
\`\`\` | ||
${process.env.ERROR_LOG || 'No specific error details available'} | ||
\`\`\` | ||
#### Common JSON Format Rules: | ||
1️⃣ Check for missing commas between items: | ||
\`\`\`json | ||
{ | ||
"key1": "value1", // ✅ Correct - has comma | ||
"key2": "value2" // ✅ Correct - no comma on last item | ||
} | ||
\`\`\` | ||
2️⃣ Make sure quotes are properly closed: | ||
\`\`\`json | ||
"key": "correct value", // ✅ Correct | ||
"key": "missing quote, // ❌ Wrong | ||
\`\`\` | ||
Need help? Feel free to ask and we'll assist you! Your contribution helps make ABRP accessible to more users worldwide. 🌍` | ||
: | ||
`### ✅ JSON Format Validation Passed | ||
Thank you @${{ github.actor }} for your translation contribution! The file format looks good and we'll review your changes soon. | ||
Your help in making ABRP accessible to more users is greatly appreciated! 🌟 | ||
__Action__: \`${{ github.event_name }}\` | ||
__Files Changed__: \`${{ steps.changed-files.outputs.all_changed_files }}\``; | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: output | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,49 @@ | ||
# Translation files for the ABetterRouteplanner app | ||
# Welcome to ABetterRouteplanner Translations! 🌍 | ||
|
||
This repository contains translation files for the ABetterRouteplanner (ABRP) app, which is available at https://abetterrouteplanner.com | ||
as well as at https://apps.apple.com/us/app/a-better-routeplanner-abrp/id1490860521 and https://play.google.com/store/apps/details?id=com.iternio.abrpapp . | ||
Thank you for your interest in helping make ABRP ([ABetterRouteplanner](https://abetterrouteplanner.com)) accessible to more users around the world! This repository contains translation files for our app, which helps EV drivers plan their journeys efficiently. | ||
|
||
If you would like to contribute translations for your language, or just improve on the existing translations, feel free to either; | ||
## 🚀 How to Contribute | ||
|
||
1. Make edits directly here in github by clicking the 'pen icon' at the top right of the file you wish to edit and submit a pullrequest or... | ||
You can help in two ways: | ||
|
||
2. Download the files in this repo and email us your updated version at [email protected] or submit a pullrequest here at GitHub. | ||
1. **Directly on GitHub** (Recommended): | ||
- Find your language file (e.g., `es.json` for Spanish) | ||
- Click the 'pen icon' (✏️) at the top right of the file | ||
- Make your translations | ||
- Submit a pull request | ||
|
||
The translations themselves are published under the open Apache license, however the app sourcecode itself is not open. | ||
2. **Via Email**: | ||
- Download the files | ||
- Make your translations | ||
- Send to [email protected] or submit a pull request | ||
|
||
Thank you so much for helping out! | ||
## 📝 Translation Guidelines | ||
|
||
Bo and the Iternio Team | ||
1. Only edit the text after the colon. Example: | ||
```json | ||
"welcome_message": "Welcome to ABRP" // Only translate "Welcome to ABRP" | ||
``` | ||
|
||
--- | ||
2. Keep special placeholders unchanged: | ||
```json | ||
"hello_user": "Hello {{username}}" // Keep {{username}} as is | ||
``` | ||
|
||
If you'd like to be part of our beta testers group, here's a [Apple Testflight invite URL](https://testflight.apple.com/join/uX9LuvcQ). | ||
3. Maintain all punctuation and formatting symbols | ||
|
||
## 📱 Get the App | ||
|
||
- [iOS App Store](https://apps.apple.com/us/app/a-better-routeplanner-abrp/id1490860521) | ||
- [Google Play Store](https://play.google.com/store/apps/details?id=com.iternio.abrpapp) | ||
|
||
Want to try new features early? Join our [iOS beta testing program](https://testflight.apple.com/join/uX9LuvcQ)! | ||
|
||
## ⚖️ License | ||
|
||
The translations are published under the Apache license. The app source code itself is not open source. | ||
|
||
## 💕 Thank You! | ||
|
||
Your contributions help make electric vehicle journey planning accessible to everyone. We truly appreciate your help! | ||
|
||
~ Bo and the Iternio Team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.