mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 15:16:30 +03:00
[UXTranslator] Add recipe for 2.32
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { createTranslator } from '@symfony/ux-translator';
|
||||
import { messages, localeFallbacks } from '../var/translations/index.js';
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony UX Translator package.
|
||||
*
|
||||
* If folder "../var/translations" does not exist, or some translations are missing,
|
||||
* you must warmup your Symfony cache to refresh JavaScript translations.
|
||||
*
|
||||
* If you use TypeScript, you can rename this file to "translator.ts" to take advantage of types checking.
|
||||
*/
|
||||
|
||||
const translator = createTranslator({
|
||||
messages,
|
||||
localeFallbacks,
|
||||
});
|
||||
|
||||
export const { trans } = translator;
|
||||
@@ -0,0 +1,3 @@
|
||||
ux_translator:
|
||||
# The directory where the JavaScript translations are dumped
|
||||
dump_directory: '%kernel.project_dir%/var/translations'
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\UX\\Translator\\UxTranslatorBundle": ["all"]
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"assets/": "assets/",
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"var/": "var/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
console.log('Run bin/console cache:warmup to generate the translation files.');
|
||||
Reference in New Issue
Block a user