mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-19 16:49:34 +00:00
* Initial plan * Create frontend translation files and update configuration Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> * Fix missing semicolon in password strength controller Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> * Remove frontend-only translations from messages domain and set frontend as default domain Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
21 lines
757 B
JavaScript
21 lines
757 B
JavaScript
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,
|
|
});
|
|
|
|
// Wrapper function with default domain set to 'frontend'
|
|
export const trans = (id, parameters = {}, domain = 'frontend', locale = null) => {
|
|
return translator.trans(id, parameters, domain, locale);
|
|
};
|