File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " freedesktop-desktop-entry"
3
- version = " 0.3.2 "
3
+ version = " 0.3.3 "
4
4
authors = [
" Michael Aaron Murphy <[email protected] >" ]
5
5
edition = " 2018"
6
6
homepage = " https://codeberg.org/mmstick/freedesktop-desktop-entry"
Original file line number Diff line number Diff line change @@ -180,7 +180,16 @@ impl<'a> DesktopEntry<'a> {
180
180
) -> Option < & ' a str > {
181
181
group. and_then ( |group| group. get ( key) ) . and_then ( |key| {
182
182
locale
183
- . and_then ( |locale| key. 1 . get ( locale) . cloned ( ) )
183
+ . and_then ( |locale| match key. 1 . get ( locale) {
184
+ Some ( value) => Some ( * value) ,
185
+ None => {
186
+ if let Some ( pos) = locale. find ( '_' ) {
187
+ key. 1 . get ( & locale[ ..pos] ) . cloned ( )
188
+ } else {
189
+ None
190
+ }
191
+ }
192
+ } )
184
193
. or ( Some ( key. 0 ) )
185
194
} )
186
195
}
You can’t perform that action at this time.
0 commit comments