protected function parse($resource)
	{
		$fp = fopen($resource, 'r');
		$messages = array();
		$pair = array(); // translation unit pair: id => translated string
		
		while (!feof($fp)) {
			$line = fgets($fp);
			
			if (strncmp($line, 'msgid', strlen('msgid')) === 0) { // is a message id
				$str = $this->normalize(substr($line, strlen('msgid') + 1, strlen($line)));
				if (!empty($str)) {
					$pair[] = $str;
				}
			} elseif (strncmp($line, 'msgstr', strlen('msgstr')) === 0) { // is a translation
				$str = $this->normalize(substr($line, strlen('msgstr') + 1, strlen($line)));
				if (!empty($pair)) {
					$pair[] = $str;
				}
			}
			
			if (count($pair) == 2) { // we have extracted a translation unit
				$messages[$pair[0]] = $pair[1];
				$pair = array();
			}
		}
		
		fclose($fp);
		return $messages;
	}