Claude और GitHub Actions के साथ स्वचालित ब्लॉग अनुवाद
मेरी हर पोस्ट स्वचालित रूप से अनुवादित हो जाती है। Claude अनुवाद संभालता है, परिणामों को main में कमिट करता है, और अनुवादित संस्करण मूल के साथ डिप्लॉय होते हैं।
प्रवाह
जब अंग्रेजी सामग्री main में मर्ज होती है तो अनुवाद वर्कफ़्लो GitHub Actions में चलता है:
on:
push:
branches: [main]
paths:
- 'content/**/*.en.md'
flowchart LR
B[main में मर्ज करें] --> C[अनुवाद उत्पन्न]
C --> D[main में कमिट]
D --> E[सभी भाषाओं के साथ प्रोडक्शन डिप्लॉय]
प्रॉम्प्ट
वर्कफ़्लो claude-code-action का उपयोग करता है:
For each .en.md file that was added or modified:
1. Read the English content
2. Create translations for these languages: es, nl, de, it, fr, ja, zh, ru, hi
3. Save each translation as filename.{lang}.md (e.g., hello-world.es.md)
4. Preserve the frontmatter structure exactly, but translate the title
5. Translate the body content naturally
6. Keep code blocks, URLs, file paths, and technical terms unchanged
एक प्रॉम्प्ट सभी 9 भाषाओं को संभालता है। “स्वाभाविक रूप से अनुवाद करें” “इस पाठ का अनुवाद करें” से अधिक प्रवाहमय आउटपुट देता है। कोड ब्लॉक और तकनीकी शब्द अंग्रेजी में रहते हैं।
Front Matter को संभालना
Hugo पोस्ट में YAML front matter होता है। कुछ फ़ील्ड का अनुवाद होना चाहिए (शीर्षक), कुछ का नहीं (तिथि, slug):
“frontmatter संरचना को ठीक वैसे ही रखें, लेकिन शीर्षक का अनुवाद करें”
अंग्रेजी:
---
title: "Hello World"
date: 2025-12-20
draft: false
---
हिंदी:
---
title: "नमस्ते दुनिया"
date: 2025-12-20
draft: false
---
कमिट
वर्कफ़्लो एक बॉट पहचान सेट करता है और Claude क्या कर सकता है उसे सीमित करता है:
- name: Setup git identity
run: |
git config --global user.email "claude[bot]@users.noreply.github.com"
git config --global user.name "claude[bot]"
- name: Translate with Claude
uses: anthropics/claude-code-action@v1
with:
claude_args: "--allowedTools 'Write,Bash(git:*)'"
prompt: |
...
Use `git add`, `git commit`, and `git push` to add the translations directly to main.
--allowedTools Claude को फ़ाइलें लिखने और git कमांड चलाने तक सीमित करता है।
गुणवत्ता
व्यक्तिगत ब्लॉग के लिए पर्याप्त। Claude के अनुवाद प्रवाहमय हैं और अर्थ को अच्छी तरह पकड़ते हैं। एक मूल वक्ता कभी-कभी अजीब वाक्यांश पकड़ लेगा, लेकिन यह मेरे खुद करने से बेहतर है।
अन्य उपयोग
यही पैटर्न डॉक्यूमेंटेशन जनरेशन, changelog सारांश, कमिट संदेश लेखन और रिलीज़ नोट्स के लिए काम करता है:
- पता लगाएं क्या बदला
- निर्देशों के साथ Claude को सामग्री भेजें
- परिणामों को ब्रांच में वापस कमिट करें