-
-
Notifications
You must be signed in to change notification settings - Fork 382
Description
Hello,
I'm creating a bundle with the following assets/
directory structure:
I have manually copied translator.js from existing application code, and modified it to use different relative paths:
import { localeFallbacks } from '../../../var/translations/configuration';
import { trans, getLocale, setLocale, setLocaleFallbacks } from '@symfony/ux-translator';
setLocaleFallbacks(localeFallbacks);
export { trans };
export * from '../../../var/translations';
The paths are relative to the node_modules directory, as during yarn build
the file resides in /node_modules/@company-name/bundle-name/translator.js
. The path isn't relative to the vendor/
directory, autocomplete gets it wrong.
Is this the correct approach to use UX Translator within a bundle? Or is there a better approach? Depending on the directory structure feels brittle to me and I wasn't able to find an answer regarding this topic.
I'm creating an Issue instead asking on Stack Overflow, as I would love to see this in the official documentation.
Thanks in advance :)