diff options
author | Michał Poczwardowski <dmp0x7c5@gmail.com> | 2013-05-02 21:12:31 (GMT) |
---|---|---|
committer | Michał Poczwardowski <dmp0x7c5@gmail.com> | 2013-05-04 20:53:43 (GMT) |
commit | 204382c694d7a042c9b522565cb1157a631fa134 (patch) | |
tree | db9a31297008871e1b22180ec9758bd294413aba | |
parent | 3a581d40446cf3c1b9aa29565a864a11dfa9ce4a (diff) |
Add join to sugar-xx where xx is current locale, except for 'en'channel_by_locale
-rw-r--r-- | ircactivity.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ircactivity.py b/ircactivity.py index b69d71e..5b4901b 100644 --- a/ircactivity.py +++ b/ircactivity.py @@ -23,6 +23,7 @@ import gtk import simplejson import ConfigParser import os +import locale from sugar.activity import activity from sugar.activity.activity import get_bundle_path @@ -116,9 +117,12 @@ class IRCActivity(activity.Activity): elif os.path.exists(DEFAULT_CONFIG_PATH): self.read_defaults_from_config(DEFAULT_CONFIG_PATH) else: - self.client.join_server('us.freenode.net') + self.client.join_server('irc.freenode.net') self.client.add_channel('#sugar') - self.client.add_channel_other('#sugar-es') + # determine locale + langcode = locale.getdefaultlocale()[0].split('_')[0] + if len(langcode) == 2 and langcode != 'en': + self.client.add_channel_other('#sugar-' + langcode) def read_defaults_from_config(self, config_file): logging.debug('Reading configuration from file %s' % config_file) |