mirror of
https://github.com/friendica/friendica
synced 2024-11-09 23:02:54 +00:00
Fix util/php2po
- Remove use - Simplify object handling - Fix wrong `|| die()` structure
This commit is contained in:
parent
3e7f683533
commit
e51c4a38ad
1 changed files with 10 additions and 10 deletions
20
util/php2po.php
Normal file → Executable file
20
util/php2po.php
Normal file → Executable file
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Read strings.php file and create messages.po
|
||||
|
@ -7,16 +8,9 @@
|
|||
* Output to <path/to/messages.po>
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
|
||||
DEFINE("NORM_REGEXP", "|[\\\]|");
|
||||
|
||||
if(! class_exists('App')) {
|
||||
class TmpA {
|
||||
public $strings = [];
|
||||
}
|
||||
$a = new TmpA();
|
||||
}
|
||||
$a = new stdClass();
|
||||
|
||||
if ($argc<2 || in_array('-h', $argv) || in_array('--h', $argv)) {
|
||||
print "Usage: ".$argv[0]." [-p <n>] <strings.php>\n\n";
|
||||
|
@ -93,8 +87,14 @@ print "\nLoading base message.po...";
|
|||
// load base messages.po and extract msgids
|
||||
$base_msgids = [];
|
||||
$norm_base_msgids = [];
|
||||
$base_f = file("util/messages.po") || die("No base messages.po\n");
|
||||
$_f = 0; $_mid = ""; $_mids = [];
|
||||
$base_f = file("util/messages.po");
|
||||
if (!$base_f) {
|
||||
die("No base messages.po\n");
|
||||
}
|
||||
|
||||
$_f = 0;
|
||||
$_mid = "";
|
||||
$_mids = [];
|
||||
foreach( $base_f as $l) {
|
||||
$l = trim($l);
|
||||
//~ print $l."\n";
|
||||
|
|
Loading…
Reference in a new issue