internal void AddTranslation(Translation translation) { if (translation == null) throw new ArgumentNullException("translation"); Translations.Add(translation); }
private string PluralTranslate(string msgid, string msgidPlural, long n, Translation pl) { if (pl == null) goto fallback; var idx = Catalog.GetPluralIndex(n); var t = pl.MessageTranslations.FirstOrDefault(x => x.Index == idx); if (t == null) goto fallback; var translatedString = t.Message.String; if (string.IsNullOrWhiteSpace(translatedString)) goto fallback; return translatedString; fallback: return n == 1 ? msgid : msgidPlural; }