本文整理汇总了C#中MonoDevelop.Gettext.CatalogEntry.GetTranslation方法的典型用法代码示例。如果您正苦于以下问题:C# CatalogEntry.GetTranslation方法的具体用法?C# CatalogEntry.GetTranslation怎么用?C# CatalogEntry.GetTranslation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop.Gettext.CatalogEntry
的用法示例。
在下文中一共展示了CatalogEntry.GetTranslation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldFilter
bool ShouldFilter (CatalogEntry entry, string filter)
{
if (entry.IsFuzzy) {
if (!this.togglebuttonFuzzy.Active) {
return true;
}
} else {
if (!entry.IsTranslated && !this.togglebuttonMissing.Active)
return true;
if (entry.IsTranslated && !this.togglebuttonOk.Active)
return true;
}
if (String.IsNullOrEmpty (filter))
return false;
if (DoSearchIn != SearchIn.Translated) {
if (IsMatch (entry.String, filter))
return false;
if (entry.HasPlural) {
if (IsMatch (entry.PluralString, filter))
return false;
}
}
if (DoSearchIn != SearchIn.Original) {
for (int i = 0; i < entry.NumberOfTranslations; i++) {
if (IsMatch (entry.GetTranslation (i), filter))
return false;
}
}
return true;
}
示例2: SelectEntry
public void SelectEntry (CatalogEntry entry)
{
// if (updateThread.IsBusy)
// return;
TreeIter iter;
if (store.GetIterFirst (out iter)) {
do {
CatalogEntry curEntry = store.GetValue (iter, 4) as CatalogEntry;
if (entry == curEntry) {
this.treeviewEntries.Selection.SelectIter (iter);
TreePath iterPath = store.GetPath (iter);
if (!IsVisible (iterPath))
this.treeviewEntries.ScrollToCell (iterPath, treeviewEntries.GetColumn (0), true, 0, 0);
return;
}
} while (store.IterNext (ref iter));
}
store.AppendValues (GetStockForEntry (entry),
entry.IsFuzzy,
EscapeForTreeView (entry.String),
EscapeForTreeView (entry.GetTranslation (0)),
entry,
GetRowColorForEntry (entry),
GetTypeSortIndicator (entry),
GetForeColorForEntry (entry)
);
SelectEntry (entry);
}
示例3: FailReason
public override string FailReason (CatalogEntry entry)
{
foreach (System.Text.RegularExpressions.Match match in Regex.Matches (entry.String, @"\{.\}", RegexOptions.None)) {
if (!entry.GetTranslation (0).Contains (match.Value))
return GettextCatalog.GetString ("Original string '{0}' contains '{1}', translation doesn't.", entry.String, match.Value);
}
return "";
}
示例4: EditEntry
void EditEntry (CatalogEntry entry)
{
this.isUpdating = true;
try {
currentEntry = entry;
this.texteditorOriginal.Caret.Location = new DocumentLocation (1, 1);
this.texteditorOriginal.Document.Text = entry != null ? entry.String : "";
this.texteditorOriginal.VAdjustment.Value = this.texteditorOriginal.HAdjustment.Value = 0;
// if (GtkSpell.IsSupported && !gtkSpellSet.ContainsKey (this.textviewOriginal)) {
// GtkSpell.Attach (this.textviewOriginal, "en");
// this.gtkSpellSet[this.textviewOriginal] = true;
// }
//
this.vbox8.Visible = entry != null && entry.HasPlural;
this.notebookTranslated.ShowTabs = entry != null && entry.HasPlural;
if (entry != null && entry.HasPlural) {
this.texteditorPlural.Caret.Location = new DocumentLocation (1, 1);
this.texteditorPlural.Document.Text = entry.PluralString;
this.texteditorPlural.VAdjustment.Value = this.texteditorPlural.HAdjustment.Value = 0;
// if (GtkSpell.IsSupported && !gtkSpellSet.ContainsKey (this.textviewOriginalPlural)) {
// GtkSpell.Attach (this.textviewOriginalPlural, "en");
// this.gtkSpellSet[this.textviewOriginalPlural] = true;
// }
}
this.foundInStore.Clear ();
if (entry != null) {
RemoveTextViewsFrom (entry.NumberOfTranslations);
for (int i = this.notebookTranslated.NPages; i < entry.NumberOfTranslations; i++) {
AddTextview (i);
}
for (int i = 0; i < entry.NumberOfTranslations; i++) {
Mono.TextEditor.TextEditor textView = GetTextView (i);
if (textView == null)
continue;
textView.ClearSelection ();
textView.Document.Text = entry != null ? entry.GetTranslation (i) : "";
textView.Caret.Offset = textView.Document.Text.Length;
textView.VAdjustment.Value = textView.HAdjustment.Value = 0;
textView.Document.CommitUpdateAll ();
}
foreach (string reference in entry.References) {
string file;
string line;
int i = reference.IndexOf (':');
if (i >= 0) {
file = reference.Substring (0, i);
line = reference.Substring (i + 1);
} else {
file = reference;
line = "?";
}
string fullName = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (this.poFileName), file);
this.foundInStore.AppendValues (file, line, fullName, DesktopService.GetIconForFile (fullName, IconSize.Menu));
}
}
this.textviewComments.Buffer.Text = entry != null ? entry.Comment : null;
/* if (GtkSpell.IsSupported) {
foreach (TextView view in this.gtkSpellSet.Keys)
GtkSpell.Recheck (view);
}*/
} finally {
this.isUpdating = false;
}
}
示例5: EntryFails
public override bool EntryFails (CatalogEntry entry)
{
foreach (System.Text.RegularExpressions.Match match in Regex.Matches (entry.String, @"\{.\}", RegexOptions.None)) {
if (!entry.GetTranslation (0).Contains (match.Value))
return true;
}
return false;
}