Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
6aceba9d
Commit
6aceba9d
authored
Jun 13, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsUi): ask restart to user when language is updated
parent
2cd19ab5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
30 deletions
+45
-30
en.ts
linphone-desktop/assets/languages/en.ts
+4
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+4
-0
SettingsUi.js
linphone-desktop/ui/views/App/Settings/SettingsUi.js
+32
-0
SettingsUi.qml
linphone-desktop/ui/views/App/Settings/SettingsUi.qml
+5
-30
No files found.
linphone-desktop/assets/languages/en.ts
View file @
6aceba9d
...
...
@@ -1277,6 +1277,10 @@ your friend's SIP address or username.</translation>
<
source
>
downloadLabel
<
/source
>
<
translation
>
Download
folder
<
/translation
>
<
/message
>
<
message
>
<
source
>
setLocaleDescription
<
/source
>
<
translation
>
It
is
necessary
to
restart
the
application
.
Do
you
want
to
restart
now
?
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsVideo
<
/name
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
6aceba9d
...
...
@@ -1275,6 +1275,10 @@ Url du serveur non configurée.</translation>
<
source
>
downloadLabel
<
/source
>
<
translation
>
Dossier
des
t
é
l
é
chargements
<
/translation
>
<
/message
>
<
message
>
<
source
>
setLocaleDescription
<
/source
>
<
translation
>
Voulez
-
vous
red
é
marrer
maintenant
pour
prendre
en
compte
ces
modifications
?
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsVideo
<
/name
>
...
...
linphone-desktop/ui/views/App/Settings/SettingsUi.js
View file @
6aceba9d
...
...
@@ -17,3 +17,35 @@ function cleanAvatars () {
}
})
}
function
getAvailableLocales
()
{
var
locales
=
[]
Linphone
.
App
.
availableLocales
.
forEach
(
function
(
locale
)
{
locales
.
push
({
key
:
Utils
.
capitalizeFirstLetter
(
locale
.
nativeLanguageName
),
value
:
locale
.
name
})
})
return
[{
key
:
qsTr
(
'
systemLocale
'
),
value
:
''
}].
concat
(
locales
.
sort
(
function
(
a
,
b
)
{
return
a
>
b
}))
}
function
setLocale
(
locale
)
{
var
App
=
Linphone
.
App
App
.
configLocale
=
locale
window
.
detachVirtualWindow
()
window
.
attachVirtualWindow
(
Utils
.
buildDialogUri
(
'
ConfirmDialog
'
),
{
descriptionText
:
qsTr
(
'
setLocaleDescription
'
),
},
function
(
status
)
{
if
(
status
)
{
App
.
restart
()
}
})
}
linphone-desktop/ui/views/App/Settings/SettingsUi.qml
View file @
6aceba9d
...
...
@@ -28,34 +28,11 @@ TabContainer {
label
:
qsTr
(
'
languagesLabel
'
)
ComboBox
{
function
_getAvailableLocales
()
{
var
locales
=
[]
App
.
availableLocales
.
forEach
(
function
(
locale
)
{
locales
.
push
({
key
:
Utils
.
capitalizeFirstLetter
(
locale
.
nativeLanguageName
),
value
:
locale
.
name
})
})
return
locales
.
sort
(
function
(
a
,
b
)
{
return
a
>
b
})
}
textRole
:
'
key
'
model
:
ListModel
{}
Component.onCompleted
:
{
var
locales
=
_getAvailableLocales
()
model
.
append
({
key
:
qsTr
(
'
systemLocale
'
),
value
:
''
})
locales
.
forEach
(
function
(
locale
)
{
model
.
append
(
locale
)
})
var
locales
=
Logic
.
getAvailableLocales
()
model
=
locales
var
locale
=
App
.
configLocale
if
(
!
locale
.
length
)
{
...
...
@@ -64,14 +41,12 @@ TabContainer {
}
var
value
=
Qt
.
locale
(
locale
).
name
var
index
=
Utils
.
findIndex
(
locales
,
function
(
locale
)
{
currentIndex
=
Number
(
Utils
.
findIndex
(
locales
,
function
(
locale
)
{
return
locale
.
value
===
value
})
currentIndex
=
index
!=
null
?
index
+
1
:
0
}))
}
onActivated
:
App
.
configLocale
=
model
.
get
(
index
).
value
onActivated
:
Logic
.
setLocale
(
model
[
index
].
value
)
}
}
}
...
...
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