Polish Translation Scripts for wiks.wiki
Polish Translation Scripts for wiks.wiki
This directory contains scripts to automatically translate your Jekyll blog posts from English to Polish using OpenAIβs GPT-4.
Features
- π€ AI-Powered Translation: Uses GPT-4 to maintain your voice and meaning
- π© Feminine Voice: Automatically uses Polish feminine forms (ja, moja, moje, etc.)
- π Preserves Formatting: Maintains markdown, HTML links, and structure
- π Cross-Language Links: Adds links between English and Polish versions
- β‘ Batch Processing: Translate all posts at once or individual posts
- π― Smart Translation: Preserves technical terms and philosophical nuances
Setup
- Install Node.js dependencies:
- Set up OpenAI API key:
export OPENAI_API_KEY="your-openai-api-key-here"
Or add it to your shell profile (.zshrc, .bashrc, etc.):
echo 'export OPENAI_API_KEY="your-openai-api-key-here"' >> ~/.zshrc
source ~/.zshrc
- Create Polish posts directory:
Usage
Translate All Posts
Translate a Single Post
npm run translate-single 2025-09-13-systems-of-faith.markdown
Manual Translation
node translate-posts.js
node translate-single.js <post-filename>
How It Works
- Reads all markdown files from
_posts/ directory
- Parses front matter (title, subtitle, tags, etc.)
- Translates content using GPT-4 with specialized prompts
- Creates Polish versions in
_posts_pl/ directory
- Adds cross-language links and language indicators
Translation Quality
The script uses specialized prompts to:
- Maintain your intimate, personal writing style
- Preserve philosophical depth and intellectual sophistication
- Use appropriate Polish feminine forms throughout
- Keep technical terms in context (English when appropriate)
- Maintain the rhythm and pacing of your original writing
File Structure
scripts/
βββ translate-posts.js # Main translation script
βββ translate-single.js # Single post translation
βββ package.json # Node.js dependencies
βββ README.md # This file
_posts/ # Original English posts
_posts_pl/ # Generated Polish posts
Cost Estimation
- GPT-4 API: ~$0.03-0.06 per post (depending on length)
- Your 50+ posts: ~$1.50-3.00 total for complete translation
Next Steps
After running the translation:
- Review the generated Polish posts
- Add language switcher to your Jekyll layout
- Update navigation to include Polish posts
- Test the cross-language linking
Troubleshooting
- API Key Error: Make sure
OPENAI_API_KEY is set correctly
- Permission Error: Ensure the script has write access to
_posts_pl/
- Translation Quality: The script preserves your voice, but you may want to review technical terms