Skip to content

Add Bulgarian language support (bg) - #8

Open
valko1 wants to merge 1 commit into
fless-lab:masterfrom
valko1:feature/bulgarian-language
Open

valko1 wants to merge 1 commit into
fless-lab:masterfrom
valko1:feature/bulgarian-language

Conversation

@valko1

@valko1 valko1 commented Nov 4, 2026

Copy link
Copy Markdown

Summary

This PR introduces Bulgarian (bg) language support for Multilang-Python.

Changes

  • Added src/languages/bg.json with Bulgarian translations of Python keywords and built-in functions.
  • Added examples/bulgarian/factorial.py demonstrating Bulgarian syntax, functions, recursion, conditionals, loops, and built-in functions.
  • Bulgarian is automatically discovered through the existing language registration mechanism.

Testing

Tested on Windows 11 ARM64 with Python 3.14.

  • JSON schema validation: PASSED.
  • Bulgarian language registration: PASSED.
  • Bulgarian-to-Python transpilation: PASSED.
  • Factorial example execution: PASSED with the CLI execution fix described below.
  • Project-wide language validation: 0 errors, 773 warnings.

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 NameError because 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 --version handling, 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.py produces 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant