Skip to content

feat(i18n): add localization for blacklisted devices & misc additions#73

Draft
Ajit-Mehrotra wants to merge 89 commits intomainfrom
feature-translation
Draft

feat(i18n): add localization for blacklisted devices & misc additions#73
Ajit-Mehrotra wants to merge 89 commits intomainfrom
feature-translation

Conversation

@Ajit-Mehrotra
Copy link
Copy Markdown

@Ajit-Mehrotra Ajit-Mehrotra commented Aug 11, 2025

Changes Made:

Main.qml:

  • Made UI strings related to guid & blacklisting into qsTr() strings, which marks them for translation

Translation files (.ts):

Added translations for:

  • All Languages

    • <source>GUID: %1 &lt;font color=&apos;red&apos;&gt;[BLACKLISTED]&lt;/font&gt;</source>
    • <source>&lt;font color=&apos;red&apos;&gt;[MISSING GUID - Choose Another Flash Device]&lt;/font&gt;</source>
    • <source>This USB device is blacklisted. You may not be able to use this device to get an Unraid license or trial.</source>
  • German Language

    • <source>Mounted as %1 </source>
    • <source>Language: </source>
    • <source>Keyboard: </source>
    • <source>Info</source>
    • Select Language
    • <source>Help</source>

Summary by CodeRabbit

  • New Features

    • Added language selection, keyboard layout labels, and an Info section.
    • Introduced Help and enhanced navigation labels (e.g., Back).
    • New device-state indicators: Mounted as %1 variants and [WRITE PROTECTED].
    • Licensing safeguards: clear warnings for missing/blacklisted USB GUIDs with guidance.
  • Refactor

    • Consolidated and updated translations for the main UI; removed obsolete messages to streamline text.
  • Style

    • Polished UI text consistency and minor layout adjustments to improve readability without changing functionality.

jlre249 and others added 30 commits March 19, 2024 12:45
* main window in pretty good shape - now onto the popup boxes

* hw popup + delegate, os popup + delegate, and dst popup + delegate pretty much in a good spot. based on how the icons are displayed, didn't end up needing orange pngs, because the dark ones can be changed using ColorOverlay

* about to start working on options popup

* think the settings menu seems okay now

* language/keyboard selector & progress bar theming

* removal of a few now unused rpi pngs

* replace instances of "#2B2A29" with new UnColors singleton member mediumGray

* replace instances of "#FF8C2F" with new UnColors singleton member orange

* replace instances of "#1C1B1B" with new UnColors singleton member darkGray

* replace instances of "#FFFFFF" with color name white
* removes "use saved settings" pop up and always displays options popup instead
* ico for windows

* removed rpi-imager.ico and rpi-image.png; mods to CMakeLists.txt to swap from rpi to unraid for windows RC file and copying to 128x128 app icon folder, will need a few other changes to make this work with linux still

* renaming application from rpi-imager to unraid-imager

* changes for linux

* mac icns
* changed os list url in config.h

* default select unraid device on load
* seems to be in a good place now for both ident and network config

* added in the boot img stuff from the old usb creator (this also ensures that the volume label gets changed to UNRAID)

* get rid of unnecessary if inside else clause

* works on windows, though i did have to disable secure boot

* some misc cleanup: *help button linking to website *info button opening "about" popup *putenv to enable darkmode title bar on windows *remove obe img gz files *minor text edits *changed logo background from white to darkgray

* pushing to check on linux and mac
* local commit before switching branches

* pushing to check on linux

* working on linux

* committing new files

* completely disable devices in list that have an invalid guid
misc updates:
* shrink help/info icons + add text 
* hyperlink urls in about popup 
*adjust text in about popup 
*adjust wording of formatting text 
*adjust wording of custom img select 
*limit custom img select to zip files 
*adjust wording of invalid guid text 
*add text for missing guid
* renaming unraid-imager -> unraid-usb-creator

* more renaming + new icons

* guid working on mac, troubleshooting make bootable

* rename on format for mac

* rather than trying to make the make bootable script work on all platforms (since it's only needed for legacy boot, and we don't let the user select that as an option right now), simply display a message telling the user to run the script after burn successful

* fix embedded links in info popup

* adding back in linux drive renaming

* deb file updates
Co-authored-by: Jessica Reid <jlr@Jessicas-Mini-875.hsd1.va.comcast.net>
Always Run make_bootable.bat on Windows
The legacy url currently being linked to is going away
# Conflicts:
#	src/imagewriter.cpp
#	src/linux/org.raspberrypi.rpi-imager.desktop
elibosley and others added 26 commits October 11, 2024 09:46
part 3 up to line 480
* is it this easy?

* let's try this again

* once more with feeling

* let's see if these replace the "2" qml modules from qt5

* try updating control file for debuild

* needed for linguist tools?

* see if this fixes Qt6::lprodump cmake error

* revert previous changes

* trying with install-qt-action

* syntax error

* try specifying something other than latest for os

* once more

* upload deb artifact

* see if we can hack something together here

* pick a runner that it can actually find

* keep running up that hill

* just gonna keep trying some stuff

* maybe?

* just need to re-trigger the github action

* remove changes to mac yml

* remove trailing whitespace from yml
- cmake 3.31 (<4.0)
- Qt 5 (not Qt6 or latest)
- add dmg wrapping for .app for drag and drop installation

**Important**: codesigning is still pending automation. Currently dev must:

1. double click the .dmg (drop .app into Applications folder)

2. then finally remove quarantine from .app in Applications folder:

`xattr -d com.apple.quarantine /Applications/unraid-usb-creator.app`
- convert GUID validation errors to warnings, allowing users to proceed with Unraid installation even when device GUID is invalid. This supports Unraid 7.2's upcoming internal drive installation via USB.

- update gitignore for qt creator and fix build folder typo
use `#!/usr/bin/env bash` for portability
chore(macos): fix build workflow for macos
feat(gui): allow selecting blacklisted drives & add info tooltip
… for missing localizations (mostly for german)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 11, 2025

📝 Walkthrough

Walkthrough

Consolidates i18n strings into main context and relocates source references to ../main.qml across de/en/es/fr/zh TS files, adding GUID blacklist/device-state texts and marking many legacy contexts/messages as vanished. src/main.qml undergoes formatting and translation-wrapping (qsTr) adjustments without functional logic changes.

Changes

Cohort / File(s) Summary
i18n consolidation and relocation
src/i18n/unraid-usb-creator_en.ts, src/i18n/unraid-usb-creator_de.ts, src/i18n/unraid-usb-creator_es.ts, src/i18n/unraid-usb-creator_fr.ts, src/i18n/unraid-usb-creator_zh.ts
Centralize translations under main context; relocate locations from usb-creator-next/src/main.qml to ../main.qml; add GUID-related and write-protection strings; mark numerous legacy contexts (Download*, DriveFormatThread, ImageWriter, LocalFileExtractThread, MsgPopup, OptionsPopup, QObject, UnraidOptionsPopup, UseSavedSettingsPopup) and messages as vanished.
UI source updates
src/main.qml
Formatting/whitespace normalization; add qsTr wrappers around UI text; minor layout expression cleanup; no control-flow or API changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • elibosley

Poem

A rabbit taps keys with a gentle delight,
Herding stray words into main.qml’s light.
Blacklists warned, GUIDs now clear,
Strings hop together, tidy and near.
With qsTr burrows neat and tight—
I twitch my nose: translations right!
Bun-approved. ✅🐇

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature-translation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot requested a review from elibosley August 11, 2025 14:10
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 11

🧹 Nitpick comments (8)
src/i18n/unraid-usb-creator_fr.ts (1)

582-585: Wording nit: “Flash Device” vs “périphérique USB”

If the UI elsewhere says “clé USB”, consider aligning for consistency: “GUID MANQUANT – Choisissez une autre clé USB”.

src/i18n/unraid-usb-creator_es.ts (1)

603-606: Restore trailing colon and space to match source

Keep “: ” to match source and UI spacing.

-        <source>Help / Feedback: </source>
-        <translation>Ayuda / Comentarios</translation>
+        <source>Help / Feedback: </source>
+        <translation>Ayuda / Comentarios: </translation>
src/i18n/unraid-usb-creator_zh.ts (2)

4-18: Unnamed context with only vanished entries

These can be safely removed to reduce noise; leaving an empty-name context is unusual in TS files.

-<context>
-    <name></name>
-    <message>
-        <source>Play sound when finished</source>
-        <translation type="vanished">完成时播放声音</translation>
-    </message>
-    <message>
-        <source>Eject media when finished</source>
-        <translation type="vanished">完成时弹出媒体</translation>
-    </message>
-    <message>
-        <source>SAVE</source>
-        <translation type="vanished">保存</translation>
-    </message>
-</context>

535-538: Optional wording tweak: “Released: %1”

If this is a date, “发布日期:%1” may be clearer than “发行版本:%1”.

src/i18n/unraid-usb-creator_en.ts (1)

190-193: Mark new GUID/blacklist strings as finished (English)

For en_US, leaving as “unfinished” falls back to source, which is fine. Still, marking these four new entries as finished avoids ambiguity in tooling.

-        <source>GUID: %1</source>
-        <translation type="unfinished"></translation>
+        <source>GUID: %1</source>
+        <translation>GUID: %1</translation>

-        <source>GUID: %1 &lt;font color=&apos;red&apos;&gt;[BLACKLISTED]&lt;/font&gt;</source>
-        <translation type="unfinished"></translation>
+        <source>GUID: %1 &lt;font color=&apos;red&apos;&gt;[BLACKLISTED]&lt;/font&gt;</source>
+        <translation>GUID: %1 &lt;font color=&apos;red&apos;&gt;[BLACKLISTED]&lt;/font&gt;</translation>

-        <source>&lt;font color=&apos;red&apos;&gt;[MISSING GUID - Choose Another Flash Device]&lt;/font&gt;</source>
-        <translation type="unfinished"></translation>
+        <source>&lt;font color=&apos;red&apos;&gt;[MISSING GUID - Choose Another Flash Device]&lt;/font&gt;</source>
+        <translation>&lt;font color=&apos;red&apos;&gt;[MISSING GUID - Choose Another Flash Device]&lt;/font&gt;</translation>

-        <source>This USB device is blacklisted. You may not be able to use this device to get an Unraid license or trial.</source>
-        <translation type="unfinished"></translation>
+        <source>This USB device is blacklisted. You may not be able to use this device to get an Unraid license or trial.</source>
+        <translation>This USB device is blacklisted. You may not be able to use this device to get an Unraid license or trial.</translation>

Also applies to: 195-198, 200-203, 205-208

src/main.qml (2)

1359-1381: Well-implemented GUID validation and blacklist UI

The GUID display logic correctly handles three states:

  1. Valid GUID - displays normally
  2. Blacklisted GUID - displays with red warning
  3. Missing GUID - displays error message

All strings are properly internationalized with qsTr().

Consider verifying that the red color (<font color='red'>) provides sufficient contrast against the dark gray background for accessibility. You might want to use a specific hex color like #ff6b6b for better visibility.


1044-1044: Complex icon selection logic preserved

The nested ternary operator correctly handles icon selection based on hover state and icon type.

Consider extracting this complex ternary into a helper function for better readability:

function getIconSource(iconUrl, isMouseOver) {
    if (iconUrl === "https://craftassets.unraid.net/static/favicon/favicon.ico") {
        return isMouseOver ? "unraid/icons/un-mark-dark-gray.svg" : "unraid/icons/un-mark-gradient.svg";
    } else if (iconUrl === "icons/erase.png") {
        return isMouseOver ? "unraid/icons/erase_dark_gray.svg" : "unraid/icons/erase_orange.svg";
    } else if (iconUrl === "icons/use_custom.png") {
        return isMouseOver ? "unraid/icons/use_custom_dark_gray.svg" : "unraid/icons/use_custom_orange.svg";
    }
    return iconUrl;
}
src/i18n/unraid-usb-creator_de.ts (1)

384-688: Note: Some existing strings remain untranslated

While the new GUID/blacklist strings have been translated, many existing UI strings that were moved to the main context remain untranslated (marked as type="unfinished"). This is acceptable for this PR which focuses on the new functionality, but these should be addressed in a follow-up.

Would you like me to help create a follow-up issue to track the completion of German translations for the remaining UI strings?

Comment on lines +454 to 458
<location filename="../main.qml" line="319"/>
<location filename="../main.qml" line="1491"/>
<source>Cancelling...</source>
<translation>Cancelado...</translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

“Cancelling...” should be progressive, not past tense

Use “Cancelando...” (in-progress), not “Cancelado...” (completed).

-        <source>Cancelling...</source>
-        <translation>Cancelado...</translation>
+        <source>Cancelling...</source>
+        <translation>Cancelando...</translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="319"/>
<location filename="../main.qml" line="1491"/>
<source>Cancelling...</source>
<translation>Cancelado...</translation>
</message>
<location filename="../main.qml" line="319"/>
<location filename="../main.qml" line="1491"/>
<source>Cancelling...</source>
<translation>Cancelando...</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_es.ts around lines 454 to 458, the Spanish
translation for "Cancelling..." is incorrectly in past tense ("Cancelado...");
replace it with the progressive present "Cancelando..." in that <translation>
element so the UI shows an in-progress cancellation state for both referenced
locations.

Comment on lines +460 to 463
<location filename="../main.qml" line="331"/>
<source>CANCEL VERIFY</source>
<translation>Cancelando...</translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Incorrect label for “CANCEL VERIFY”

This is a button label; translate as “CANCELAR VERIFICACIÓN”.

-        <source>CANCEL VERIFY</source>
-        <translation>Cancelando...</translation>
+        <source>CANCEL VERIFY</source>
+        <translation>CANCELAR VERIFICACIÓN</translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="331"/>
<source>CANCEL VERIFY</source>
<translation>Cancelando...</translation>
</message>
<location filename="../main.qml" line="331"/>
<source>CANCEL VERIFY</source>
<translation>CANCELAR VERIFICACIÓN</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_es.ts around lines 460 to 463, the translation
for the button label "CANCEL VERIFY" is incorrectly given as "Cancelando...";
change it to the imperative phrase "CANCELAR VERIFICACIÓN" (or "CANCELAR
VERIFICACIÓN" in all caps to match UI style) so the label correctly reads as a
cancel action for the verification process.

Comment on lines +547 to 550
<location filename="../main.qml" line="1102"/>
<source>Online - %1 GB download</source>
<translation>En línea - %1 GB descarga</translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve phrasing for download size

“En línea - %1 GB descarga” is unnatural. Prefer “En línea - descarga de %1 GB”.

-        <source>Online - %1 GB download</source>
-        <translation>En línea - %1 GB descarga</translation>
+        <source>Online - %1 GB download</source>
+        <translation>En línea - descarga de %1 GB</translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="1102"/>
<source>Online - %1 GB download</source>
<translation>En línea - %1 GB descarga</translation>
</message>
<location filename="../main.qml" line="1102"/>
<source>Online - %1 GB download</source>
<translation>En línea - descarga de %1 GB</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_es.ts around lines 547 to 550, update the Spanish
translation for the source "Online - %1 GB download" to use natural phrasing;
replace "En línea - %1 GB descarga" with "En línea - descarga de %1 GB" so the
sentence reads correctly in Spanish.

Comment on lines +557 to 560
<location filename="../main.qml" line="1248"/>
<source> Mounted as %1</source>
<translation>Montado como %1</translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Preserve leading space in “ Mounted as %1”

The leading space is significant for in-line concatenation. Mirror it in the translation.

-        <source> Mounted as %1</source>
-        <translation>Montado como %1</translation>
+        <source> Mounted as %1</source>
+        <translation> Montado como %1</translation>

Add leading space to Spanish translation

Lines 557–560 in src/i18n/unraid-usb-creator_es.ts need the same leading space present in the source string for correct inline concatenation.

-        <source> Mounted as %1</source>
-        <translation>Montado como %1</translation>
+        <source> Mounted as %1</source>
+        <translation> Montado como %1</translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="1248"/>
<source> Mounted as %1</source>
<translation>Montado como %1</translation>
</message>
<location filename="../main.qml" line="1248"/>
<source> Mounted as %1</source>
<translation> Montado como %1</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_es.ts around lines 557 to 560, the Spanish
translation for the source string " Mounted as %1" is missing the leading space;
update the translation to include the same leading space before "Montado" so it
matches the source and preserves correct inline concatenation.

💡 Verification agent

🧩 Analysis chain

Automated verification for space and unfinished issues (optional)

Run this to verify leading/trailing spaces and unfinished translations in ES file.

Also applies to: 562-565, 572-575


🏁 Script executed:

#!/bin/bash
set -euo pipefail

f="src/i18n/unraid-usb-creator_es.ts"

echo "Check leading space for ' Mounted as %1'..."
awk '
  /<source> Mounted as %1<\/source>/{getline; print; exit}
' "$f" | sed -n 's/^[[:space:]]*<translation>\(.*\)<\/translation>.*/\1/p' | \
  grep -q "^ " || { echo "Missing leading space in translation for ' Mounted as %1'"; exit 1; }

echo "Check trailing space for 'Mounted as %1 '..."
awk '
  /<source>Mounted as %1 <\/source>/{getline; print; exit}
' "$f" | sed -n 's/^[[:space:]]*<translation>\(.*\)<\/translation>.*/\1/p' | \
  grep -q " $" || { echo "Missing trailing space in translation for 'Mounted as %1 '"; exit 1; }

echo "Check unfinished for 'GUID: %1'..."
awk '
  /<source>GUID: %1<\/source>/{getline; print; exit}
' "$f" | grep -q 'type="unfinished"' && { echo "GUID: %1 is still unfinished"; exit 1; }

echo "All checks passed."

Length of output: 486


Add missing leading space in Spanish translation

The Spanish translation for <source> Mounted as %1</source> in src/i18n/unraid-usb-creator_es.ts is missing its leading space. Please update and apply the same checks to the other occurrences:

• File: src/i18n/unraid-usb-creator_es.ts
– Lines 557–560: change
```diff

  • Montado como %1
  • Montado como %1

• Also apply to the similar blocks at lines 562–565 and 572–575, ensuring any trailing spaces and that GUID: %1 translations are not marked unfinished.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="1248"/>
<source> Mounted as %1</source>
<translation>Montado como %1</translation>
</message>
<location filename="../main.qml" line="1248"/>
<source> Mounted as %1</source>
- <translation>Montado como %1</translation>
+ <translation> Montado como %1</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_es.ts around lines 557–560 (and also inspect the
similar blocks at 562–565 and 572–575), the Spanish translation for "<source>
Mounted as %1</source>" is missing the leading space — update the translation
strings to include the leading space before "Montado" (i.e., " Montado como
%1"), remove any unintended trailing spaces, and ensure the corresponding "GUID:
%1" translations in those blocks are translated and not marked as unfinished;
apply the same fixes to the two other occurrences mentioned.

Comment on lines +562 to +565
<location filename="../main.qml" line="1336"/>
<source>Mounted as %1 </source>
<translation>Montado como %1</translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Preserve trailing space in “Mounted as %1 ”

This variant carries a trailing space. Keep it to match UI spacing.

-        <source>Mounted as %1 </source>
-        <translation>Montado como %1</translation>
+        <source>Mounted as %1 </source>
+        <translation>Montado como %1 </translation>

#!/bin/bash
# Show the <location>, <source>, and <translation> for line 1336 across all locale files
rg -A2 '<location filename="../main.qml" line="1336"' -n src/i18n/unraid-usb-creator_*.ts

Update Spanish translation to preserve trailing space

Please include the trailing space after %1 in the Spanish <translation> to match the source string’s UI spacing.

• File: src/i18n/unraid-usb-creator_es.ts
• Around line 564–565

-        <source>Mounted as %1 </source>
-        <translation>Montado como %1</translation>
+        <source>Mounted as %1 </source>
+        <translation>Montado como %1 </translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="1336"/>
<source>Mounted as %1 </source>
<translation>Montado como %1</translation>
</message>
<location filename="../main.qml" line="1336"/>
<source>Mounted as %1 </source>
<translation>Montado como %1 </translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_es.ts around lines 562 to 565, the Spanish
translation for the source string "Mounted as %1 " is missing the trailing space
after %1; update the <translation> text so it exactly matches the source spacing
by adding a single space after %1 (i.e., "Montado como %1 ") and save the file
so the UI spacing is preserved.

Comment on lines +572 to +575
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation type="unfinished"></translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Finish translation for “GUID: %1”

Avoid “unfinished” to ensure consistent runtime output.

-        <source>GUID: %1</source>
-        <translation type="unfinished"></translation>
+        <source>GUID: %1</source>
+        <translation>GUID: %1</translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation type="unfinished"></translation>
</message>
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation>GUID: %1</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_es.ts around lines 572 to 575, the translation
entry for "GUID: %1" is marked type="unfinished"; replace the empty/unfinished
translation with a finished Spanish string such as "Identificador GUID: %1" (or
"GUID: %1" if you prefer the acronym unchanged) and remove the type="unfinished"
attribute so the runtime shows the completed translation.

Comment on lines +593 to 596
<location filename="../main.qml" line="1406"/>
<source>About</source>
<translation>Más información</translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use standard term for “About”

“Más información” is not the usual title for About dialog. Use “Acerca de”.

-        <source>About</source>
-        <translation>Más información</translation>
+        <source>About</source>
+        <translation>Acerca de</translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="1406"/>
<source>About</source>
<translation>Más información</translation>
</message>
<location filename="../main.qml" line="1406"/>
<source>About</source>
<translation>Acerca de</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_es.ts around lines 593 to 596, the Spanish
translation for the "About" dialog currently uses "Más información"; change it
to the standard term "Acerca de" by replacing the translation string so the
About dialog uses the conventional Spanish title.

Comment on lines +572 to +575
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation type="unfinished"></translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Finish translation for “GUID: %1”

Currently marked unfinished. Provide a localized string to avoid fallback.

-        <source>GUID: %1</source>
-        <translation type="unfinished"></translation>
+        <source>GUID: %1</source>
+        <translation>GUID : %1</translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation type="unfinished"></translation>
</message>
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation>GUID : %1</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_fr.ts around lines 572 to 575, the translation
for "GUID: %1" is marked unfinished; replace the empty translation with the
localized French string keeping the placeholder (use "GUID : %1" with a
non-breaking space before the colon) and remove the type="unfinished" attribute
so the file provides a proper French translation and avoids fallback.

Comment on lines +575 to +578
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation type="unfinished"></translation>
</message>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Finish translation for “GUID: %1”

Provide a localized translation.

-        <source>GUID: %1</source>
-        <translation type="unfinished"></translation>
+        <source>GUID: %1</source>
+        <translation>GUID:%1</translation>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation type="unfinished"></translation>
</message>
<location filename="../main.qml" line="1361"/>
<source>GUID: %1</source>
<translation>GUID:%1</translation>
</message>
🤖 Prompt for AI Agents
In src/i18n/unraid-usb-creator_zh.ts around lines 575 to 578, the translation
for "GUID: %1" is missing; add a proper Chinese translation that preserves the
placeholder %1 (e.g., "GUID:%1" or a localized equivalent), replacing the empty
translation value so the string and its variable placeholder remain intact.

Comment thread src/main.qml
Comment on lines +1621 to 1697
function filterItems(list, tags, matchingType) {
if (!tags || !tags.length)
return

var i = list.length
return;
var i = list.length;
while (i--) {
var entry = list[i]
var entry = list[i];

if ("devices" in entry && entry["devices"].length) {
var foundTag = false

switch(matchingType) {
case 0: /* exact matching */
case 2: /* exact matching */
for (var j in tags)
{
if (entry["devices"].includes(tags[j]))
{
foundTag = true
break
}
}
/* If there's no match, remove this item from the list. */
if (!foundTag)
{
list.splice(i, 1)
continue
var foundTag = false;

switch (matchingType) {
case 0: /* exact matching */
case 2 /* exact matching */
:
for (var j in tags) {
if (entry["devices"].includes(tags[j])) {
foundTag = true;
break;
}
break
case 1: /* Exlusive by prefix matching */
case 3: /* Inclusive by prefix matching */
for (var deviceTypePrefix in tags) {
for (var deviceSpec in entry["devices"]) {
if (deviceSpec.startsWith(deviceTypePrefix)) {
foundTag = true
break
}
}
/* If there's no match, remove this item from the list. */
if (!foundTag) {
list.splice(i, 1);
continue;
}
break;
case 1: /* Exlusive by prefix matching */
case 3 /* Inclusive by prefix matching */
:
for (var deviceTypePrefix in tags) {
for (var deviceSpec in entry["devices"]) {
if (deviceSpec.startsWith(deviceTypePrefix)) {
foundTag = true;
break;
}
/* Terminate outer loop early if we've already
}
/* Terminate outer loop early if we've already
* decided it's a match
*/
if (foundTag) {
break
}
}
/* If there's no match, remove this item from the list. */
if (!foundTag)
{
list.splice(i, 1)
continue
if (foundTag) {
break;
}
break
}
/* If there's no match, remove this item from the list. */
if (!foundTag) {
list.splice(i, 1);
continue;
}
break;
}
} else {
/* No device list attached? If we're in an exclusive mode that's bad news indeed. */
switch (matchingType) {
case 0:
case 1:
if (!("subitems" in entry)) {
/* If you're not carrying subitems, you're not going in. */
list.splice(i, 1)
}
break
case 2:
case 3:
/* Inclusive filtering. We're keeping this one. */
break;
case 0:
case 1:
if (!("subitems" in entry)) {
/* If you're not carrying subitems, you're not going in. */
list.splice(i, 1);
}
break;
case 2:
case 3:
/* Inclusive filtering. We're keeping this one. */
break;
}
}

if ("subitems" in entry) {
filterItems(entry["subitems"], tags, hwTagMatchingType)
filterItems(entry["subitems"], tags, hwTagMatchingType);

// If this sub-list has no items then hide it
if (entry["subitems"].length == 0) {
list.splice(i, 1)
list.splice(i, 1);
}
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Complex filtering logic preserved with formatting improvements

The device filtering implementation correctly handles multiple matching types, though the nested switch statements and multiple conditionals make this function quite complex.

There's a potential bug in the nested loops at lines 1650-1651. Both loops use generic names that could cause confusion:

  • Line 1650: for (var deviceTypePrefix in tags)
  • Line 1651: for (var deviceSpec in entry["devices"])

The outer loop should use for (var j in tags) to iterate over array indices, not object properties:

-                    for (var deviceTypePrefix in tags) {
-                        for (var deviceSpec in entry["devices"]) {
-                            if (deviceSpec.startsWith(deviceTypePrefix)) {
+                    for (var j in tags) {
+                        for (var k in entry["devices"]) {
+                            if (entry["devices"][k].startsWith(tags[j])) {

Consider breaking this function into smaller, more focused functions for each matching type to improve readability and maintainability.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function filterItems(list, tags, matchingType) {
if (!tags || !tags.length)
return
var i = list.length
return;
var i = list.length;
while (i--) {
var entry = list[i]
var entry = list[i];
if ("devices" in entry && entry["devices"].length) {
var foundTag = false
switch(matchingType) {
case 0: /* exact matching */
case 2: /* exact matching */
for (var j in tags)
{
if (entry["devices"].includes(tags[j]))
{
foundTag = true
break
}
}
/* If there's no match, remove this item from the list. */
if (!foundTag)
{
list.splice(i, 1)
continue
var foundTag = false;
switch (matchingType) {
case 0: /* exact matching */
case 2 /* exact matching */
:
for (var j in tags) {
if (entry["devices"].includes(tags[j])) {
foundTag = true;
break;
}
break
case 1: /* Exlusive by prefix matching */
case 3: /* Inclusive by prefix matching */
for (var deviceTypePrefix in tags) {
for (var deviceSpec in entry["devices"]) {
if (deviceSpec.startsWith(deviceTypePrefix)) {
foundTag = true
break
}
}
/* If there's no match, remove this item from the list. */
if (!foundTag) {
list.splice(i, 1);
continue;
}
break;
case 1: /* Exlusive by prefix matching */
case 3 /* Inclusive by prefix matching */
:
for (var deviceTypePrefix in tags) {
for (var deviceSpec in entry["devices"]) {
if (deviceSpec.startsWith(deviceTypePrefix)) {
foundTag = true;
break;
}
/* Terminate outer loop early if we've already
}
/* Terminate outer loop early if we've already
* decided it's a match
*/
if (foundTag) {
break
}
}
/* If there's no match, remove this item from the list. */
if (!foundTag)
{
list.splice(i, 1)
continue
if (foundTag) {
break;
}
break
}
/* If there's no match, remove this item from the list. */
if (!foundTag) {
list.splice(i, 1);
continue;
}
break;
}
} else {
/* No device list attached? If we're in an exclusive mode that's bad news indeed. */
switch (matchingType) {
case 0:
case 1:
if (!("subitems" in entry)) {
/* If you're not carrying subitems, you're not going in. */
list.splice(i, 1)
}
break
case 2:
case 3:
/* Inclusive filtering. We're keeping this one. */
break;
case 0:
case 1:
if (!("subitems" in entry)) {
/* If you're not carrying subitems, you're not going in. */
list.splice(i, 1);
}
break;
case 2:
case 3:
/* Inclusive filtering. We're keeping this one. */
break;
}
}
if ("subitems" in entry) {
filterItems(entry["subitems"], tags, hwTagMatchingType)
filterItems(entry["subitems"], tags, hwTagMatchingType);
// If this sub-list has no items then hide it
if (entry["subitems"].length == 0) {
list.splice(i, 1)
list.splice(i, 1);
}
}
}
}
function filterItems(list, tags, matchingType) {
if (!tags || !tags.length)
return;
var i = list.length;
while (i--) {
var entry = list[i];
if ("devices" in entry && entry["devices"].length) {
var foundTag = false;
switch (matchingType) {
case 0: /* exact matching */
case 2 /* exact matching */:
for (var j in tags) {
if (entry["devices"].includes(tags[j])) {
foundTag = true;
break;
}
}
/* If there's no match, remove this item from the list. */
if (!foundTag) {
list.splice(i, 1);
continue;
}
break;
case 1: /* Exclusive by prefix matching */
case 3: /* Inclusive by prefix matching */:
for (var j in tags) {
for (var k in entry["devices"]) {
if (entry["devices"][k].startsWith(tags[j])) {
foundTag = true;
break;
}
}
/* Terminate outer loop early if we've already
* decided it's a match
*/
if (foundTag) {
break;
}
}
/* If there's no match, remove this item from the list. */
if (!foundTag) {
list.splice(i, 1);
continue;
}
break;
}
} else {
/* No device list attached? If we're in an exclusive mode that's bad news indeed. */
switch (matchingType) {
case 0:
case 1:
if (!("subitems" in entry)) {
/* If you're not carrying subitems, you're not going in. */
list.splice(i, 1);
}
break;
case 2:
case 3:
/* Inclusive filtering. We're keeping this one. */
break;
}
}
if ("subitems" in entry) {
filterItems(entry["subitems"], tags, hwTagMatchingType);
// If this sub-list has no items then hide it
if (entry["subitems"].length == 0) {
list.splice(i, 1);
}
}
}
}
🤖 Prompt for AI Agents
In src/main.qml around lines 1621-1697, the nested loops at ~1650 use misleading
for-in variable names causing iteration over property names instead of clear
indexes/values; change the outer loop to iterate tags properly (e.g., for (var j
= 0; j < tags.length; j++) or for (var tag of tags)) and the inner loop to
iterate device specs properly (e.g., for (var k = 0; k <
entry["devices"].length; k++) or for (var deviceSpec of entry["devices"])), then
use the chosen loop variables when comparing (tag or tags[j] vs deviceSpec or
entry["devices"][k]); also rename variables to descriptive names (tag,
deviceSpec) to avoid confusion and keep existing break/continue logic intact.

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.

7 participants