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

Language not working in widgets #616

Closed
hubosh opened this issue Nov 20, 2018 · 19 comments
Closed

Language not working in widgets #616

hubosh opened this issue Nov 20, 2018 · 19 comments
Labels
bug Something isn't working, reproducible severity: major Major functionality

Comments

@hubosh
Copy link

hubosh commented Nov 20, 2018

I just started using qTranslate XT and I was hoping for a fix to this problem.
When using text in a widget I can't change the languages, it just copies the last data I entered and stores it in all language tabs.

@herrvigg
Copy link
Collaborator

Can you give more details about this problem? I guess you are referring to switching tabs but i can't see in which context. The widgets in the sense "qtranslate Widget" are meant to change language on the front-end so there's no data to enter there. So i suppose it's an admin page but which one? A screenshot could also help.

@herrvigg herrvigg added the need info The submitter must provide more info label Nov 20, 2018
@herrvigg
Copy link
Collaborator

About the widget admin menu, the only translatable field is the title and this works fine for me.

image

@hubosh
Copy link
Author

hubosh commented Nov 20, 2018

Can you give more details about this problem? I guess you are referring to switching tabs but i can't see in which context. The widgets in the sense "qtranslate Widget" are meant to change language on the front-end so there's no data to enter there. So i suppose it's an admin page but which one? A screenshot could also help.

What I meant is when I use text in a widget, I can't translate it, not even the title.
Here's a screenshot
screenshot 2

@forexmd
Copy link

forexmd commented Nov 20, 2018

I also have problem with translating widgets, on old qtranslate-x and the same on qtranslate-xt , which i just installed. When i save some text on one language immediately appears the same text for the second language. Do you have any idea how to make it work normal. Website forex.md . Thanks

@herrvigg
Copy link
Collaborator

OK now i see, i can reproduce the problem. The input and textarea fields don't have the blue marker, which means they are not considered as translatable but i guess they are supposed to be part of those. I tried quickly to update the json config but it didn't work. I'll see if i manage to fix it.

@forexmd
Copy link

forexmd commented Nov 20, 2018

whatever it is worth, the problem is only on the latest version of WP. With previous version of WP, was no problem, i have always made changes in footer/widgets before and had no problems with that.

@herrvigg
Copy link
Collaborator

Oh i thought it was a much older problem.
If you look into i18n-config.json the selectors are input[id^='widget-'][id$='-title'] and textarea[id^='widget-text-'][id$='-text'] but this does not hold anymore. I tried other selectors simply with input.title and textarea.text but it doesn't work. At least we know the widget-right selector works as the switching tabs are shown.
Also i'm not sure why there are some similar selectors in widgets-exec.js, i thought this was supposed to be done with the json file only. If someone finds a solution let me know.

@herrvigg
Copy link
Collaborator

Mmmm this looks more problematic than it first appeared. All these elements are created dynamically under div.text-widget-fields which does not exist when the page is loaded... but only when the drop down button is clicked.

I don't think such behavior exists in any other UI element. Technically it should still be possible but it becomes more complex and i'm not sure what is the best solution. Any suggestion welcome.

@herrvigg herrvigg added help wanted Extra attention is needed bug Something isn't working, reproducible and removed need info The submitter must provide more info labels Nov 21, 2018
@herrvigg
Copy link
Collaborator

I found more info about the underlying changes. It came with WP 4.8 (May 2017!) so that's not really new but no qTranslate handles this yet.

https://make.wordpress.org/core/2017/05/23/addition-of-tinymce-to-the-text-widget/

Since the new Widget is using TinyMCE it should be possible to make it work as for the Classic Editor. But i don't know yet how to do so properly.

@forexmd
Copy link

forexmd commented Nov 29, 2018

@herrvigg thanks for help. It took me a lot of time to realize that the problem was in my .htaccess file, there has been added a command .
Header set Referrer-Policy "origin"
and for some reason this command brought up the issue. I removed it and work like a charm. Unfortunately I still cant use the qtranslate-xt because it does not integrates with Yoast SEO (with plugin, Yoast SEO & qTranslate-X). Hope will have in near future

@herrvigg
Copy link
Collaborator

Mmm now i'm quite confused. Good if this solved something but i'm not sure we talk about the same things. Imo there is still a problem. How can the new text widget work? How is the translation managed in the edit boxes? Do you have the blue line on the left side of the title and the content?

@hubosh
Copy link
Author

hubosh commented Dec 9, 2018

I found more info about the underlying changes. It came with WP 4.8 (May 2017!) so that's not really new but no qTranslate handles this yet.

https://make.wordpress.org/core/2017/05/23/addition-of-tinymce-to-the-text-widget/

Since the new Widget is using TinyMCE it should be possible to make it work as for the Classic Editor. But i don't know yet how to do so properly.

Yeah it's an old issue with qTranslate X, I once found a solution that includes downloading a plugin called Classic Text Widget. hope that can help.
Thanks for your amazing effort.

@dreamliner789
Copy link

I installed today the new translate-xt.
It seems to work wonderful and fine. Thanks to all who work on that helpful plugin.

But the bug with the widget translation is not solved in my case.
I tried to handle it with the recommended "Classic Text Widget" but that doesn't show me the true text in backend and doesn't works with html code.
The lines with header and policy is not written in my htaccess.

Did someone made the same experience and could solve this issue?
Thanks for any help and recommedations.

@herrvigg
Copy link
Collaborator

herrvigg commented May 3, 2020

Here also i'm a bit lost with all the different widgets and screens. What is this issue exactly about?

  • It seems the widget works when used from /wp-admin/widgets.php
  • but not from /wp-admin/customize.php

Is that the problem raised here? Is it for any widget or for a specific plugin?

@forexmd
Copy link

forexmd commented Nov 20, 2020 via email

@herrvigg herrvigg added severity: major Major functionality and removed bug Something isn't working, reproducible labels Apr 24, 2021
@herrvigg herrvigg added the bug Something isn't working, reproducible label May 9, 2021
@herrvigg
Copy link
Collaborator

Finally, a new solution to fix the text widget is now made available by #1042.

@Hr0bar
Copy link

Hr0bar commented Jun 26, 2021 via email

@herrvigg
Copy link
Collaborator

herrvigg commented Aug 4, 2021

Merged in master for testing.

@herrvigg
Copy link
Collaborator

Released in 3.11.0.

@herrvigg herrvigg removed the help wanted Extra attention is needed label Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, reproducible severity: major Major functionality
Projects
None yet
Development

No branches or pull requests

5 participants