Repository navigation
Conversation
Add Bulgarian translations for Python keywords and built-in functions. Include a Bulgarian factorial example demonstrating functions, conditionals, recursion, loops and built-in functions. Language configuration validated against the project schema.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces Bulgarian (
bg) language support for Multilang-Python.Changes
src/languages/bg.jsonwith Bulgarian translations of Python keywords and built-in functions.examples/bulgarian/factorial.pydemonstrating Bulgarian syntax, functions, recursion, conditionals, loops, and built-in functions.Testing
Tested on Windows 11 ARM64 with Python 3.14.
Additional Issues Identified
During implementation and testing, two existing issues were identified.
1. CLI execution issue
The CLI currently executes translated code using:
exec(translated_code)This causes recursive functions to fail with
NameErrorbecause the executed code does not have a consistent global namespace.The issue was resolved locally by executing translated code with an explicit shared namespace:
exec(translated_code, namespace, namespace)Additional CLI improvements include correcting
--versionhandling, implementing--help, and improving execution error handling.These changes are not included in this PR and will be submitted separately.
2. Language validation warnings
Running
scripts/validate_all.pyproduces 773 warnings across all eight supported languages, including Bulgarian.The validator appears to check for English Python keywords and built-in functions as dictionary keys, whereas language mappings use translated identifiers as keys and Python identifiers as values.
This results in warnings about missing translations even when the mappings exist.
The suspected cause requires confirmation by reviewing the validator implementation. A separate fix is planned.
Scope
This PR intentionally contains only the Bulgarian language configuration and its example program.
The CLI execution fix and language validation improvements will be proposed in separate Pull Requests to keep changes independently reviewable.