Closed asirota closed 3 months ago
This is a good idea, however many or these use cases (events for example) use the title and body copy in the email macros, so all versions including the tags will be shown.
rather than use the ISO language code, we should use the class name to keep things consistent.
would this be an add-on or part of the core plugin?
Tag added as an add-on in fa490ae. Works only on event titles and descriptions.
Usage: Add [ez xxxx]
... [/ez]
tags surrounding content of a certain language. Replace xxxx
with the language class name set up in the JS settings.
Example: [ez english]English Text[/ez][ez french]French Text[/ez]
As with other add-ons, include ez-language
in the JS config to use:
ez_addons = ["ez-language"];
@asirota This is ready for review once the CORS issue has been resolved.
Can you add support for product titles and descriptions in the online store?
I noted that the maximum event title length is 80 characters, almost half of these would be used for the tags for 2 languages so you have 40 characters left for 2 event titles.
When I enter an event description like this
[ez english]May 1 2023 Tickets[/ez]
[ez french]Billets pour le 1er mai 2023[/ez]
It doesn't render either langauge.
Acually even if I enter it without the carriage returns it doesn't seem to work. Here's the example
[ez english]May 1 2023 Tickets[/ez][ez french]Billets pour le 1er mai 2023[/ez]
The content disappears and neither langauge shows.
I can't access the test site to check the events, but if you are using the latest version, it should work.
I've updated the addon to work with breadcrumbs, event titles, and event descriptions. It seems that the event title may be cached for the shopping cart and may not update without refreshing the page.
I can't access the test site to check the events, but if you are using the latest version, it should work.
I've updated the addon to work with breadcrumbs, event titles, and event descriptions. It seems that the event title may be cached for the shopping cart and may not update without refreshing the page.
Ok i am using the latest add on version now -- see the event below -- the event description doesn't render
what is the html in the event description?
Here's a test product -- note the product name disappears in French
https://newpathconsulting.wildapricot.org/Sys/Store/Products/332932
what is the html in the event description?
<p>[ez english]English Description[/ez]</p> <p>[ez french]French Description[/ez]</p>
On the confirmation page when checking out the online store the product name is not translated: https://newpathconsulting.wildapricot.org/Sys/Store/Checkout#step-3
It doesn't translate on the financial document (invoice) either:
https://newpathconsulting.wildapricot.org/Sys/FinDocument/95461420
You have an error in your french.csv which is preventing the addon from running completely.
As mentioned previously, It seems that the event title may be cached for the shopping cart and may not update without refreshing the page.
You have an error in your french.csv which is preventing the addon from running completely.
As mentioned previously, It seems that the event title may be cached for the shopping cart and may not update without refreshing the page.
I fixed the error in french.csv and it still doesn't render the event description. The online store product name still doesn't render when I hard refreshed in French.
The issue with the description is trying to account for all the ways the tags could be ordered without returning invalid html. I'll keep adjusting the regex.
As for the product listing name on the product page, this looks correct so I'm not sure what's happening. It works on my test site. (correction: not working in some places on my test site - will report back)
@asirota This is ready for testing again. I've uploaded it to https://newpathconsulting.wildapricot.org
Step 3 of the checkout may not trigger change until you refresh that page, but outside of that the titles and descriptions for events and products should change, including on the event calendar.
implemented in 2.2 as ez-language add on
It would be nice to have EZ Web Designer be able to toggle translations in the following areas:
An idea is to add a special "tag" that would rarely appear in any text that we could parse and swap like we do with .english and .french classes.
I propose a tag called [ezweb] that has a few options
[ezweb language="xx"] where xx is the official 2 letter ISO 639-1 language code
Example event name in 2 languages: [ezweb language="en"]English event name[/ezweb] [ezweb language="fr"]French event name[/ezweb]
Here's how a "description" could look in Event description
[ezweb language="en"]
Event HTML in English
[/ezweb]
[ezweb language="fr"]
Event HTML in French
[/ezweb]
[ezweb language="es"]
Event HTML in Spanish
[/ezweb]
This would eliminate the need to attach HTML classes to the code of the description.