Return translated header text depending on creating/editing action

@return string
495030
public function getHeaderText()
    {
        if ($this->getJob()->getId()) {
            return $this->__('Job "%s"', $this->escapeHtml($this->getJob()->getJobCode()));
        } else {
            return $this->__('New Job');
        }
    }
860406
public function title()
    {
        return $this->translator()->has($key = $this->translationKey())
            ? trans($key)
            : StringHumanizer::humanize(class_basename($this));
    }
656813
private function contentMessages()
    {
        $savedTranslations = $this->readSavedTranslations();
        // An exception occurred when reading the file
        if ($savedTranslations === null) {
            return '';
        }

        $this->gatherTranslatableStrings();

        // Find already translated strings
        $newTranslations = [];
        foreach (array_keys($this->translatables) as $key) {
            $newTranslations[$key] = isset($savedTranslations[$key]) ? $savedTranslations[$key] : '';
        }
        ksort($newTranslations);

        try {
            return $this->buildNewContent($newTranslations, $savedTranslations);
        } catch (InvalidResourceException $e) {
            // last resort fallback, edit the file
            return file_get_contents($this->absPath);
        }
    }
695129
protected function customizeTranslation()
	{
		$message 		= \Sifo\FilterPost::getInstance()->getString( 'msgid' );
		$id_message 	= null;
		if ( is_numeric( $message ) )
		{
			$id_message = $message;
		}
		$instance			= $this->getParsedParam( 'instance' );
		$translator_model 	= new I18nTranslatorModel();

		$id_message = $translator_model->getTranslation( $message, $id_message );

		$result = array( 'status' => 'KO', 'msg' => 'This Message or ID doesn\'t exist.' );
		if ( $id_message )
		{
			$result = array( 'status' => 'OK', 'msg' => 'Message successfully customized.' );
			if( !$translator_model->customizeTranslation( $id_message, $instance ) )
			{
				$result = array( 'status' => 'KO', 'msg' => 'This message is already customized in this instance.' );
			}
		}

		return $result;
	}
381966
protected function getInlineJavaScriptTranslations()
    {
        $dismiss_text = Swat::_('Dismiss message.');
        $select_an_action_text = Swat::_('Please select an action.');
        $select_an_item_text = Swat::_('Please select one or more items.');
        $select_an_item_and_an_action_text = Swat::_(
            'Please select an action, and one or more items.'
        );

        return sprintf(
            "SwatActions.dismiss_text = '%s';\n" .
                "SwatActions.select_an_action_text = '%s';\n" .
                "SwatActions.select_an_item_text = '%s';\n" .
                "SwatActions.select_an_item_and_an_action_text = '%s';\n",
            $dismiss_text,
            $select_an_action_text,
            $select_an_item_text,
            $select_an_item_and_an_action_text
        );
    }
693242
public function forTemplate()
    {
        $isEditable = FrontendEditing::editingEnabled() && FrontendEditing::isEditable($this);
        $value      = parent::forTemplate();
        if ($isEditable) {
            $field = $this->formField(null, null, false, $value)->
                setAttribute('data-feclass', FrontendEditing::getClassName($this))->
                setAttribute('data-feid', FrontendEditing::getID($this))->
                setAttribute('data-fefield', $this->name)->
                addExtraClass("frontend-editable frontend-editable-enum");
            $value = $field->forTemplate();
        }
        return $value;
    }
407199
protected function _writeHeader()
    {
        $output = "# LANGUAGE translation of CakePHP Application\n";
        $output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
        $output .= "#\n";
        $output .= "#, fuzzy\n";
        $output .= "msgid \"\"\n";
        $output .= "msgstr \"\"\n";
        $output .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n";
        $output .= '"POT-Creation-Date: ' . date('Y-m-d H:iO') . "\\n\"\n";
        $output .= "\"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\\n\"\n";
        $output .= "\"Last-Translator: NAME <EMAIL@ADDRESS>\\n\"\n";
        $output .= "\"Language-Team: LANGUAGE <EMAIL@ADDRESS>\\n\"\n";
        $output .= "\"MIME-Version: 1.0\\n\"\n";
        $output .= "\"Content-Type: text/plain; charset=utf-8\\n\"\n";
        $output .= "\"Content-Transfer-Encoding: 8bit\\n\"\n";
        $output .= "\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n\n";

        return $output;
    }
311265
protected function getHeader()
    {
        $header = '';

        $fin  = $this->fin  ? 0x80 : 0x00;

        $rsv1 = $this->rsv1 ? 0x40 : 0x00;
        $rsv2 = $this->rsv2 ? 0x20 : 0x00;
        $rsv3 = $this->rsv3 ? 0x10 : 0x00;

        $byte1 = $fin | $rsv1 | $rsv2 | $rsv3 | $this->opcode;

        $mask = $this->isMasked ? 0x80 : 0x00;

        $byte2 = $mask | $this->length;

        $header .= pack('CC', $byte1, $byte2);

        if ($this->length === 0x7e) {
            $header .= pack('s', $this->length16);
        }

        if ($this->length === 0x7f) {
            // TODO
        }

        if ($this->isMasked) {
            $header .= $this->mask;
        }

        return $header;
    }
1019197
public function getTitleString()
    {
        $sep = $this->titleSeparator;
        $raw = trim(
            implode(
                $sep,
                [
                    implode($sep, $this->titles),
                    $this->siteTitle
                ]
            ),
            $sep
        );
        return $raw;
    }
417112
protected function translateToTemplateFilename()
    {
        // get object we operate on
        $presenter = ucfirst($this->getRoute()->getPresenter());

        // get action we should operate
        $action = ucfirst($this->getRoute()->getAction());

        // construct relative filename (+path) for current-view template
        return $presenter.DIRECTORY_SEPARATOR.$action;
    }
103793
public function get_heading($adding = false) {
        if ($adding) {
            $string = 'pluginnameadding';
        } else {
            $string = 'pluginnameediting';
        }
        return get_string($string, $this->plugin_name());
    }
1364990
protected function getInlineJavaScriptTranslations()
    {
        $close_text =
            $this->close_text === null ? Swat::_('Close') : $this->close_text;

        return sprintf(
            "SwatImagePreviewDisplay.close_text = '%s';\n",
            $close_text
        );
    }
385043
public function toHeading()
    {
        $results = '';

        foreach ($this->getColumns() as $column) {
            if (in_array($name = $column->getName(), $this->ignores)) {
                continue;
            }

            $results .= "\t\t\t".'<th>'.ucwords($name).'</th>'.PHP_EOL;
        }

        return $results;
    }
584323
protected function getHeaderTitle()
    {
        if ($this->title == '') {
            $header_title = '&nbsp;';
        } else {
            $header_title = $this->show_colon
                ? sprintf(Swat::_('%s:'), $this->title)
                : $this->title;
        }

        return $header_title;
    }
1052365
public function getEmailContent() : string
    {
        $result = '';

        $module = Inflector::singularize($this->table->getAlias());
        $displayValue = $this->getDisplayValue();
        $user = $this->getUserString();
        $action = $this->entity->isNew() ? 'created' : 'updated';

        // Example: Lead Foobar created by System
        $result = sprintf("%s %s %s by %s", $module, $displayValue, $action, $user);

        $changeLog = $this->getChangelog();
        if (!empty($changeLog)) {
            $result .= "\n\n";
            $result .= $changeLog;
            $result .= "\n";
        }

        $result .= "\n\n";
        $result .= "See more: ";
        $result .= $this->getEntityUrl();

        return $result;
    }
1313265
public function getTitle()
    {
        $language = \OxidEsales\Eshop\Core\Registry::getLang();
        $translationName = 'PAGE_TITLE_' . strtoupper(\OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView()->getClassName());
        $translated = $language->translateString($translationName, \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(), false);

        return $translationName == $translated ? null : $translated;
    }
80032
protected function getActionText()
    {
        if ($this->hasBeenSent()) {
            $action = 'action_sent';
        } elseif ($this->isSendingPrevented()) {
            $action = 'action_not_sent';
        } else {
            $action = 'action_unknown';
        }
        return $this->t($action);
    }