Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 28 additions & 20 deletions .github/workflows/check-chinese-content.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024-2026 the original author or authors.
#
# Copyright 2024-2025 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,21 +12,26 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Check Chinese Content in Jmanus
#
name: 🔍 Check Chinese Content in Jmanus

on:
pull_request:
paths:
- 'spring-ai-alibaba-jmanus/src/main/java/**/*.java'
- 'spring-ai-alibaba-jmanus/ui-vue3/src/**'

permissions:
contents: read

jobs:
check-chinese-content:
runs-on: ubuntu-latest
name: Check for Chinese content in Java files
name: Check for Chinese content in Jmanus

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

Expand All @@ -34,22 +40,24 @@ jobs:
with:
python-version: '3.9'

- name: Check Chinese content in Jmanus Java files
- name: Check Chinese content in Jmanus
run: |
cd spring-ai-alibaba-jmanus
echo "🔍 Checking for Chinese content in Java files..."
echo "🔍 Checking for Chinese content in Jmanus Java and frontend files..."
echo "📁 Checking directories:"
echo " - spring-ai-alibaba-jmanus/src/main/java"
echo " - spring-ai-alibaba-jmanus/ui-vue3/src (excluding i18n files)"
echo ""

if python scripts/check-chinese-content.py --dir src/main/java --fail-on-found; then
if python tools/scripts/check-chinese-content.py --fail-on-found; then
echo "✅ No Chinese content found - Check passed!"
else
echo ""
echo "## 🚨 Chinese Content Detected"
echo "## 🚨 Chinese Content Detected in Jmanus"
echo ""
echo "Chinese content has been detected in Java files under spring-ai-alibaba-jmanus/src/main/java directory."
echo "Chinese content has been detected in Jmanus Java or frontend files."
echo ""
echo "### Detailed Check Results:"
python scripts/check-chinese-content.py --dir src/main/java
python tools/scripts/check-chinese-content.py
echo ""
echo "### Modification Suggestions:"
echo ""
Expand All @@ -60,21 +68,21 @@ jobs:
echo ""
echo "2. **Chinese Strings** → Extract to resource files or use English"
echo " Example:"
echo " // ❌ Incorrect: throw new RuntimeException(\"用户不存在\");"
echo " // ✅ Correct: throw new RuntimeException(\"User not found\");"
echo " // ❌ Incorrect: String message = \"用户不存在\";"
echo " // ✅ Correct: String message = messageSource.getMessage(\"user.not.found\", null, locale);"
echo ""
echo "3. **Chinese Identifiers** → Change to English Identifiers"
echo "3. **Chinese Identifiers** → Use English identifiers"
echo " Example:"
echo " // ❌ Incorrect: String 用户名 = \"admin\";"
echo " // ✅ Correct: String username = \"admin\";"
echo ""
echo "### Why Avoid Chinese Content?"
echo "4. **Vue Template Content** → Use i18n for internationalization"
echo " Example:"
echo " <!-- ❌ Incorrect: <div>用户管理</div> -->"
echo " <!-- ✅ Correct: <div>{{ \$t('user.management') }}</div> -->"
echo ""
echo "- 🌍 Internationalization Friendly: Facilitates project internationalization"
echo "- 🔧 Development Environment Compatibility: Avoids encoding issues"
echo "- 👥 Team Collaboration: Enables international team members to understand code"
echo "- 📚 Code Standards: Follows open source project best practices"
echo "**Note:** i18n configuration files are automatically excluded from this check."
echo ""
echo "Please modify the relevant files and resubmit."
echo "Please fix the Chinese content issues and commit the changes."
exit 1
fi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Large diffs are not rendered by default.

Loading
Loading