jfwiebe / pretix-wp-plugin

Plugin to integrate a pretix ticketing system into a Wordpress page
Apache License 2.0
7 stars 2 forks source link

Multi-language support not working in WordPress widget #7

Open johannesmirus opened 6 years ago

johannesmirus commented 6 years ago

When using more than one language in Pretix, the WordPress widget won't work. I assume the reason is an added language selector in the script name which I can see when generating the widget code via Pretix:

English version: German version:

jfwiebe commented 6 years ago

Hi Johannes, you are right. As I discussed with the pretix-maintainer in #1, this is based on the fact that there is a global js-file for all pages / languages. We would need to detect what language the wordpress-page is in and change the js-language accordingly. What happens, if the event is not enabled for a certain language of the website? etc...

saschafoerster commented 6 years ago

In our example we have different pages per language like www.site.de/ticket and www.site.de/en/ticket. Because the .js-files are saved for the plugin, it is not possible to choose. If we could add the different .js-lines in the shortcode itself, everything could work out, I guess. Because then we decide which language will be chosen (and can be offered) at which place.

jfwiebe commented 6 years ago

Yeha right, but the shortcode is evaluated after the script-tag insertion, so it is not possible to have the scripts set within a short code, unfortunately...

saschafoerster commented 6 years ago

How about adding several scripts in the backend, at least two? :)