Skip to content

Commit e9badc4

Browse files
committed
build(locales): update mo files build code
1 parent 57fabc5 commit e9badc4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

RoboFilePlugin.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,16 @@ public function localesPull($percent = 70) {
130130
* @return void
131131
*/
132132
public function localesMo() {
133-
$this->_exec('./tools/release --compile-mo');
133+
$po_files = preg_grep('/\.po$/', scandir('./locales'));
134+
foreach ($po_files as $po_file) {
135+
$mo_file = preg_replace('/\.po$/', '.mo', $po_file);
136+
echo("Processing {$po_file}\n");
137+
passthru("cd ./locales && msgfmt -f -o {$mo_file} {$po_file}", $exit_code);
138+
if ($exit_code > 0) {
139+
exit($exit_code);
140+
}
141+
}
142+
134143
return $this;
135144
}
136145

0 commit comments

Comments
 (0)