Skip to content

Add Bulgarian translation#2585

Open
Pechenikov1 wants to merge 5 commits intoiNavFlight:maintenance-9.xfrom
Pechenikov1:add-bg-language
Open

Add Bulgarian translation#2585
Pechenikov1 wants to merge 5 commits intoiNavFlight:maintenance-9.xfrom
Pechenikov1:add-bg-language

Conversation

@Pechenikov1
Copy link

This PR adds full Bulgarian language support to INAV Configurator.

Changes:

  • Added locale/bg.json with complete translation of all interface strings
  • Registered Bulgarian language in the language selector

Testing:

  • Tested on versions 8.0.1 and 9.0.0
  • All interface elements are properly translated
  • No functionality issues found

The translation has been carefully checked and works flawlessly on both versions.

As requested, yarn.lock and .gitignore have been removed from this PR.
Only the translation files and language registration remain.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Branch Targeting Suggestion

You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:

  • maintenance-9.x - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.

  • maintenance-10.x - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x

If master is the correct target for this change, no action is needed.


This is an automated suggestion to help route contributions to the appropriate branch.

@qodo-code-review
Copy link
Contributor

Review Summary by Qodo

Add Bulgarian language support to INAV Configurator

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Adds Bulgarian language support to INAV Configurator
• Registers Bulgarian locale in available languages list
• Includes complete Bulgarian translation file
Diagram
flowchart LR
  A["Language Registration"] -- "adds 'bg' to availableLanguages" --> B["Bulgarian Support Enabled"]
  C["Bulgarian Translation File"] -- "locale/bg/messages.json" --> B
Loading

Grey Divider

File Changes

1. js/localization.js ⚙️ Configuration changes +1/-1

Register Bulgarian in language selector

• Adds Bulgarian ('bg') to the availableLanguages array
• Maintains alphabetical ordering with other language codes

js/localization.js


2. locale/bg/messages.json ✨ Enhancement +6271/-0

Complete Bulgarian translation strings

• New file containing complete Bulgarian translation
• Includes all interface strings for INAV Configurator
• Enables full Bulgarian language support

locale/bg/messages.json


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Mar 5, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Bulgarian option shows false 🐞 Bug ✓ Correctness
Description
bg is added to availableLanguages, but locale/en/messages.json does not define language_bg.
The language selector builds option labels via i18n.getMessage('language_' + lng), which returns
false when the key doesn’t exist, so the Bulgarian entry will display incorrectly.
Code

js/localization.js[9]

+const availableLanguages = ['en', 'ja', 'ru', 'bg', 'uk', 'zh_CN'];
Evidence
The selector iterates over availableLanguages and looks up language_<code> for each language.
Missing keys cause i18n.getMessage to return false, and English is the configured fallback
language; since English lacks language_bg, the lookup fails in most UI languages.

js/localization.js[9-9]
js/configurator_main.js[345-347]
js/localization.js[81-87]
locale/en/messages.json[1-28]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Bulgarian (`bg`) was added to the supported languages list, but the base English locale is missing the `language_bg` label. The language selector builds each option label by translating `language_&lt;code&gt;` and will render `false` when the key doesn’t exist.

### Issue Context
- The app iterates over `availableLanguages` and uses `i18n.getMessage(&#x27;language_&#x27; + lng)` to label each dropdown option.
- `i18n.getMessage` returns `false` if the key doesn’t exist.
- i18next fallback is configured to English (`fallbackLng: &#x27;en&#x27;`), so English must contain labels for all supported languages.

### Fix Focus Areas
- js/localization.js[9-9]
- js/configurator_main.js[345-347]
- locale/en/messages.json[1-28]

### Proposed change
Add:
```json
&quot;language_bg&quot;: {
 &quot;message&quot;: &quot;Български&quot;,
 &quot;_comment&quot;: &quot;Don&#x27;t translate!&quot;
}
```
near the other `language_*` entries in `locale/en/messages.json`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Duplicate language_bg key 🐞 Bug ⛯ Reliability
Description
locale/bg/messages.json defines language_bg twice; JSON parsing will silently keep only the last
occurrence. Even though both values are currently identical, this is data loss by definition and
indicates the file may have been generated/merged incorrectly.
Code

locale/bg/messages.json[R219-222]

+  "language_bg": {
+    "message": "Български",
+    "_comment": "Don't translate!"
+  },
Evidence
The same JSON object key appears twice in the same file. In standard JSON parsing, duplicate keys
are not rejected; the last one wins, silently overwriting the earlier entry and making future
maintenance/error detection harder.

locale/bg/messages.json[13-16]
locale/bg/messages.json[219-222]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Bulgarian locale file contains a duplicate JSON key (`language_bg`) defined twice. JSON.parse will keep only the last definition, silently overwriting the first.

### Issue Context
Even if both current values are identical, duplicates are risky because they can hide accidental differences and are hard to review/maintain.

### Fix Focus Areas
- locale/bg/messages.json[13-16]
- locale/bg/messages.json[219-222]

### Proposed change
Delete one of the two `language_bg` blocks (recommend deleting the later one around the SITL section), ensuring `language_bg` remains present exactly once.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo



const availableLanguages = ['en', 'ja', 'ru', 'uk', 'zh_CN'];
const availableLanguages = ['en', 'ja', 'ru', 'bg', 'uk', 'zh_CN'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Bulgarian option shows false 🐞 Bug ✓ Correctness

bg is added to availableLanguages, but locale/en/messages.json does not define language_bg.
The language selector builds option labels via i18n.getMessage('language_' + lng), which returns
false when the key doesn’t exist, so the Bulgarian entry will display incorrectly.
Agent Prompt
### Issue description
Bulgarian (`bg`) was added to the supported languages list, but the base English locale is missing the `language_bg` label. The language selector builds each option label by translating `language_<code>` and will render `false` when the key doesn’t exist.

### Issue Context
- The app iterates over `availableLanguages` and uses `i18n.getMessage('language_' + lng)` to label each dropdown option.
- `i18n.getMessage` returns `false` if the key doesn’t exist.
- i18next fallback is configured to English (`fallbackLng: 'en'`), so English must contain labels for all supported languages.

### Fix Focus Areas
- js/localization.js[9-9]
- js/configurator_main.js[345-347]
- locale/en/messages.json[1-28]

### Proposed change
Add:
```json
"language_bg": {
  "message": "Български",
  "_comment": "Don't translate!"
}
```
near the other `language_*` entries in `locale/en/messages.json`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 7, 2026

@sensei-hacker sensei-hacker changed the base branch from master to maintenance-9.x March 7, 2026 19:16
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