diff --git a/rust/agama-locale-data/src/locale.rs b/rust/agama-locale-data/src/locale.rs index 90551ce233..4c4f53d8b1 100644 --- a/rust/agama-locale-data/src/locale.rs +++ b/rust/agama-locale-data/src/locale.rs @@ -100,7 +100,7 @@ impl FromStr for KeymapId { fn from_str(s: &str) -> Result { let re = KEYMAP_ID_REGEX - .get_or_init(|| Regex::new(r"(\w+)((\((?\w+)\)|-(?\w+)))?").unwrap()); + .get_or_init(|| Regex::new(r"([\w.]+)((\((?.+)\)|-(?.+)))?").unwrap()); if let Some(parts) = re.captures(s) { let mut variant = None; @@ -153,5 +153,23 @@ mod test { }, keymap_id2 ); + + let keymap_id3 = KeymapId::from_str("pt-nativo-us").unwrap(); + assert_eq!( + KeymapId { + layout: "pt".to_string(), + variant: Some("nativo-us".to_string()) + }, + keymap_id3 + ); + + let keymap_id4 = KeymapId::from_str("lt.std").unwrap(); + assert_eq!( + KeymapId { + layout: "lt.std".to_string(), + variant: None + }, + keymap_id4 + ); } } diff --git a/rust/package/agama-cli.changes b/rust/package/agama-cli.changes index fb57f4b78f..83df6d4a91 100644 --- a/rust/package/agama-cli.changes +++ b/rust/package/agama-cli.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 8 17:02:40 UTC 2024 - José Iván López González + +- Fix the list of keymaps to avoid duplicated values + (gh#openSUSE/agama#981). + ------------------------------------------------------------------- Thu Dec 21 14:23:33 UTC 2023 - Imobach Gonzalez Sosa