diff --git src/wp-includes/pomo/mo.php src/wp-includes/pomo/mo.php
index e8eecc1..a1366e5 100644
|
|
class MO extends Gettext_Translations { |
19 | 19 | * Fills up with the entries from MO file $filename |
20 | 20 | * |
21 | 21 | * @param string $filename MO file to load |
| 22 | * @return boolean |
22 | 23 | */ |
23 | 24 | function import_from_file($filename) { |
24 | | $reader = new POMO_FileReader($filename); |
25 | | if (!$reader->is_resource()) |
26 | | return false; |
27 | | return $this->import_from_reader($reader); |
| 25 | $data = wp_cache_get($filename, 'translation.mo'); |
| 26 | $mtime = filemtime($filename); |
| 27 | |
| 28 | if (!$data || $mtime > $data['mtime']) { |
| 29 | $reader = new POMO_FileReader($filename); |
| 30 | if (!$reader->is_resource()) |
| 31 | return false; |
| 32 | $result = $this->import_from_reader($reader); |
| 33 | |
| 34 | if ($result) { |
| 35 | wp_cache_set($filename, array( |
| 36 | 'mtime' => $mtime, |
| 37 | 'entries' => $this->entries, |
| 38 | 'headers' => $this->headers), 'translation.mo'); |
| 39 | } |
| 40 | |
| 41 | return $result; |
| 42 | } else { |
| 43 | $this->entries = $data['entries']; |
| 44 | $this->headers = $data['headers']; |
| 45 | |
| 46 | return true; |
| 47 | } |
28 | 48 | } |
29 | 49 | |
30 | 50 | function export_to_file($filename) { |
… |
… |
class MO extends Gettext_Translations { |
262 | 282 | return $this->_nplurals; |
263 | 283 | } |
264 | 284 | } |
265 | | endif; |
266 | | No newline at end of file |
| 285 | endif; |