mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 15:16:30 +03:00
Add recipe for @symfony/ux-translator (#1185)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import { trans, getLocale, setLocale, setLocaleFallbacks } from '@symfony/ux-translator';
|
||||
import { localeFallbacks } from '../var/translations/configuration';
|
||||
|
||||
setLocaleFallbacks(localeFallbacks);
|
||||
|
||||
export { trans };
|
||||
export * from '../var/translations';
|
||||
@@ -0,0 +1,3 @@
|
||||
ux_translator:
|
||||
# The directory where the JavaScript translations are dumped
|
||||
dump_directory: '%kernel.project_dir%/var/translations'
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\UX\\Translator\\TranslatorBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"assets/": "assets/",
|
||||
"config/": "%CONFIG_DIR%/"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user