Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
bbb75bcd
Commit
bbb75bcd
authored
15 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
clean spell languages list only once. Fixes #5228
parent
c5e447fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/chat_control.py
+24
-22
24 additions, 22 deletions
src/chat_control.py
with
24 additions
and
22 deletions
src/chat_control.py
+
24
−
22
View file @
bbb75bcd
...
...
@@ -64,6 +64,17 @@ except ImportError:
#echo "{_('en'):'en'",$LANG"}"
langs
=
{
_
(
'
English
'
):
'
en
'
,
_
(
'
Belarusian
'
):
'
be
'
,
_
(
'
Bulgarian
'
):
'
bg
'
,
_
(
'
Breton
'
):
'
br
'
,
_
(
'
Czech
'
):
'
cs
'
,
_
(
'
German
'
):
'
de
'
,
_
(
'
Greek
'
):
'
el
'
,
_
(
'
British
'
):
'
en_GB
'
,
_
(
'
Esperanto
'
):
'
eo
'
,
_
(
'
Spanish
'
):
'
es
'
,
_
(
'
Basque
'
):
'
eu
'
,
_
(
'
French
'
):
'
fr
'
,
_
(
'
Croatian
'
):
'
hr
'
,
_
(
'
Italian
'
):
'
it
'
,
_
(
'
Norwegian (b)
'
):
'
nb
'
,
_
(
'
Dutch
'
):
'
nl
'
,
_
(
'
Norwegian
'
):
'
no
'
,
_
(
'
Polish
'
):
'
pl
'
,
_
(
'
Portuguese
'
):
'
pt
'
,
_
(
'
Brazilian Portuguese
'
):
'
pt_BR
'
,
_
(
'
Russian
'
):
'
ru
'
,
_
(
'
Serbian
'
):
'
sr
'
,
_
(
'
Slovak
'
):
'
sk
'
,
_
(
'
Swedish
'
):
'
sv
'
,
_
(
'
Chinese (Ch)
'
):
'
zh_CN
'
}
if
gajim
.
config
.
get
(
'
use_speller
'
)
and
HAS_GTK_SPELL
:
# loop removing non-existent dictionaries
# iterating on a copy
tv
=
gtk
.
TextView
()
spell
=
gtkspell
.
Spell
(
tv
)
for
lang
in
dict
(
langs
):
try
:
spell
.
set_language
(
langs
[
lang
])
except
OSError
:
del
langs
[
lang
]
################################################################################
class
ChatControlBase
(
MessageControl
):
'''
A base class containing a banner, ConversationTextview, MessageTextView
...
...
@@ -292,32 +303,23 @@ class ChatControlBase(MessageControl):
self
.
msg_textview
.
grab_focus
()
def
set_speller
(
self
):
try
:
# now set the one the user selected
per_type
=
'
contacts
'
if
self
.
type_id
==
message_control
.
TYPE_GC
:
per_type
=
'
rooms
'
lang
=
gajim
.
config
.
get_per
(
per_type
,
self
.
contact
.
jid
,
'
speller_language
'
)
if
not
lang
:
# use the default one
lang
=
gajim
.
config
.
get
(
'
speller_language
'
)
if
not
lang
:
lang
=
gajim
.
LANG
spell
=
gtkspell
.
Spell
(
self
.
msg_textview
,
lang
)
# loop removing non-existant dictionaries
# iterating on a copy
for
lang
in
dict
(
langs
):
try
:
spell
.
set_language
(
langs
[
lang
])
except
OSError
:
del
langs
[
lang
]
# now set the one the user selected
per_type
=
'
contacts
'
if
self
.
type_id
==
message_control
.
TYPE_GC
:
per_type
=
'
rooms
'
lang
=
gajim
.
config
.
get_per
(
per_type
,
self
.
contact
.
jid
,
'
speller_language
'
)
if
not
lang
:
# use the default one
lang
=
gajim
.
config
.
get
(
'
speller_language
'
)
if
lang
:
if
lang
:
try
:
gtkspell
.
Spell
(
self
.
msg_textview
,
lang
)
self
.
msg_textview
.
lang
=
lang
spell
.
set_language
(
lang
)
except
(
gobject
.
GError
,
RuntimeError
,
TypeError
,
OSError
):
dialogs
.
AspellDictError
(
lang
)
except
(
gobject
.
GError
,
RuntimeError
,
TypeError
,
OSError
):
dialogs
.
AspellDictError
(
lang
)
def
on_banner_label_populate_popup
(
self
,
label
,
menu
):
'''
We override the default context menu and add our own menutiems
'''
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment