Skip to content

Commit 358e265

Browse files
committed
Make some picker strings translatable
1 parent c08adc4 commit 358e265

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

i18n/en/system76_keyboard_configurator.ftl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,10 @@ test-replace-switch = Replace switch
8585
test-spurious-keypress = Spurious keypress
8686
8787
untitled-layout = Untitled Layout
88+
89+
picker-basics = Basics
90+
picker-extras = Extras
91+
picker-tap-hold = Tap-Hold
92+
tap-hold-step1 = 1. Select action(s) to use when the key is held.
93+
tap-hold-multiple-mod = Shift + click to select multiple modifiers.
94+
tap-hold-step2 = 2. Select an action to use when the key is tapped.

src/picker/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::{
1212
collections::HashMap,
1313
};
1414

15-
use crate::Keyboard;
15+
use crate::{fl, Keyboard};
1616
use backend::{is_qmk_basic, DerefCell, Keycode, Mods};
1717

1818
mod group_box;
@@ -83,9 +83,9 @@ impl ObjectImpl for PickerInner {
8383
// XXX translate
8484
let stack = cascade! {
8585
gtk::Stack::new();
86-
..add_titled(&basics_group_box, "basics", "Basics");
87-
..add_titled(&extras_group_box, "extras", "Extras");
88-
..add_titled(&tap_hold, "tap-hold", "Tap-Hold");
86+
..add_titled(&basics_group_box, "basics", &fl!("picker-basics"));
87+
..add_titled(&extras_group_box, "extras", &fl!("picker-extras"));
88+
..add_titled(&tap_hold, "tap-hold", &fl!("picker-tap-hold"));
8989
};
9090

9191
let stack_switcher = cascade! {

src/picker/tap_hold.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use once_cell::sync::Lazy;
99
use std::cell::{Cell, RefCell};
1010

1111
use super::{group_box::PickerBasicGroup, PickerGroupBox};
12+
use crate::fl;
1213
use backend::{is_qmk_basic, DerefCell, Keycode, Mods};
1314

1415
#[derive(Clone, Copy, PartialEq)]
@@ -115,7 +116,7 @@ impl ObjectImpl for TapHoldInner {
115116
..set_spacing(8);
116117
..set_orientation(gtk::Orientation::Vertical);
117118
..add(&cascade! {
118-
gtk::Label::new(Some("1. Select action(s) to use when the key is held."));
119+
gtk::Label::new(Some(&fl!("tap-hold-step1")));
119120
..set_attributes(Some(&cascade! {
120121
pango::AttrList::new();
121122
..insert(pango::AttrInt::new_weight(pango::Weight::Bold));
@@ -124,12 +125,12 @@ impl ObjectImpl for TapHoldInner {
124125
});
125126
..add(&hold_group_box);
126127
..add(&cascade! {
127-
gtk::Label::new(Some("Shift + click to select multiple modifiers."));
128+
gtk::Label::new(Some(&fl!("tap-hold-multiple-mod")));
128129
..set_halign(gtk::Align::Start);
129130
});
130131
// XXX grey?
131132
..add(&cascade! {
132-
gtk::Label::new(Some("2. Select an action to use when the key is tapped."));
133+
gtk::Label::new(Some(&fl!("tap-hold-step2")));
133134
..set_attributes(Some(&cascade! {
134135
pango::AttrList::new();
135136
..insert(pango::AttrInt::new_weight(pango::Weight::Bold));

0 commit comments

Comments
 (0)