Skip to content

Commit 363aa94

Browse files
authored
Add recipe for @symfony/ux-translator (#1185)
1 parent 41d2cf1 commit 363aa94

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is part of the Symfony UX Translator package.
3+
*
4+
* If folder "../var/translations" does not exist, or some translations are missing,
5+
* you must warmup your Symfony cache to refresh JavaScript translations.
6+
*
7+
* If you use TypeScript, you can rename this file to "translator.ts" to take advantage of types checking.
8+
*/
9+
10+
import { trans, getLocale, setLocale, setLocaleFallbacks } from '@symfony/ux-translator';
11+
import { localeFallbacks } from '../var/translations/configuration';
12+
13+
setLocaleFallbacks(localeFallbacks);
14+
15+
export { trans };
16+
export * from '../var/translations';
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"bundles": {
3+
"Symfony\\UX\\Translator\\TranslatorBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"assets/": "assets/",
7+
"config/": "%CONFIG_DIR%/"
8+
}
9+
}

0 commit comments

Comments
 (0)