Index: /CKLangTool/trunk/_source/includes/cklangtool.js
===================================================================
--- /CKLangTool/trunk/_source/includes/cklangtool.js	(revision 7088)
+++ /CKLangTool/trunk/_source/includes/cklangtool.js	(revision 7089)
@@ -38,4 +38,13 @@
 ( function()
 {
+	function stripExtension( fileName )
+	{
+		var pos = fileName.lastIndexOf( "." );
+		if ( pos == -1 )
+			return "";
+		else
+			return String( fileName.substring( 0, pos ).toLowerCase() );
+	}
+
 	/**
 	 * Load language file and return an object with the whole translation.
@@ -112,4 +121,11 @@
 					headers = pom[ '' ],
 					languageCode = headers.language;
+
+				if ( languageCode.toLowerCase() != stripExtension(file.getName()).toLowerCase() )
+				{
+					throw ( "Language file does not seem to be valid.\n" +
+							"Language code (" + languageCode + ") and the name of the file (" + file.getName()+ ") do not match.\n" +
+							"Is the following file valid: " + file.getAbsolutePath() + " ?\n" );
+				}
 
 				var trans = {}, translated, keys, key, entry;
Index: /CKLangTool/trunk/_source/includes/po_parser.js
===================================================================
--- /CKLangTool/trunk/_source/includes/po_parser.js	(revision 7088)
+++ /CKLangTool/trunk/_source/includes/po_parser.js	(revision 7089)
@@ -45,5 +45,6 @@
 
 			// Empty line / End of an entry.
-			if ( /^$/.test( lines[i] ) )
+			// Skip an empty line if it was found straight below initial empty msgid.
+			if ( /^$/.test( lines[i] ) && !( buffer['msgstr_0'] == "" && buffer['msgid'] == "" ) )
 			{
 				if ( typeof(buffer['msgid']) != 'undefined' )
