Skip to content

Commit dfa41a0

Browse files
authored
Merge pull request #1498 from Kocal/ux-translator-2.32
[UXTranslator] Add recipe for 2.32
2 parents 528e5aa + d140bff commit dfa41a0

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { createTranslator } from '@symfony/ux-translator';
2+
import { messages, localeFallbacks } from '../var/translations/index.js';
3+
4+
/*
5+
* This file is part of the Symfony UX Translator package.
6+
*
7+
* If folder "../var/translations" does not exist, or some translations are missing,
8+
* you must warmup your Symfony cache to refresh JavaScript translations.
9+
*
10+
* If you use TypeScript, you can rename this file to "translator.ts" to take advantage of types checking.
11+
*/
12+
13+
const translator = createTranslator({
14+
messages,
15+
localeFallbacks,
16+
});
17+
18+
export const { trans } = translator;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ux_translator:
2+
# The directory where the JavaScript translations are dumped
3+
dump_directory: '%kernel.project_dir%/var/translations'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"bundles": {
3+
"Symfony\\UX\\Translator\\UxTranslatorBundle": ["all"]
4+
},
5+
"conflict": {
6+
"symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
7+
},
8+
"copy-from-recipe": {
9+
"assets/": "assets/",
10+
"config/": "%CONFIG_DIR%/",
11+
"var/": "var/"
12+
}
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('Run bin/console cache:warmup to generate the translation files.');

0 commit comments

Comments
 (0)