From 4ae3bf07f1e6bbdd7b7f37fa770719e407c7b008 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Fri, 23 Nov 2012 18:11:02 +0000 Subject: CP: allow further selection beyond English fallback Currently, the language control panel does not allow you to select other languages after a en_US entry. This is built around the assumption that source code strings are always in English, which is the common case, but does not always have to be true. As other apps can interpret the same LANGUAGE variable as a more general priority list of languages (Maliit will start doing this), there is further justification to remove the artificial en_US ending boundary. Acked-by: Simon Schampijer --- diff --git a/extensions/cpsection/language/view.py b/extensions/cpsection/language/view.py index 95066f8..77f7207 100644 --- a/extensions/cpsection/language/view.py +++ b/extensions/cpsection/language/view.py @@ -136,8 +136,6 @@ class Language(SectionView): previous_add_removes = self._add_remove_boxes[-2] previous_add_removes.hide() - self._determine_add_remove_visibility() - combobox.show() def _attach_to_table(self, widget, row, column, padding=20, \ @@ -216,8 +214,6 @@ class Language(SectionView): selected_langs = self._get_selected_langs() last_lang = selected_langs[-1] - self._determine_add_remove_visibility(last_lang=last_lang) - self._changed = (selected_langs != self._selected_locales) if self._changed == False: @@ -247,29 +243,6 @@ class Language(SectionView): return new_codes - def _determine_add_remove_visibility(self, last_lang=None): - # We should not let users add fallback languages for English (USA) - # This is because the software is not usually _translated_ into English - # which means that the fallback gets selected automatically - - if last_lang is None: - selected_langs = self._get_selected_langs() - last_lang = selected_langs[-1] - - add_remove_box = self._add_remove_boxes[-1] - buttons = add_remove_box.get_children() - add_button, remove_button = buttons - - if last_lang.startswith('en_US'): - add_button.props.visible = False - else: - add_button.props.visible = True - - if self._selected_lang_count == 1: - remove_button.props.visible = False - else: - remove_button.props.visible = True - def __lang_timeout_cb(self, codes): self._lang_sid = 0 self._model.set_languages_list(codes) -- cgit v0.9.1