-
-
Notifications
You must be signed in to change notification settings - Fork 503
[UXTranslator] Add recipe for 2.32 #1498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. symfony/ux-translator2.8 vs 2.9diff --git a/symfony/ux-translator/2.8/assets/translator.js b/symfony/ux-translator/2.9/assets/translator.js
index eab7b6c7..28012a65 100644
--- a/symfony/ux-translator/2.8/assets/translator.js
+++ b/symfony/ux-translator/2.9/assets/translator.js
@@ -1,3 +1,4 @@
+import { trans, getLocale, setLocale, setLocaleFallbacks } from '@symfony/ux-translator';
/*
* This file is part of the Symfony UX Translator package.
*
@@ -7,10 +8,6 @@
* 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';
diff --git a/symfony/ux-translator/2.8/manifest.json b/symfony/ux-translator/2.9/manifest.json
index 3f984fca..a1ac08ba 100644
--- a/symfony/ux-translator/2.8/manifest.json
+++ b/symfony/ux-translator/2.9/manifest.json
@@ -2,8 +2,38 @@
"bundles": {
"Symfony\\UX\\Translator\\UxTranslatorBundle": ["all"]
},
+ "conflict": {
+ "symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
+ },
"copy-from-recipe": {
"assets/": "assets/",
- "config/": "%CONFIG_DIR%/"
- }
+ "config/": "%CONFIG_DIR%/",
+ "var/": "var/"
+ },
+ "add-lines": [
+ {
+ "file": "assets/translator.js",
+ "content": "import { localeFallbacks } from '../var/translations/configuration';",
+ "position": "top",
+ "requires": "symfony/webpack-encore-bundle"
+ },
+ {
+ "file": "assets/translator.js",
+ "content": "import { localeFallbacks } from '@app/translations/configuration';",
+ "position": "top",
+ "requires": "symfony/asset-mapper"
+ },
+ {
+ "file": "assets/translator.js",
+ "content": "export * from '../var/translations';",
+ "position": "bottom",
+ "requires": "symfony/webpack-encore-bundle"
+ },
+ {
+ "file": "assets/translator.js",
+ "content": "export * from '@app/translations';",
+ "position": "bottom",
+ "requires": "symfony/asset-mapper"
+ }
+ ]
}
diff --git a/symfony/ux-translator/2.9/var/translations/configuration.js b/symfony/ux-translator/2.9/var/translations/configuration.js
new file mode 100644
index 00000000..bea96d63
--- /dev/null
+++ b/symfony/ux-translator/2.9/var/translations/configuration.js
@@ -0,0 +1,3 @@
+export const localeFallbacks = {};
+
+console.log('Run bin/console cache:warmup to generate the translation files.');
diff --git a/symfony/ux-translator/2.9/var/translations/index.js b/symfony/ux-translator/2.9/var/translations/index.js
new file mode 100644
index 00000000..34f7c1ba
--- /dev/null
+++ b/symfony/ux-translator/2.9/var/translations/index.js
@@ -0,0 +1 @@
+console.log('Run bin/console cache:warmup to generate the translation files.');2.9 vs 2.32diff --git a/symfony/ux-translator/2.9/assets/translator.js b/symfony/ux-translator/2.32/assets/translator.js
index 28012a65..a0181a08 100644
--- a/symfony/ux-translator/2.9/assets/translator.js
+++ b/symfony/ux-translator/2.32/assets/translator.js
@@ -1,4 +1,6 @@
-import { trans, getLocale, setLocale, setLocaleFallbacks } from '@symfony/ux-translator';
+import { createTranslator } from '@symfony/ux-translator';
+import { messages, localeFallbacks } from '../var/translations/index.js';
+
/*
* This file is part of the Symfony UX Translator package.
*
@@ -8,6 +10,9 @@ import { trans, getLocale, setLocale, setLocaleFallbacks } from '@symfony/ux-tra
* If you use TypeScript, you can rename this file to "translator.ts" to take advantage of types checking.
*/
-setLocaleFallbacks(localeFallbacks);
+const translator = createTranslator({
+ messages,
+ localeFallbacks,
+});
-export { trans };
+export const { trans } = translator;
diff --git a/symfony/ux-translator/2.9/manifest.json b/symfony/ux-translator/2.32/manifest.json
index a1ac08ba..5af38680 100644
--- a/symfony/ux-translator/2.9/manifest.json
+++ b/symfony/ux-translator/2.32/manifest.json
@@ -9,31 +9,5 @@
"assets/": "assets/",
"config/": "%CONFIG_DIR%/",
"var/": "var/"
- },
- "add-lines": [
- {
- "file": "assets/translator.js",
- "content": "import { localeFallbacks } from '../var/translations/configuration';",
- "position": "top",
- "requires": "symfony/webpack-encore-bundle"
- },
- {
- "file": "assets/translator.js",
- "content": "import { localeFallbacks } from '@app/translations/configuration';",
- "position": "top",
- "requires": "symfony/asset-mapper"
- },
- {
- "file": "assets/translator.js",
- "content": "export * from '../var/translations';",
- "position": "bottom",
- "requires": "symfony/webpack-encore-bundle"
- },
- {
- "file": "assets/translator.js",
- "content": "export * from '@app/translations';",
- "position": "bottom",
- "requires": "symfony/asset-mapper"
- }
- ]
+ }
}
diff --git a/symfony/ux-translator/2.9/var/translations/configuration.js b/symfony/ux-translator/2.9/var/translations/configuration.js
deleted file mode 100644
index bea96d63..00000000
--- a/symfony/ux-translator/2.9/var/translations/configuration.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export const localeFallbacks = {};
-
-console.log('Run bin/console cache:warmup to generate the translation files.'); |
fabpot
approved these changes
Dec 5, 2025
fabpot
approved these changes
Dec 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to symfony/ux#3208