Ignoring incomplete localization entries

- i.e. when the msgid or msgstr are empty

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-10-21 14:02:12 -07:00
parent dfb07bb95c
commit 73c815f67d

View File

@@ -183,7 +183,8 @@ namespace Orchard.Localization.Services {
if (poLine.StartsWith("msgstr")) {
string translation = ParseTranslation(poLine);
if (!String.IsNullOrEmpty(id)) {
// ignore incomplete localizations (empty msgid or msgstr)
if ( !String.IsNullOrWhiteSpace(id) && !String.IsNullOrWhiteSpace(translation) ) {
string scopedKey = (scope + "|" + id).ToLowerInvariant();
if (!translations.ContainsKey(scopedKey)) {
translations.Add(scopedKey, translation);