transloco icon indicating copy to clipboard operation
transloco copied to clipboard

Bug(transloco-optimize): Translation broken in production

Open utpaulBS23 opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

  • [X] 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 🚀

utpaulBS23 avatar Jan 07 '24 09:01 utpaulBS23

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 avatar Jan 07 '24 10:01 shaharkazaz

@shaharkazaz i added expected screenshot. As i saw this issue is only fix for window. Need to fix for ubuntu as well https://github.com/ngneat/transloco/pull/687

utpaulBS23 avatar Jan 07 '24 12:01 utpaulBS23

@utpaulBS23 If you understand the issue, you are welcome to open a PR 👍

shaharkazaz avatar Jan 07 '24 13:01 shaharkazaz

@shaharkazaz i will create a demo project for that issue

utpaulBS23 avatar Jan 08 '24 05:01 utpaulBS23