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
e4e9163d
Commit
e4e9163d
authored
Aug 18, 2020
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix missing translatable strings
closes #19
parent
31d2b3f3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
7 deletions
+14
-7
resources.gresource.xml
data/resources.gresource.xml
+0
-1
meson.build
po/meson.build
+7
-1
utils.rs
src/utils.rs
+1
-1
welcome.rs
src/widgets/pages/welcome.rs
+3
-2
window.rs
src/widgets/window.rs
+3
-2
No files found.
data/resources.gresource.xml
View file @
e4e9163d
...
...
@@ -2,7 +2,6 @@
<gresources>
<gresource
prefix=
"/org/gnome/Tour/"
>
<file
compressed=
"true"
alias=
"style.css"
>
resources/style.css
</file>
<file
alias=
"welcome.mp4"
>
resources/assets/welcome.mp4
</file>
<file
compressed=
"true"
alias=
"activities.svg"
>
resources/assets/activities.svg
</file>
<file
compressed=
"true"
alias=
"calendar.svg"
>
resources/assets/calendar.svg
</file>
<file
compressed=
"true"
alias=
"search.svg"
>
resources/assets/search.svg
</file>
...
...
po/meson.build
View file @
e4e9163d
i18n.gettext(gettext_package, preset: 'glib')
i18n.gettext(
gettext_package,
args: [
'--keyword=i18n_f'
],
preset: 'glib'
)
src/utils.rs
View file @
e4e9163d
...
...
@@ -17,7 +17,7 @@ where
pub
fn
i18n_f
(
format
:
&
str
,
args
:
&
[
&
str
])
->
String
{
let
s
=
gettext
(
format
);
let
mut
parts
=
s
.split
(
"{}"
);
let
mut
output
=
parts
.next
()
.unwrap_or
(
""
)
.to_string
();
let
mut
output
=
parts
.next
()
.unwrap_or
_default
(
)
.to_string
();
for
(
p
,
a
)
in
parts
.zip
(
args
.iter
())
{
output
+=
&
(
a
.to_string
()
+
&
p
.to_string
());
}
...
...
src/widgets/pages/welcome.rs
View file @
e4e9163d
#
[
cfg
(
feature
=
"video"
)]
use
crate
::
config
;
use
crate
::
utils
::
i18n_f
;
use
gettextrs
::
gettext
;
#[cfg(feature
=
"video"
)]
use
gio
::
FileExt
;
...
...
@@ -140,8 +141,8 @@ impl WelcomePageWidget {
let
name
=
glib
::
get_os_info
(
"NAME"
)
.unwrap_or_else
(||
"GNOME"
.into
());
let
version
=
glib
::
get_os_info
(
"VERSION"
)
.unwrap_or_else
(||
"3.36"
.into
());
let
title
=
gtk
::
Label
::
new
(
Some
(
&
gettext
(
format!
(
"Welcome to {} {}"
,
name
,
version
)
)));
// Translators: The following string is formated as "Welcome to GNOME 3.36" for example
let
title
=
gtk
::
Label
::
new
(
Some
(
&
i18n_f
(
"Welcome to {} {}"
,
&
[
&
name
,
&
version
]
)));
title
.set_margin_top
(
36
);
title
.get_style_context
()
.add_class
(
"large-title"
);
title
.show
();
...
...
src/widgets/window.rs
View file @
e4e9163d
use
crate
::
utils
;
use
crate
::
utils
::
i18n_f
;
use
gettextrs
::
gettext
;
use
gtk
::
prelude
::
*
;
use
std
::
cell
::
RefCell
;
...
...
@@ -97,7 +97,8 @@ impl Window {
let
name
=
glib
::
get_os_info
(
"NAME"
)
.unwrap_or_else
(||
"GNOME"
.into
());
let
last_page
=
ImagePageWidget
::
new
(
"/org/gnome/Tour/ready-to-go.svg"
,
utils
::
i18n_f
(
"That's it! We hope that you enjoy {}."
,
&
[
&
name
]),
// Translators: The following string is formated as "We hope that you enjoy GNOME"
i18n_f
(
"That's it! We hope that you enjoy {}."
,
&
[
&
name
]),
gettext
(
"To get more advice and tips, see the Help app."
),
);
last_page
.widget
.get_style_context
()
.add_class
(
"last-page"
);
...
...
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