jsverse / transloco

🚀 😍 The internationalization (i18n) library for Angular

Home Page:https://jsverse.github.io/transloco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Expected behavior

Should be load translation as i share on menu
Screenshot 2024-01-07 at 6 39 31 PM

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