During the process of building this personal website, I’ve always faced a dilemma: I want to record and create in my most familiar and heartfelt native language (Traditional Chinese), but at the same time, I also aspire to connect with the world, allowing more English native speakers or international readers interested in my technical articles to discover the potential of this content.
Furthermore, from a technical blog management perspective, bilingual content significantly aids search engine optimization (SEO), bringing a wider range of organic traffic to the website.
To solve this problem, instead of spending a lot of time manually translating or forcing myself to change my writing language, I decided to leverage the power of AI to automate this process.
Focus on Creation, Leave Translation to AI
I recently implemented an automated translation workflow on my website based on GitHub Actions and the Gemini API:
- Maintain original writing habits: I only need to focus on writing Markdown articles in Chinese.
- Automated translation trigger: Whenever I push a new article to GitHub, GitHub Actions automatically executes a Python script in the background.
- Gemini takes over: The script scans for articles that don’t yet have an English version, calls the
gemini-2.5-flashmodel, and automatically translates the content accurately into fluent English. - Automatic website update: After translation is complete, the script automatically packages the content into an HTML block with Chinese/English switching functionality and commits the changes directly back to the repository.
Now, above this article (and other articles on the website), you should see a button that says “🌐 切換為英文 (Switch to English)”. All of this happens automatically, with no intervention required from me.
This way, I not only preserve the purity and joy of writing but also empower this website to reach a global audience.
Future Plans: Towards a More Modern Architecture
While the current approach effectively meets the needs of “focused creation + automated translation,” I know there’s still room for improvement on this website.
To provide a better reading experience and performance, I will continue to explore migrating the website architecture to Astro.js, which is lighter and loads faster. This will be combined with Astro’s native internationalization (i18n / Localization) features, making bilingual switching not just about hiding and showing content, but a modern architecture perfectly adapted from URL structure and metadata to interface language.
The world is vast, and language should not be a barrier to sharing knowledge. Moving forward, I’ll let AI continue to help me translate these words for more people who need them!