Repository navigation
Conversation
Language::update() previously formatted format-<lang> and tooltip-format-<lang>
exclusively as positional argument 0 of format_ / tooltip_format. When format
was set to a named placeholder fallback such as "{short}" or "Lang: {long}"
(as in the first man-page example), or when tooltip-format used its default
"{long}", the per-language override was silently discarded.
Extract formatLanguage() into language_format.hpp:
- Format per-language overrides with the layout's named placeholders (keeping
literal strings with non-placeholder braces intact).
- Substitute into baseFormat when it contains an unescaped "{}" / "{0}"
positional placeholder, and otherwise return the formatted override directly.
- Add Catch2 unit tests (test/hyprland/language.cpp) and extend the Hyprland
IPC smoke test (test/smoke/ipc.sh).
serhatvs
force-pushed
the
fix/hyprland-language-format
branch
from
November 24, 2026 22:16
d22691b to
4caeecf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Ensure
format-<lang>,format-<lang>-<variant>,tooltip-format-<lang>, andtooltip-format-<lang>-<variant>take effect inhyprland/languageeven whenformat/tooltip-formatdoes not use{}.Previously,
Language::update()always passedconfig_[propName].asString()as positional argument0tofmt::format(fmt::runtime(format_), ...). That only worked whenformatcontained{}; setting a named fallback like"format": "{short}"(or"format": "Lang: {long}"from the first example inwaybar-hyprland-language(5), or relying ontooltip-format's default"{long}") caused the per-language override to be silently ignored."{Español}").format/tooltip-formatcontains an unescaped{}or{0...}, and otherwise return the formatted override directly.Tests
test/hyprland/language.cppcovering#5295, man-page examples, wrapper formats, escaped braces, variant precedence, and tooltip overrides.test/smoke/ipc.shwithhyprland/language#overrideverifying fallback +format-deoverride transitions over AT-SPI.Related issues
Closes #5295
Checklist
clang-formatninja -C build)man/)