X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FPhpToPo.php;h=a400fea23cb50efda05a18ad2961c637179620c6;hb=40a126306621fe9eadb58101bd19a0be32e4c163;hp=d73c7f4ab6b79d90f03a63a7f76556479f54a05d;hpb=1de3960e267a8d298348fbca18cf1be1f6a20f7a;p=friendica.git diff --git a/src/Console/PhpToPo.php b/src/Console/PhpToPo.php index d73c7f4ab6..a400fea23c 100644 --- a/src/Console/PhpToPo.php +++ b/src/Console/PhpToPo.php @@ -1,11 +1,30 @@ . + * + */ namespace Friendica\Console; +use Friendica\App; + /** * Read a strings.php file and create messages.po in the same directory - * - * @author Hypolite Petovan */ class PhpToPo extends \Asika\SimpleConsole\Console { @@ -15,6 +34,16 @@ class PhpToPo extends \Asika\SimpleConsole\Console private $normBaseMsgIds = []; const NORM_REGEXP = "|[\\\]|"; + /** @var App */ + private $app; + + public function __construct(App $app, array $argv = null) + { + parent::__construct($argv); + + $this->app = $app; + } + protected function getHelp() { $help = <<getOption('v')) { $this->out('Class: ' . __CLASS__); @@ -51,7 +80,7 @@ HELP; throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments'); } - $a = \get_app(); + $a = $this->app; $phpfile = realpath($this->getArgument(0)); @@ -70,7 +99,7 @@ HELP; $out = ''; $out .= "# FRIENDICA Distributed Social Network\n"; - $out .= "# Copyright (C) 2010, 2011, 2012, 2013 the Friendica Project\n"; + $out .= "# Copyright (C) 2010-2023, the Friendica project\n"; $out .= "# This file is distributed under the same license as the Friendica package.\n"; $out .= "# \n"; $out .= 'msgid ""' . "\n"; @@ -202,7 +231,7 @@ HELP; } /** - * Get a string and retun a message.po ready text + * Get a string and return a message.po ready text * - replace " with \" * - replace tab char with \t * - manage multiline strings