i18n: wrap hardcoded Slint labels and plural concatenations
Wrap remaining user-facing literals in @tr across discover (RADIO, TOP TRACKS), DiscographyBuilder (release-type/order-by labels), the OfflineManager hero, ExpandableSearch placeholder default, and the appearance option arrays in state.slint (displayed as-is, no Rust re-seed). Replace string concatenation with positional @tr plus ngettext plurals for the DiscographyBuilder footer and OfflineManager track counts so word order is locale-stable. Language endonyms and the macOS/Adwaita/quality-tier brand names stay literal. cc
This commit is contained in:
7 files changed
+33
-34
No files matched your search
@@ -100,7 +100,7 @@ export component ForYouView inherits VerticalLayout {
|
|||||||
for st in ForYouState.radio-stations: RadioCard {
|
for st in ForYouState.radio-stations: RadioCard {
|
||||||
seed-title: st.title;
|
seed-title: st.title;
|
||||||
seed-subtitle: st.artist;
|
seed-subtitle: st.artist;
|
||||||
label: "RADIO";
|
label: @tr("RADIO");
|
||||||
artwork: st.artwork;
|
artwork: st.artwork;
|
||||||
clicked => {
|
clicked => {
|
||||||
root.start-radio-album(st.album-id);
|
root.start-radio-album(st.album-id);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { QbzIcon } from "../primitives/QbzIcon.slint";
|
|||||||
export component RadioCard inherits Rectangle {
|
export component RadioCard inherits Rectangle {
|
||||||
in property <string> seed-title;
|
in property <string> seed-title;
|
||||||
in property <string> seed-subtitle;
|
in property <string> seed-subtitle;
|
||||||
in property <string> label: "RADIO";
|
in property <string> label: @tr("RADIO");
|
||||||
in property <image> artwork;
|
in property <image> artwork;
|
||||||
callback clicked();
|
callback clicked();
|
||||||
callback play();
|
callback play();
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ export component Spotlight inherits VerticalLayout {
|
|||||||
if ForYouState.spotlight-has-top-tracks: RadioCard {
|
if ForYouState.spotlight-has-top-tracks: RadioCard {
|
||||||
seed-title: @tr("Top tracks");
|
seed-title: @tr("Top tracks");
|
||||||
seed-subtitle: @tr("By {}", ForYouState.spotlight-name);
|
seed-subtitle: @tr("By {}", ForYouState.spotlight-name);
|
||||||
label: "TOP TRACKS";
|
label: @tr("TOP TRACKS");
|
||||||
artwork: ForYouState.spotlight-image;
|
artwork: ForYouState.spotlight-image;
|
||||||
clicked => {
|
clicked => {
|
||||||
root.play-top-tracks(ForYouState.spotlight-artist-id);
|
root.play-top-tracks(ForYouState.spotlight-artist-id);
|
||||||
@@ -170,7 +170,7 @@ export component Spotlight inherits VerticalLayout {
|
|||||||
RadioCard {
|
RadioCard {
|
||||||
seed-title: ForYouState.spotlight-name;
|
seed-title: ForYouState.spotlight-name;
|
||||||
seed-subtitle: @tr("Qobuz Radio Station");
|
seed-subtitle: @tr("Qobuz Radio Station");
|
||||||
label: "RADIO";
|
label: @tr("RADIO");
|
||||||
artwork: ForYouState.spotlight-image;
|
artwork: ForYouState.spotlight-image;
|
||||||
clicked => {
|
clicked => {
|
||||||
root.start-radio(ForYouState.spotlight-artist-id);
|
root.start-radio(ForYouState.spotlight-artist-id);
|
||||||
|
|||||||
@@ -140,11 +140,11 @@ component TypeOverride inherits Rectangle {
|
|||||||
padding: 4px;
|
padding: 4px;
|
||||||
// Album, EP, Single, Live, Compilation (spec order).
|
// Album, EP, Single, Live, Compilation (spec order).
|
||||||
for choice in [
|
for choice in [
|
||||||
{ id: "album", lbl: "Album" },
|
{ id: "album", lbl: @tr("Album") },
|
||||||
{ id: "ep", lbl: "EP" },
|
{ id: "ep", lbl: @tr("EP") },
|
||||||
{ id: "single", lbl: "Single" },
|
{ id: "single", lbl: @tr("Single") },
|
||||||
{ id: "live", lbl: "Live" },
|
{ id: "live", lbl: @tr("Live") },
|
||||||
{ id: "compilation", lbl: "Compilation" },
|
{ id: "compilation", lbl: @tr("Compilation") },
|
||||||
]: Rectangle {
|
]: Rectangle {
|
||||||
height: 28px;
|
height: 28px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@@ -549,9 +549,9 @@ export component DiscographyBuilderView inherits Rectangle {
|
|||||||
seg := HorizontalLayout {
|
seg := HorizontalLayout {
|
||||||
spacing: 0px;
|
spacing: 0px;
|
||||||
for s[i] in [
|
for s[i] in [
|
||||||
{ id: "release_date", lbl: "Release date" },
|
{ id: "release_date", lbl: @tr("Release date") },
|
||||||
{ id: "title", lbl: "Title" },
|
{ id: "title", lbl: @tr("Title") },
|
||||||
{ id: "manual", lbl: "Manual" },
|
{ id: "manual", lbl: @tr("Manual") },
|
||||||
]: seg-rect := Rectangle {
|
]: seg-rect := Rectangle {
|
||||||
property <bool> active: DiscoBuilderState.order-by == s.id;
|
property <bool> active: DiscoBuilderState.order-by == s.id;
|
||||||
// Non-accent active (the app's ToggleButton idiom): a surface
|
// Non-accent active (the app's ToggleButton idiom): a surface
|
||||||
@@ -744,8 +744,7 @@ export component DiscographyBuilderView inherits Rectangle {
|
|||||||
alignment: center;
|
alignment: center;
|
||||||
horizontal-stretch: 1;
|
horizontal-stretch: 1;
|
||||||
Text {
|
Text {
|
||||||
text: DiscoBuilderState.selected-count + " of "
|
text: @tr("{} of {} album selected" | "{} of {} albums selected" % DiscoBuilderState.group-count, DiscoBuilderState.selected-count, DiscoBuilderState.group-count);
|
||||||
+ DiscoBuilderState.group-count + " albums selected";
|
|
||||||
color: Theme.text-secondary;
|
color: Theme.text-secondary;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ export component OfflineManagerView inherits Rectangle {
|
|||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: center;
|
alignment: center;
|
||||||
Text {
|
Text {
|
||||||
text: "Offline Cache";
|
text: @tr("Offline Cache");
|
||||||
color: Theme.text-primary;
|
color: Theme.text-primary;
|
||||||
// Hero homologated to the canonical 18px (section).
|
// Hero homologated to the canonical 18px (section).
|
||||||
font-size: Typography.section;
|
font-size: Typography.section;
|
||||||
@@ -191,7 +191,7 @@ export component OfflineManagerView inherits Rectangle {
|
|||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: center;
|
alignment: center;
|
||||||
Text {
|
Text {
|
||||||
text: OfflineManagerState.tracks-count + " tracks";
|
text: @tr("{} track" | "{} tracks" % OfflineManagerState.tracks-count, OfflineManagerState.tracks-count);
|
||||||
color: Theme.text-primary;
|
color: Theme.text-primary;
|
||||||
font-size: Typography.body;
|
font-size: Typography.body;
|
||||||
font-weight: Typography.semibold;
|
font-weight: Typography.semibold;
|
||||||
@@ -381,7 +381,7 @@ export component OfflineManagerView inherits Rectangle {
|
|||||||
spacing: 2px;
|
spacing: 2px;
|
||||||
ArtistRailRow {
|
ArtistRailRow {
|
||||||
name: @tr("All artists");
|
name: @tr("All artists");
|
||||||
meta: OfflineManagerState.tracks-count + " tracks";
|
meta: @tr("{} track" | "{} tracks" % OfflineManagerState.tracks-count, OfflineManagerState.tracks-count);
|
||||||
active: OfflineManagerState.selected-artist == "";
|
active: OfflineManagerState.selected-artist == "";
|
||||||
clicked => {
|
clicked => {
|
||||||
OfflineManagerActions.select-artist("");
|
OfflineManagerActions.select-artist("");
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { Typography } from "../foundation/typography.slint";
|
|||||||
import { QbzIcon } from "QbzIcon.slint";
|
import { QbzIcon } from "QbzIcon.slint";
|
||||||
|
|
||||||
export component ExpandableSearch inherits Rectangle {
|
export component ExpandableSearch inherits Rectangle {
|
||||||
in property <string> placeholder: "Search…";
|
in property <string> placeholder: @tr("Search…");
|
||||||
// Trimmed 20px so the open field doesn't ride over the controls to its
|
// Trimmed 20px so the open field doesn't ride over the controls to its
|
||||||
// left on small screens.
|
// left on small screens.
|
||||||
in property <length> max-open-width: 196px;
|
in property <length> max-open-width: 196px;
|
||||||
|
|||||||
@@ -2676,14 +2676,14 @@ export global AppearanceState {
|
|||||||
// Auto-Theme (shown when the "System" theme is selected). Source:
|
// Auto-Theme (shown when the "System" theme is selected). Source:
|
||||||
// 0 = System Colors, 1 = Wallpaper Sync, 2 = Custom Image.
|
// 0 = System Colors, 1 = Wallpaper Sync, 2 = Custom Image.
|
||||||
in-out property <bool> theme-is-system: false;
|
in-out property <bool> theme-is-system: false;
|
||||||
in-out property <[string]> auto-theme-sources: ["System Colors", "Wallpaper Sync", "Custom Image"];
|
in-out property <[string]> auto-theme-sources: [@tr("System Colors"), @tr("Wallpaper Sync"), @tr("Custom Image")];
|
||||||
in-out property <int> auto-theme-source-index: 0;
|
in-out property <int> auto-theme-source-index: 0;
|
||||||
in-out property <string> auto-theme-custom-path: "";
|
in-out property <string> auto-theme-custom-path: "";
|
||||||
in-out property <bool> auto-theme-generating: false;
|
in-out property <bool> auto-theme-generating: false;
|
||||||
in-out property <string> auto-theme-detected-de: "";
|
in-out property <string> auto-theme-detected-de: "";
|
||||||
|
|
||||||
// --- TYPOGRAPHY / SCALE / LANGUAGE -------------------------------------
|
// --- TYPOGRAPHY / SCALE / LANGUAGE -------------------------------------
|
||||||
in-out property <[string]> languages: ["Auto", "English", "Español", "Français", "Deutsch", "Português"];
|
in-out property <[string]> languages: [@tr("Auto"), "English", "Español", "Français", "Deutsch", "Português"];
|
||||||
in-out property <int> language-index: 0;
|
in-out property <int> language-index: 0;
|
||||||
in-out property <[string]> fonts: ["LINE Seed JP", "Montserrat", "Noto Sans", "Source Sans 3", "System"];
|
in-out property <[string]> fonts: ["LINE Seed JP", "Montserrat", "Noto Sans", "Source Sans 3", "System"];
|
||||||
in-out property <int> font-index: 0;
|
in-out property <int> font-index: 0;
|
||||||
@@ -2693,7 +2693,7 @@ export global AppearanceState {
|
|||||||
// Immersive search action — what selecting a result in the Immersive search
|
// Immersive search action — what selecting a result in the Immersive search
|
||||||
// cortinilla does (index: 0=Disabled, 1=Replace queue, 2=Play next,
|
// cortinilla does (index: 0=Disabled, 1=Replace queue, 2=Play next,
|
||||||
// 3=Add to queue). Persisted via appearance-select("immersive-search-action").
|
// 3=Add to queue). Persisted via appearance-select("immersive-search-action").
|
||||||
in-out property <[string]> immersive-search-actions: ["Disabled", "Replace current queue", "Play next", "Add to queue"];
|
in-out property <[string]> immersive-search-actions: [@tr("Disabled"), @tr("Replace current queue"), @tr("Play next"), @tr("Add to queue")];
|
||||||
in-out property <int> immersive-search-action-index: 1;
|
in-out property <int> immersive-search-action-index: 1;
|
||||||
|
|
||||||
// Immersive default view — which immersive view opens by default.
|
// Immersive default view — which immersive view opens by default.
|
||||||
@@ -2701,7 +2701,7 @@ export global AppearanceState {
|
|||||||
// 1 = Album Reactive, 2 = Static, 3 = Coverflow, 4 = Spectrum,
|
// 1 = Album Reactive, 2 = Static, 3 = Coverflow, 4 = Spectrum,
|
||||||
// 5 = Lyrics, 6 = Queue (all 1-6 pin a FOCUS view-mode foreground).
|
// 5 = Lyrics, 6 = Queue (all 1-6 pin a FOCUS view-mode foreground).
|
||||||
// Persisted via appearance-select("immersive-default-view").
|
// Persisted via appearance-select("immersive-default-view").
|
||||||
in-out property <[string]> immersive-default-views: ["Remember last", "Album Reactive", "Static", "Coverflow", "Spectrum", "Lyrics", "Queue"];
|
in-out property <[string]> immersive-default-views: [@tr("Remember last"), @tr("Album Reactive"), @tr("Static"), @tr("Coverflow"), @tr("Spectrum"), @tr("Lyrics"), @tr("Queue")];
|
||||||
in-out property <int> immersive-default-view-index: 0;
|
in-out property <int> immersive-default-view-index: 0;
|
||||||
|
|
||||||
// --- VISUAL EXTRAS -----------------------------------------------------
|
// --- VISUAL EXTRAS -----------------------------------------------------
|
||||||
@@ -2739,26 +2739,26 @@ export global AppearanceState {
|
|||||||
in-out property <bool> nav-tb-myqbz: false;
|
in-out property <bool> nav-tb-myqbz: false;
|
||||||
in-out property <bool> nav-tb-purchases: false;
|
in-out property <bool> nav-tb-purchases: false;
|
||||||
// Nav buttons position: 0 = Auto, 1 = Left, 2 = Right.
|
// Nav buttons position: 0 = Auto, 1 = Left, 2 = Right.
|
||||||
in-out property <[string]> nav-tb-positions: ["Auto (opposite to window controls)", "Left", "Right"];
|
in-out property <[string]> nav-tb-positions: [@tr("Auto (opposite to window controls)"), @tr("Left"), @tr("Right")];
|
||||||
in-out property <int> nav-tb-position-index: 0;
|
in-out property <int> nav-tb-position-index: 0;
|
||||||
|
|
||||||
// Window controls group.
|
// Window controls group.
|
||||||
in-out property <[string]> wc-positions: ["Left", "Right"];
|
in-out property <[string]> wc-positions: [@tr("Left"), @tr("Right")];
|
||||||
in-out property <int> wc-position-index: 1;
|
in-out property <int> wc-position-index: 1;
|
||||||
in-out property <[string]> wc-styles: ["Rectangular", "Full-height rounded", "Circular", "Square"];
|
in-out property <[string]> wc-styles: [@tr("Rectangular"), @tr("Full-height rounded"), @tr("Circular"), @tr("Square")];
|
||||||
in-out property <int> wc-style-index: 0;
|
in-out property <int> wc-style-index: 0;
|
||||||
in-out property <[string]> wc-sizes: ["Small", "Normal", "Large"];
|
in-out property <[string]> wc-sizes: [@tr("Small"), @tr("Normal"), @tr("Large")];
|
||||||
in-out property <int> wc-size-index: 1;
|
in-out property <int> wc-size-index: 1;
|
||||||
in-out property <[string]> wc-color-presets: ["Default", "macOS", "Adwaita", "Monochrome", "Custom"];
|
in-out property <[string]> wc-color-presets: [@tr("Default"), "macOS", "Adwaita", @tr("Monochrome"), @tr("Custom")];
|
||||||
in-out property <int> wc-color-preset-index: 0;
|
in-out property <int> wc-color-preset-index: 0;
|
||||||
in-out property <bool> show-window-controls: true;
|
in-out property <bool> show-window-controls: true;
|
||||||
|
|
||||||
// --- MINIPLAYER --------------------------------------------------------
|
// --- MINIPLAYER --------------------------------------------------------
|
||||||
in-out property <[string]> miniplayer-views: ["Remember last used", "Micro", "Compact", "Artwork", "Queue", "Lyrics"];
|
in-out property <[string]> miniplayer-views: [@tr("Remember last used"), @tr("Micro"), @tr("Compact"), @tr("Artwork"), @tr("Queue"), @tr("Lyrics")];
|
||||||
in-out property <int> miniplayer-view-index: 0;
|
in-out property <int> miniplayer-view-index: 0;
|
||||||
|
|
||||||
// --- STARTUP -----------------------------------------------------------
|
// --- STARTUP -----------------------------------------------------------
|
||||||
in-out property <[string]> startup-pages: ["Home", "Where you left off"];
|
in-out property <[string]> startup-pages: [@tr("Home"), @tr("Where you left off")];
|
||||||
in-out property <int> startup-page-index: 0;
|
in-out property <int> startup-page-index: 0;
|
||||||
|
|
||||||
in-out property <bool> show-purchases: false;
|
in-out property <bool> show-purchases: false;
|
||||||
@@ -2773,17 +2773,17 @@ export global AppearanceState {
|
|||||||
// macOS-only: hide the Dock icon when closed to the menu bar (.accessory
|
// macOS-only: hide the Dock icon when closed to the menu bar (.accessory
|
||||||
// activation policy). Off = Spotify-style (keep the Dock icon).
|
// activation policy). Off = Spotify-style (keep the Dock icon).
|
||||||
in-out property <bool> tray-mac-hide-dock: false;
|
in-out property <bool> tray-mac-hide-dock: false;
|
||||||
in-out property <[string]> tray-icon-themes: ["Auto", "Mono light", "Mono dark", "Color"];
|
in-out property <[string]> tray-icon-themes: [@tr("Auto"), @tr("Mono light"), @tr("Mono dark"), @tr("Color")];
|
||||||
in-out property <int> tray-icon-theme-index: 0;
|
in-out property <int> tray-icon-theme-index: 0;
|
||||||
|
|
||||||
// --- IMMERSIVE ---------------------------------------------------------
|
// --- IMMERSIVE ---------------------------------------------------------
|
||||||
in-out property <[string]> immersive-views: [
|
in-out property <[string]> immersive-views: [
|
||||||
"Remember last used", "Coverflow", "Static", "Vinyl", "Visualizer",
|
@tr("Remember last used"), @tr("Coverflow"), @tr("Static"), @tr("Vinyl"), @tr("Visualizer"),
|
||||||
"Neon Flow", "Tunnel", "Comet", "Lyrics", "Queue",
|
@tr("Neon Flow"), @tr("Tunnel"), @tr("Comet"), @tr("Lyrics"), @tr("Queue"),
|
||||||
"Split: Lyrics", "Split: Track Info", "Split: Suggestions", "Split: Queue"
|
@tr("Split: Lyrics"), @tr("Split: Track Info"), @tr("Split: Suggestions"), @tr("Split: Queue")
|
||||||
];
|
];
|
||||||
in-out property <int> immersive-view-index: 0;
|
in-out property <int> immersive-view-index: 0;
|
||||||
in-out property <[string]> immersive-background-modes: ["Full", "Lite", "Off"];
|
in-out property <[string]> immersive-background-modes: [@tr("Full"), @tr("Lite"), @tr("Off")];
|
||||||
in-out property <int> immersive-background-mode-index: 0;
|
in-out property <int> immersive-background-mode-index: 0;
|
||||||
// Collapsible sub-panels (collapsed by default, matching Tauri).
|
// Collapsible sub-panels (collapsed by default, matching Tauri).
|
||||||
in-out property <bool> immersive-panels-collapsed: true;
|
in-out property <bool> immersive-panels-collapsed: true;
|
||||||
|
|||||||
Reference in new issue
Block a user