Skip to content
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

[Bug] image src doesn't update #65

Open
michael-proulx opened this issue Sep 10, 2024 · 0 comments
Open

[Bug] image src doesn't update #65

michael-proulx opened this issue Sep 10, 2024 · 0 comments

Comments

@michael-proulx
Copy link

I added the following HTML code to implement image localization

<img alt="200k subscribers img" data-rosey-attrs-explicit='{"alt":"img-alt", "src": "img-src"}' src="https://cdnweb.devolutions.net/web/common/images/assets/mail-subscribers.png">

In the base.json, everything works fine, and I have added the corresponding translations to /locales/fr.json

{
  "pages/index:83f2d7bd-b09b-4b78-94c6-4da5d6add366:0d65b056-3e90-4d5f-a214-ce347f3aa38e:img-alt": {
    "original": "200k subscribers img",
    "value": "200k abonnés"
  },
  "pages/index:83f2d7bd-b09b-4b78-94c6-4da5d6add366:0d65b056-3e90-4d5f-a214-ce347f3aa38e:img-src": {
    "original": "https://cdnweb.devolutions.net/web/common/images/assets/mail-subscribers.png",
    "value": "https://cdnweb.devolutions.net/web/common/images/assets/mail-subscribers.fr.png"
  }
}

After running the npx rosey build command, the result is:

<img alt="200k abonnés" data-rosey-attrs-explicit='{"alt":"img-alt", "src": "img-src"}' src="https://cdnweb.devolutions.net/web/common/images/assets/mail-subscribers.png">

As you can see, the alt attribute is correctly translated, but the src attributte remains unchanged (it still points to the original image URL).

Do I need to take any additional steps for the image localization (img-src) to work correctly?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant