Bug(transloco-optimize): Translation broken in production
utpaulBS23 opened this issue · comments
Is there an existing issue for this?
- I have searched the existing issues
Which Transloco package(s) are the source of the bug?
Optimize
Is this a regression?
Yes
Current behavior
I pass configuration
{
availableLangs: [
{ id: 'en', label: 'English' },
{ id: 'nb', label: 'Norwegian' }
],
defaultLang: 'en',
fallbackLang: 'en',
reRenderOnLangChange: true,
prodMode: true,
flatten: {
aot: !isDevMode()
}
}
}
And install optimize plugin and added script on package.json
"transloco:optimize": "transloco-optimize dist/wellbook/assets/i18n",
"build:prod": "ng build --configuration production && npm run transloco:optimize",
But still i get broken translation issue. I attach screen shot here
![Screenshot 2024-01-07 at 3 32 09 PM](https://private-user-images.githubusercontent.com/56062199/294749429-5bcba3ea-b7aa-41b4-a61c-3d9b878449aa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNDIyNjgsIm5iZiI6MTcyMTI0MTk2OCwicGF0aCI6Ii81NjA2MjE5OS8yOTQ3NDk0MjktNWJjYmEzZWEtYjdhYS00MWI0LWE2MWMtM2Q5Yjg3ODQ0OWFhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDE4NDYwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIzMjQ0ZjQ4MjQ1YzBlNmFkYjZkOThjOTQ4ZTQ3NzlhOThmZThkYmJmZTkzMTE5ZmM2NzBlNDVhZGZlNzg1NzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1IXkDCn9ClW0amOS_ke68_5HMyV0Rq9ujiCLyBcXAr8)
Expected behavior
Should be load translation as i share on menu
Should be work on production
Please provide a link to a minimal reproduction of the bug, if you won't provide a link the issue won't be handled.
Just have that conent
Transloco Config
{
availableLangs: [
{ id: 'en', label: 'English' },
{ id: 'nb', label: 'Norwegian' }
],
defaultLang: 'en',
fallbackLang: 'en',
reRenderOnLangChange: true,
prodMode: true,
flatten: {
aot: !isDevMode()
}
}
}
Please provide the environment you discovered this bug in
Transloco: 6.0.4
Angular: 16.2.0
Node: v18.17.0
Package Manager: NPM
OS: ubuntu-latest
Browser
Chrome
No response
Additional context
No response
I would like to make a pull request for this bug
Yes 🚀
This is a very general issue.
Please provide a reproduction link as requested when opening an issue, IDK what I should see in this screenshot
Please share a before & after example.
@shaharkazaz i added expected screenshot. As i saw this issue is only fix for window. Need to fix for ubuntu as well
#687
@utpaulBS23 If you understand the issue, you are welcome to open a PR 👍
@shaharkazaz i will create a demo project for that issue