Skip to content

feat(queue): add empty_message + empty_filter_message override#47

Open
foXaCe wants to merge 1 commit into
Helaas:mainfrom
foXaCe:feature/queue-empty-message-override
Open

feat(queue): add empty_message + empty_filter_message override#47
foXaCe wants to merge 1 commit into
Helaas:mainfrom
foXaCe:feature/queue-empty-message-override

Conversation

@foXaCe

@foXaCe foXaCe commented May 23, 2026

Copy link
Copy Markdown

Summary

Adds two optional fields on ap_queue_opts so callers can override the built-in NO ITEMS IN QUEUE. / NO ITEMS MATCH THIS FILTER. placeholders without forking the widget.

typedef struct {
    // ...
    const char *empty_message;        // overrides "NO ITEMS IN QUEUE."
    const char *empty_filter_message; // overrides "NO ITEMS MATCH THIS FILTER."
} ap_queue_opts;

When the override is NULL or empty, the existing English strings are used — fully backwards compatible.

Why

I'm wiring NextUI's i18n layer into ScrapeGoat (companion PR: https://github.com/Helaas/nextui-scrapegoat-pak) and the queue's empty-state placeholders were the only Apostrophe-rendered strings I couldn't override from the calling pak. Without this change downstream apps either show an English string in an otherwise localised UI, or have to ship a forked copy of apostrophe_widgets.h just to swap two literals.

Diff

const char *msg;
if (stat_total == 0)
    msg = (opts->empty_message && opts->empty_message[0])
          ? opts->empty_message : "NO ITEMS IN QUEUE.";
else
    msg = (opts->empty_filter_message && opts->empty_filter_message[0])
          ? opts->empty_filter_message : "NO ITEMS MATCH THIS FILTER.";

Same shape as the existing filter_labels[4] override added earlier.

Test plan

  • Existing callers (with both fields unset) render the original English placeholders.
  • When overrides are set, the localised strings show up in both the all-empty and filter-empty cases.
  • Built and ran on a TrimUI Brick (tg5040) via ScrapeGoat with language=fr in minuisettings.txt.

Lets callers override the built-in NO ITEMS IN QUEUE. / NO ITEMS
MATCH THIS FILTER. strings so downstream apps (eg. ScrapeGoat with
NextUI i18n) can localise the empty-state placeholders without
forking the widget.
foXaCe added a commit to foXaCe/NextUI that referenced this pull request May 23, 2026
Adds ~150 sg.* keys consumed by the companion PR on
Helaas/nextui-scrapegoat-pak. Covers main menu, library list, ROM
detail, queue/progress screens, settings, dialogs, warnings.

The parser now decodes \\n / \\t / \\\\ escapes so multi-line dialog
strings (cancel-all confirmation, background-scraping warning, ...)
can sit on a single .lang line. Existing single-line keys are
unaffected.

Also localises btn.up_down / btn.left_right (was hardcoded U/D and
L/R literals in gametime/bootlogo/battery/ledcontrol) so the button
hints render as H/B and G/D in French. New gametime.title_fmt key
for the Game Tracker top title.

Companion PRs:
- Helaas/nextui-scrapegoat-pak#9
- Helaas/Apostrophe#47 (queue widget i18n hook)
@Helaas Helaas requested a review from Copilot May 23, 2026 09:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds optional overrides to the queue viewer so downstream apps can localize the empty-state placeholder strings without forking the widget, while keeping default behavior when overrides are unset.

Changes:

  • Extend ap_queue_opts with empty_message and empty_filter_message optional fields.
  • Update ap_queue_viewer empty-state rendering to prefer these overrides when non-NULL and non-empty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +429 to +430
const char *empty_message; /* Optional override for "NO ITEMS IN QUEUE." */
const char *empty_filter_message; /* Optional override for "NO ITEMS MATCH THIS FILTER." */
@Helaas

Helaas commented May 23, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR. i18n and the other PRs are currently being discussed on the Discord.
It'll be all or nothing I guess.

@foXaCe

foXaCe commented May 23, 2026

Copy link
Copy Markdown
Author

I did the OS and the store too

LoveRetro/nextui-pak-store#136
LoveRetro/NextUI#735

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.

3 participants