def _createNonHeaderWidgets(self): self.showOnlyCB = wx.CheckBox( self, wx.ID_ANY, _extstr(u"translationeditor.ShowOnlyUntranslated")) #$NON-NLS-1$ self.listProvider = ZStringBundleProvider(self.model) self.listBox = ZListViewEx(self.listProvider, self, wx.ID_ANY) bitmap = getFlagBitmapForLocale(u"en_US") #$NON-NLS-1$ self.englishFlag = ZStaticBitmap(self, bitmap) self.englishLabel = wx.StaticText( self, wx.ID_ANY, _extstr(u"translationeditor.EnglishValue")) #$NON-NLS-1$ bitmap = getFlagBitmapForLocale( self.model.getTranslation().getLocale().toString()) if bitmap is None: bitmap = getEmptyFlagBitmap() self.translationFlag = ZStaticBitmap(self, bitmap) self.translationLabel = wx.StaticText(self, wx.ID_ANY, self.translationDisplayName) self.englishText = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_BESTWRAP) self.translationText = wx.TextCtrl( self, wx.ID_ANY, style=wx.TE_MULTILINE | wx.TE_BESTWRAP | wx.TE_PROCESS_ENTER) self.translationText.Enable(False) self.staticLine = wx.StaticLine(self, wx.HORIZONTAL)
def _createImageList(self): imageList = ZMappedImageList(16, 11) for localeStr in self.model.getLanguagePacks(): bitmap = getFlagBitmapForLocale(localeStr) if bitmap is not None: imageList.addImage(localeStr, bitmap) return imageList
def _createImageList(self): imageList = ZMappedImageList(16, 11) for language in self.model.getLanguages(): langCode = language.getLanguageCode() bitmap = getFlagBitmapForLocale(langCode) if bitmap is not None: imageList.addImage(langCode, bitmap) return imageList
def _createNonHeaderWidgets(self): self.showOnlyCB = wx.CheckBox(self, wx.ID_ANY, _extstr(u"translationeditor.ShowOnlyUntranslated")) #$NON-NLS-1$ self.listProvider = ZStringBundleProvider(self.model) self.listBox = ZListViewEx(self.listProvider, self, wx.ID_ANY) bitmap = getFlagBitmapForLocale(u"en_US") #$NON-NLS-1$ self.englishFlag = ZStaticBitmap(self, bitmap) self.englishLabel = wx.StaticText(self, wx.ID_ANY, _extstr(u"translationeditor.EnglishValue")) #$NON-NLS-1$ bitmap = getFlagBitmapForLocale(self.model.getTranslation().getLocale().toString()) if bitmap is None: bitmap = getEmptyFlagBitmap() self.translationFlag = ZStaticBitmap(self, bitmap) self.translationLabel = wx.StaticText(self, wx.ID_ANY, self.translationDisplayName) self.englishText = wx.TextCtrl(self, wx.ID_ANY, style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_BESTWRAP) self.translationText = wx.TextCtrl(self, wx.ID_ANY, style = wx.TE_MULTILINE | wx.TE_BESTWRAP | wx.TE_PROCESS_ENTER) self.translationText.Enable(False) self.staticLine = wx.StaticLine(self, wx.HORIZONTAL)
def populateWidgets(self): hasLocaleOverride = self.model.hasLocaleOverride() currentLocale = self.model.getCurrentLocale() self.originalProps[u"override-enabled"] = hasLocaleOverride #$NON-NLS-1$ self.originalProps[u"locale"] = currentLocale #$NON-NLS-1$ self.defaultLocale.SetLabel(self.model.getDefaultLocaleName()) bitmap = getFlagBitmapForLocale(currentLocale) if bitmap is not None: self.defaultLocaleBitmap.SetBitmap(bitmap) self.overrideCB.SetValue(hasLocaleOverride) self.localeList.Enable(hasLocaleOverride) if hasLocaleOverride: idx = self.model.getLocaleOverrideIndex() self.selectedLocale = currentLocale self.localeList.Select(idx)
def updateImageList(self): for translation in self.model.getTranslations(): bitmap = getFlagBitmapForLocale(translation.getLocale()) key = translation.getLocale().toString() self.imageMap.addImage(key, bitmap)