@j-prause:
hum, problems with .mo files is that header doesn’t have LTD (lang. translation domain), so function _is_valid_entry thinks it’s non-valid entry.
I changed function _is_valid_entry in class-translationfile.php (line #524):
function _is_valid_entry(&$entry, &$textdomain) {
return (
($this->strings->_strlen(str_replace("", "", $entry['T'])) > 0)
&&
(in_array($textdomain, $entry['LTD']) || empty($entry['LTD']))
);
}
Probably, not the best solution, anyway it works 🙂
j-prause:
change this line in class-translationfile.php (in latest version it’s line #339):
$this->_set_header_from_string("Plural-Forms: \nX-Textdomain-Support: yes");
to:
$po_lang = 'en';
if (preg_match("/([a-z][a-z]_[A-Z][A-Z]).(mo|po)$/", $pofile, $hits)) {
$po_lang = $this->strings->_substr($hits[1],0,2);
}else{
$po_lang = $this->strings->_substr($_POST['language'],0,2);
}
$this->_set_header_from_string("Plural-Forms: \nX-Textdomain-Support: yes", $po_lang);
It should fix bad plural forms.