Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-welcome
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-welcome
Commits
4010c866
Commit
4010c866
authored
Feb 11, 2023
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix clippy warnings
parent
54b81b9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
main.rs
src/main.rs
+2
-2
utils.rs
src/utils.rs
+1
-1
No files found.
src/main.rs
View file @
4010c866
...
@@ -14,9 +14,9 @@ fn main() {
...
@@ -14,9 +14,9 @@ fn main() {
// Prepare i18n
// Prepare i18n
setlocale
(
LocaleCategory
::
LcAll
,
""
);
setlocale
(
LocaleCategory
::
LcAll
,
""
);
bindtextdomain
(
GETTEXT_PACKAGE
,
LOCALEDIR
)
bindtextdomain
(
GETTEXT_PACKAGE
,
LOCALEDIR
)
.unwrap_or_else
(|
_
|
panic!
(
"Unable to bind text domain for {
}"
,
GETTEXT_PACKAGE
));
.unwrap_or_else
(|
_
|
panic!
(
"Unable to bind text domain for {
GETTEXT_PACKAGE}"
));
textdomain
(
GETTEXT_PACKAGE
)
textdomain
(
GETTEXT_PACKAGE
)
.unwrap_or_else
(|
_
|
panic!
(
"Unable to switch to text domain {
}"
,
GETTEXT_PACKAGE
));
.unwrap_or_else
(|
_
|
panic!
(
"Unable to switch to text domain {
GETTEXT_PACKAGE}"
));
glib
::
set_application_name
(
&
gettext
(
"Tour"
));
glib
::
set_application_name
(
&
gettext
(
"Tour"
));
glib
::
set_prgname
(
Some
(
"Tour"
));
glib
::
set_prgname
(
Some
(
"Tour"
));
...
...
src/utils.rs
View file @
4010c866
...
@@ -5,7 +5,7 @@ use regex::{Captures, Regex};
...
@@ -5,7 +5,7 @@ use regex::{Captures, Regex};
pub
fn
i18n_f
(
format
:
&
str
,
kwargs
:
&
[(
&
str
,
&
str
)])
->
String
{
pub
fn
i18n_f
(
format
:
&
str
,
kwargs
:
&
[(
&
str
,
&
str
)])
->
String
{
let
mut
s
=
gettext
(
format
);
let
mut
s
=
gettext
(
format
);
for
(
k
,
v
)
in
kwargs
{
for
(
k
,
v
)
in
kwargs
{
if
let
Ok
(
re
)
=
Regex
::
new
(
&
format!
(
"
\\
{{{
}
\\
}}"
,
k
))
{
if
let
Ok
(
re
)
=
Regex
::
new
(
&
format!
(
"
\\
{{{
k}
\\
}}"
))
{
s
=
re
s
=
re
.replace_all
(
&
s
,
|
_
:
&
Captures
<
'_
>
|
v
.to_string
())
.replace_all
(
&
s
,
|
_
:
&
Captures
<
'_
>
|
v
.to_string
())
.to_string
();
.to_string
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment