oferwald / transposh

Repository for Transposh git
GNU General Public License v3.0
13 stars 6 forks source link

Not seeing frontend translation dialog #3

Open dleigh opened 2 years ago

dleigh commented 2 years ago

Hi Ofer, On https://jem-cevennes.com, I'm not seeing the frontend translation dialog when I choose to edit the translation on a default language page. French is the default language and I have "Allow translation of default language" checked, and I'm trying to edit a page that's in French. The dialog DOES show up on English pages (NOT the default language).

I'm signed in as an admin and I have the "Edit translation" checkbox. When I check it, it refreshes the page and adds "?tpedit=1" to the URL. In the dev tools (Firefox), there are no errors in the console and in the network tab, both the tranposh.js?ver=1.0.9.3 and transposhedit.js GETs have a return code of 200. So it looks like everything should be functioning. The site is running on the OceanWP theme (child-theme) and uses Elementor as a page builder.

I've gone through all the settings, but I can't help but think I'm missing something obvious.

Any ideas? Thanks, David

dleigh commented 1 year ago

Hi Ofer, I'm having the same problem on https://mathurincordier.fr. Default language=French and logged in as admin, default language translation allowed is checked. No translation dialog box. No edit tick box. Other languages work fine.

Don't know how I solved it on this other site so any insight would be helpful! Thanks! David

oferwald commented 10 months ago

Hi,

I am sorry it took me so long to answer your issue here. I assume that you used your own widget, so the ticking checkbox was not available, the trick is to simply add the parameter "tpedit=1" to the end of whatever url you want to enable editing for, assuming you are logged in as a user with sufficient translation permissions,

Good luck,

dleigh commented 10 months ago

@oferwald Unfortunately that does NOT solve the problem on https://mathurincordier.fr.

oferwald commented 10 months ago

Hi @dleigh ,please provide the following information when you have the tpedit parameter in your url:

  1. do you see the transposh translation spans in view source for the page?
  2. do you see any errors in the javascript console of your browser?
dleigh commented 10 months ago

This shows that French is the default language 2024-01-22 16_51_17-Languages _ Transposh ‹ Réseau Mathurin Cordier — WordPress — Mozilla Firefox

This shows that I have the parameter selected to be able to translate the default language: 2024-01-22 16_51_49-Settings _ Transposh ‹ Réseau Mathurin Cordier — WordPress — Mozilla Firefox

This shows the "Edit" llink for English version of the page: 2024-01-22 16_52_45-

This shows the correct functioning of the English page: 2024-01-22 16_53_07-Home - Mathurin Cordier Network — Mozilla Firefox

This shows the correct markup for the English page: 2024-01-22 16_54_17-Home - Mathurin Cordier Network — Mozilla Firefox

This shows the console errors on the correct functioning English page: 2024-01-22 17_42_25-Developer Tools — Home - Mathurin Cordier Network — https___mathurincordier fr_e 8-8b8a-9facba96372e)

This shows the default language French page that does NOT show an edit link under the language flags: 2024-01-22 16_56_34-Accueil - Réseau Mathurin Cordier — Mozilla Firefox

This shows that with the tpedit query parameter on the default language, there are no links for editing added: 2024-01-22 16_57_01-

This shows that the transposh editing spans are not added for the default language: 2024-01-22 16_57_42-

This shows the error messages in the console for the default language 2024-01-22 17_41_17-C__Users_david_Documents_Website Work_RMC-Réseau Mathurin Cordier

The console errors are basically the same except there is one more error for the correct-functioning English page.

oferwald commented 10 months ago

Finally understood you, you know the saying - when you explain slowly, I will understand quickly.

The reason that you see nothing when translate in default language is enabled, is probably a misunderstanding about what that feature really is. The feature allows you to translate non-default language blocks on your default language.

An example for that would be a comment posted in your site where the language was English, and now you are looking at it in the French language, so it is translated from English to French.

It is possible to get the effect that you wanted, although I am not sure it will be what you wished for. What you will need to do is to do a dummy wrapping of your content, by using a (yes, XX, don't replace it) tag to wrap the content you wish that will be "Translatable" on your default page.

There is normally no reason to do that, because the original content may simply be changed, and it does not need to be translated.

LMK

dleigh commented 10 months ago

Ah - thanks for the explanation. That helps. To restate, it's about Transposh doing the translation of these non-standard blocks, NOT about facilitating the EDIT of those translations - do I have that right?

oferwald commented 10 months ago

Yes, you have that right, but naturally, you can not edit that which was never translated.