Skip to content

Adding french locale (fr)#2584

Closed
zbcrft wants to merge 3 commits intoiNavFlight:masterfrom
zbcrft:master
Closed

Adding french locale (fr)#2584
zbcrft wants to merge 3 commits intoiNavFlight:masterfrom
zbcrft:master

Conversation

@zbcrft
Copy link

@zbcrft zbcrft commented Mar 5, 2026

I added a new messages.json locale file translated in french using a python script and the deep_translator library.
There may be some bad translations for some messages.

@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 French locale (fr) translation support

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add French locale support with translated messages
• Register 'fr' language in available languages list
• Add French language identifier to all existing locale files
• Update documentation to reflect new French locale
Diagram
flowchart LR
  A["French Locale Added"] --> B["Register in localization.js"]
  A --> C["Create fr/messages.json"]
  A --> D["Add language_fr to all locales"]
  D --> E["Update CLAUDE.md docs"]
Loading

Grey Divider

File Changes

1. js/localization.js ✨ Enhancement +1/-1

Register French in available languages

• Add 'fr' to the availableLanguages array
• Enables French language selection in the application

js/localization.js


2. locale/en/messages.json ✨ Enhancement +4/-0

Add French language identifier

• Add language_fr entry with "Français" message
• Maintains consistency across locale files

locale/en/messages.json


3. locale/ja/messages.json ✨ Enhancement +4/-0

Add French language identifier

• Add language_fr entry with "Français" message
• Ensures French option appears in Japanese locale

locale/ja/messages.json


View more (5)
4. locale/ru/messages.json ✨ Enhancement +4/-0

Add French language identifier

• Add language_fr entry with "Français" message
• Ensures French option appears in Russian locale

locale/ru/messages.json


5. locale/uk/messages.json ✨ Enhancement +4/-0

Add French language identifier

• Add language_fr entry with "Français" message
• Ensures French option appears in Ukrainian locale

locale/uk/messages.json


6. locale/zh_CN/messages.json ✨ Enhancement +4/-0

Add French language identifier

• Add language_fr entry with "Français" message
• Ensures French option appears in Chinese locale

locale/zh_CN/messages.json


7. locale/fr/messages.json ✨ Enhancement +6240/-0

Create French translation messages file

• Create new French locale file with complete message translations
• Translated using deep_translator library with manual corrections
• Contains all UI messages in French

locale/fr/messages.json


8. CLAUDE.md 📝 Documentation +1/-1

Update documentation for French locale

• Update locale directory documentation to include 'fr'
• Reflects addition of French to supported languages list

CLAUDE.md


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. Null French header labels 🐞 Bug ✓ Correctness
Description
locale/fr/messages.json contains several entries with "message": null (e.g. logicId, pidId,
WaypointOptionId). These keys are used as table headers, so French UI will show blank/incorrect
headers instead of symbols like #/+.
Code

locale/fr/messages.json[R5157-5159]

+    "logicId": {
+        "message": null
+    },
Evidence
French locale defines null values for header keys, while English defines concrete symbols. These
keys are referenced by data-i18n in HTML table headers, and localization code assigns
value.message directly (so null propagates to the rendered DOM).

locale/fr/messages.json[5154-5162]
locale/fr/messages.json[5346-5351]
locale/fr/messages.json[5361-5364]
locale/en/messages.json[5187-5190]
locale/en/messages.json[5376-5381]
locale/en/messages.json[5391-5393]
tabs/mixer.html[180-184]
tabs/programming.html[20-44]
tabs/mission_control.html[456-466]
js/localization.js[63-67]
js/localization.js[129-145]

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 new French locale contains several translations where `message` is `null` (e.g., `logicId`, `pidId`, `WaypointOptionId`). These IDs are used as table headers in the UI; `null` will render as blank/incorrect text in French.

## Issue Context
`js/localization.js` flattens each locale entry to its `.message` value, so `null` becomes the effective translation value.

## Fix Focus Areas
- locale/fr/messages.json[5157-5162]
- locale/fr/messages.json[5346-5351]
- locale/fr/messages.json[5361-5364]
- locale/en/messages.json[5187-5190]
- locale/en/messages.json[5376-5381]
- locale/en/messages.json[5391-5393]

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



Remediation recommended

2. Locale load is fragile 🐞 Bug ⛯ Reliability
Description
i18n.init() loads and parses all locale files without handling per-locale failures; any
import/JSON parse error rejects the promise chain. Adding a large auto-generated fr locale
increases the risk that one bad locale prevents i18n (and thus UI localization) from initializing at
all.
Code

js/localization.js[9]

+const availableLanguages = ['en', 'ja', 'ru', 'uk', 'zh_CN', 'fr'];
Evidence
Initialization loads every language in availableLanguages (now including fr). During this
process, parseInputFile uses JSON.parse and there is no surrounding try/catch or .catch() on
the loadMessages(...).then(...) chain, so one failure can abort initialization.

js/localization.js[9-18]
js/localization.js[25-33]
js/localization.js[62-66]

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

## Issue description
Localization initialization can fail entirely if any locale file import or JSON parse fails, because `loadMessages()`/`parseInputFile()` errors are not handled and `i18n.init()` does not attach a rejection handler.

## Issue Context
This becomes more likely as new locales are added (e.g., generated files), increasing the chance of malformed JSON or missing assets.

## Fix Focus Areas
- js/localization.js[13-20]
- js/localization.js[25-51]
- js/localization.js[53-69]

ⓘ 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

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

Comment on lines +5157 to +5159
"logicId": {
"message": null
},
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. Null french header labels 🐞 Bug ✓ Correctness

locale/fr/messages.json contains several entries with "message": null (e.g. logicId, pidId,
WaypointOptionId). These keys are used as table headers, so French UI will show blank/incorrect
headers instead of symbols like #/+.
Agent Prompt
## Issue description
The new French locale contains several translations where `message` is `null` (e.g., `logicId`, `pidId`, `WaypointOptionId`). These IDs are used as table headers in the UI; `null` will render as blank/incorrect text in French.

## Issue Context
`js/localization.js` flattens each locale entry to its `.message` value, so `null` becomes the effective translation value.

## Fix Focus Areas
- locale/fr/messages.json[5157-5162]
- locale/fr/messages.json[5346-5351]
- locale/fr/messages.json[5361-5364]
- locale/en/messages.json[5187-5190]
- locale/en/messages.json[5376-5381]
- locale/en/messages.json[5391-5393]

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

@zbcrft zbcrft closed this Mar 5, 2026
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