Skip to content

Commit

Permalink
build(locales): update mo files build code
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jun 19, 2023
1 parent 57fabc5 commit e9badc4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion RoboFilePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,16 @@ public function localesPull($percent = 70) {
* @return void
*/
public function localesMo() {
$this->_exec('./tools/release --compile-mo');
$po_files = preg_grep('/\.po$/', scandir('./locales'));
foreach ($po_files as $po_file) {
$mo_file = preg_replace('/\.po$/', '.mo', $po_file);
echo("Processing {$po_file}\n");
passthru("cd ./locales && msgfmt -f -o {$mo_file} {$po_file}", $exit_code);
if ($exit_code > 0) {
exit($exit_code);
}
}

return $this;
}

Expand Down

0 comments on commit e9badc4

Please sign in to comment.