mirror of
https://github.com/flarum/core.git
synced 2025-08-03 15:07:53 +02:00
fix(bbcode): localize quote wrote
string (#3809)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
@@ -9,22 +9,34 @@
|
|||||||
|
|
||||||
use Flarum\Extend;
|
use Flarum\Extend;
|
||||||
use s9e\TextFormatter\Configurator;
|
use s9e\TextFormatter\Configurator;
|
||||||
|
use s9e\TextFormatter\Renderer;
|
||||||
|
|
||||||
return (new Extend\Formatter)
|
return [
|
||||||
->configure(function (Configurator $config) {
|
new Extend\Locales(__DIR__.'/locale'),
|
||||||
$config->BBCodes->addFromRepository('B');
|
|
||||||
$config->BBCodes->addFromRepository('I');
|
(new Extend\Formatter)
|
||||||
$config->BBCodes->addFromRepository('U');
|
->render(function (Renderer $renderer, $context, string $xml) {
|
||||||
$config->BBCodes->addFromRepository('S');
|
$renderer->setParameter('L_WROTE', resolve('translator')->trans('flarum-bbcode.forum.quote.wrote'));
|
||||||
$config->BBCodes->addFromRepository('URL');
|
|
||||||
$config->BBCodes->addFromRepository('IMG');
|
return $xml;
|
||||||
$config->BBCodes->addFromRepository('EMAIL');
|
})
|
||||||
$config->BBCodes->addFromRepository('CODE');
|
->configure(function (Configurator $config) {
|
||||||
$config->BBCodes->addFromRepository('QUOTE');
|
$config->BBCodes->addFromRepository('B');
|
||||||
$config->BBCodes->addFromRepository('LIST');
|
$config->BBCodes->addFromRepository('I');
|
||||||
$config->BBCodes->addFromRepository('DEL');
|
$config->BBCodes->addFromRepository('U');
|
||||||
$config->BBCodes->addFromRepository('COLOR');
|
$config->BBCodes->addFromRepository('S');
|
||||||
$config->BBCodes->addFromRepository('CENTER');
|
$config->BBCodes->addFromRepository('URL');
|
||||||
$config->BBCodes->addFromRepository('SIZE');
|
$config->BBCodes->addFromRepository('IMG');
|
||||||
$config->BBCodes->addFromRepository('*');
|
$config->BBCodes->addFromRepository('EMAIL');
|
||||||
});
|
$config->BBCodes->addFromRepository('CODE');
|
||||||
|
$config->BBCodes->addFromRepository('QUOTE', 'default', [
|
||||||
|
'authorStr' => '<xsl:value-of select="@author"/> <xsl:value-of select="$L_WROTE"/>'
|
||||||
|
]);
|
||||||
|
$config->BBCodes->addFromRepository('LIST');
|
||||||
|
$config->BBCodes->addFromRepository('DEL');
|
||||||
|
$config->BBCodes->addFromRepository('COLOR');
|
||||||
|
$config->BBCodes->addFromRepository('CENTER');
|
||||||
|
$config->BBCodes->addFromRepository('SIZE');
|
||||||
|
$config->BBCodes->addFromRepository('*');
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
10
extensions/bbcode/locale/en.yml
Normal file
10
extensions/bbcode/locale/en.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
flarum-bbcode:
|
||||||
|
|
||||||
|
##
|
||||||
|
# UNIQUE KEYS - The following keys are used in only one location each.
|
||||||
|
##
|
||||||
|
|
||||||
|
# Translations in this namespace are used by the forum user interface.
|
||||||
|
forum:
|
||||||
|
quote:
|
||||||
|
wrote: wrote
|
Reference in New Issue
Block a user