lahtis/Self-Healing-Localization ? reverse-engineered prompt

Reverse engineered prompt

Build me a lightweight Python library for automatic localization that keeps itself updated when translations are missing.

I want to be able to give it a base language, a target language, and a key like welcome_msg, then have it return the right translated text, create missing entries automatically, and save them into the correct language files. It should support region specific language codes like pt-BR and zh-TW, work offline if no translation service is available, and optionally use online translation providers when API keys are set. It should also handle prompt templates the same way as UI text, and let me switch languages at runtime.

Please make it clean, dependency free, and easy to drop into any Python project. Include a simple config system, sensible defaults, JSON file handling, logging, and tests that show the main workflow. If you need to look up current provider docs online, go ahead.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab