forked from Snck3rs/contao-leaflet-maps
Use symfony translator.
This commit is contained in:
@@ -12,10 +12,10 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Dca;
|
||||
|
||||
use ContaoCommunityAlliance\Translator\TranslatorInterface as Translator;
|
||||
use Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory;
|
||||
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder;
|
||||
use Netzmacht\Contao\Leaflet\Model\MapModel;
|
||||
use Symfony\Component\Translation\TranslatorInterface as Translator;
|
||||
|
||||
/**
|
||||
* Class Module is the helper for the tl_module dca.
|
||||
@@ -88,18 +88,18 @@ class FrontendIntegration
|
||||
\RequestToken::get(),
|
||||
sprintf(
|
||||
$pattern,
|
||||
specialchars($this->translator->translate('editalias.1', 'tl_content', [$dataContainer->value])),
|
||||
specialchars($this->translator->trans('editalias.1', [$dataContainer->value], 'contao_tl_content')),
|
||||
specialchars(
|
||||
str_replace(
|
||||
"'",
|
||||
"\\'",
|
||||
sprintf($this->translator->translate('editalias.1', 'tl_content', [$dataContainer->value]))
|
||||
sprintf($this->translator->trans('editalias.1', [$dataContainer->value], 'contao_tl_content'))
|
||||
)
|
||||
)
|
||||
),
|
||||
\Image::getHtml(
|
||||
'alias.gif',
|
||||
$this->translator->translate('editalias.0', 'tl_content', [$dataContainer->value]),
|
||||
$this->translator->trans('editalias.0', [$dataContainer->value], 'contao_tl_content'),
|
||||
'style="vertical-align:top"'
|
||||
)
|
||||
);
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Dca;
|
||||
|
||||
use ContaoCommunityAlliance\Translator\TranslatorInterface as Translator;
|
||||
use Netzmacht\Contao\Toolkit\Dca\Callback\Callbacks;
|
||||
use Netzmacht\Contao\Toolkit\Dca\Manager;
|
||||
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder;
|
||||
use Netzmacht\Contao\Leaflet\Model\LayerModel;
|
||||
use Symfony\Component\Translation\TranslatorInterface as Translator;
|
||||
|
||||
/**
|
||||
* Class Layer is the helper class for the tl_leaflet_layer dca.
|
||||
@@ -203,10 +203,10 @@ class LayerCallbacks extends Callbacks
|
||||
$buffer = sprintf(
|
||||
'<a href="%s" title="%s" onclick="Backend.getScrollOffset()">%s</a> ',
|
||||
$pasteAfterUrl,
|
||||
specialchars($this->translator->translate('pasteafter.1', $table, [$row['id']])),
|
||||
specialchars($this->translator->trans('pasteafter.1', [$row['id']], 'contao_' . $table)),
|
||||
\Image::getHtml(
|
||||
'pasteafter.gif',
|
||||
$this->translator->translate('pasteafter.1', $table, [$row['id']])
|
||||
$this->translator->trans('pasteafter.1', [$row['id']], 'contao_' . $table)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -223,10 +223,10 @@ class LayerCallbacks extends Callbacks
|
||||
$buffer .= sprintf(
|
||||
'<a href="%s" title="%s" onclick="Backend.getScrollOffset()">%s</a> ',
|
||||
$pasteIntoUrl,
|
||||
specialchars($this->translator->translate('pasteinto.1', $table, [$row['id']])),
|
||||
specialchars($this->translator->trans('pasteinto.1', [$row['id']], 'contao_' . $table)),
|
||||
\Image::getHtml(
|
||||
'pasteinto.gif',
|
||||
$this->translator->translate('pasteinto.1', $table, [$row['id']])
|
||||
$this->translator->trans('pasteinto.1', [$row['id']], 'contao_' . $table)
|
||||
)
|
||||
);
|
||||
} elseif ($row['id'] > 0) {
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Dca;
|
||||
|
||||
use ContaoCommunityAlliance\Translator\TranslatorInterface as Translator;
|
||||
use Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory;
|
||||
use Netzmacht\LeafletPHP\Value\LatLng;
|
||||
use Symfony\Component\Translation\TranslatorInterface as Translator;
|
||||
|
||||
/**
|
||||
* Class Validator.
|
||||
@@ -66,7 +66,7 @@ class Validator
|
||||
LatLng::fromString($value);
|
||||
} catch (\Exception $e) {
|
||||
throw new \InvalidArgumentException(
|
||||
$this->translator->translate('invalidCoordinates', 'leaflet', [$value]),
|
||||
$this->translator->trans('invalidCoordinates', [$value], 'contao_leaflet'),
|
||||
0,
|
||||
$e
|
||||
);
|
||||
@@ -126,7 +126,7 @@ class Validator
|
||||
{
|
||||
if (preg_match('/^[A-Za-z_]+[A-Za-z0-9_]+$/', $value) !== 1) {
|
||||
throw new \InvalidArgumentException(
|
||||
$this->translator->translate('invalidAlias', 'leaflet')
|
||||
$this->translator->trans('invalidAlias', [], 'contao_leaflet')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user