longbuxu
Forum Replies Created
-
I can confirm it works! I’d like to write the steps here for anyone searching for this:
My site is: http://www.examplesite1.com
Plugins: megaform, translatePress with English, and Spanish activated.
In Megaform, create a New Form:
+ Add Hidden field:
Field Label: language
Default value: click on 3 dots, choose WordPress, choose Site URL, this value will show as {mf:wp site_url}.
+ Then add a One Line Text field, for example:
Field Label: Nombre
Advanced: turn on Conditional Logic, Show this field if:
language | Contains | /es
Then embed this form into a page with shortcode [megaforms id=1].
Browse to the site: http://www.examplesite1.com. Nombre field will not show, default language is English, the Site URL being “www.examplesite1.com”, which doesn’t contain “/es” in it.
Choose language from switcher to Spanish, the site URL ow will be “www.examplesite1.com/es/”, which contains “/es” in it, then this Nombre field will show up.
This will only work with a proper Permalinks which show /es in its URL.
It can be confused if the Site URL contains another string /es which isn’t related to Spanish language. For example, it the site URL, in English, is “www.examplesite1.com/how-to20%-study-20%/espanol-in-free-time/”, this Nombre field will show up, because Site URL contains the string “/es”.
- This reply was modified 1 year, 2 months ago by longbuxu.
Thank you for the workaround idea.