wxString PoeditListCtrl::OnGetItemText(long item, long column) const { if (m_catalog == NULL) return wxEmptyString; const CatalogItem& d = ListIndexToCatalogItem((int)item); switch (column) { case 0: { wxString orig; if ( d.HasContext() ) orig.Printf("%s [ %s ]", d.GetString().c_str(), d.GetContext().c_str()); else orig = d.GetString(); return orig.substr(0,GetMaxColChars()); } case 1: { wxString trans = d.GetTranslation(); return trans; } case 2: return wxString() << d.GetLineNumber(); default: return wxEmptyString; } }
wxString PoeditListCtrl::OnGetItemText(long item, long column) const { if (!m_catalog) return wxEmptyString; auto d = ListIndexToCatalogItem((int)item); if (column == m_colSource) { wxString orig; if ( d->HasContext() ) orig.Printf("%s [ %s ]", d->GetString().c_str(), d->GetContext().c_str()); else orig = d->GetString(); orig = orig.substr(0, GetMaxColChars()); // Add RTL Unicode mark to render bidi texts correctly if (m_appIsRTL) return L"\u202a" + orig; else return orig; } else if (column == m_colTrans) { auto trans = d->GetTranslation().substr(0, GetMaxColChars()); // Add RTL Unicode mark to render bidi texts correctly if (m_isRTL && !m_appIsRTL) return L"\u202b" + trans; else return trans; } else if (column == m_colId) { return wxString() << d->GetId(); } else { return wxEmptyString; } }
wxString PoeditListCtrl::OnGetItemText(long item, long column) const { if (m_catalog == NULL) return wxEmptyString; const CatalogItem& d = ListIndexToCatalogItem((int)item); switch (column) { case 0: { wxString orig; if ( d.HasContext() ) orig.Printf("%s [ %s ]", d.GetString().c_str(), d.GetContext().c_str()); else orig = d.GetString(); // Add RTL Unicode mark to render bidi texts correctly if (m_appIsRTL) return L"\u202a" + orig.substr(0,GetMaxColChars()); else return orig.substr(0,GetMaxColChars()); } case 1: { // Add RTL Unicode mark to render bidi texts correctly if (m_isRTL && !m_appIsRTL) return L"\u202b" + d.GetTranslation(); else return d.GetTranslation(); } case 2: return wxString() << d.GetId(); default: return wxEmptyString; } }