reddo
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Multilang - Translation and Multilingual Plugin] Gravity FormsTo anyone concerned
I’ve found the correct way to translate gravity fields:
function translate_gravity_forms( $form ) { $form['title'] = wpm_translate_string($form['title']); if ($form['description']) { $form['description'] = wpm_translate_string($form['description']); } foreach( $form['fields'] as &$field ) { $field->label = wpm_translate_string($field->label); if ($field->description) { $field->description = wpm_translate_string($field->description); } if ($field->content) { $field->content = wpm_translate_string($field->content); } if ($field->choices) { foreach( $field->choices as &$choice ) { $choice['text'] = wpm_translate_string($choice['text']); } } } return $form; } add_filter( 'gform_pre_render', 'translate_gravity_forms' );
References:
Form Object Source
Field Object SourceI do not give my consent to include this in a paid version of this plugin, but it’s ok to include it in the free version or as a standalone plugin (with attribution).
- This reply was modified 6 years, 10 months ago by reddo.
Forum: Plugins
In reply to: [WP Multilang - Translation and Multilingual Plugin] Gravity FormsAny info on this?
Forum: Plugins
In reply to: [WP Multilang - Translation and Multilingual Plugin] Gravity FormsI wrote the following function:
function translate_gravity_forms( $form ) { $form['title'] = wpm_translate_string($form['title']); if ($form['description']) { $form['description'] = wpm_translate_string($form['description']); } foreach( $form['fields'] as &$field ) { $field['label'] = wpm_translate_string($field['label']); if ($field['description']) { $field['description'] = wpm_translate_string($field['description']); } if ($field['content']) { $field['content'] = wpm_translate_string($field['content']); } if ($field['choices']) { foreach( $field['choices'] as &$choice ) { $choice['text'] = wpm_translate_string($choice['text']); } } } return $form; } add_filter( 'gform_pre_render', 'translate_gravity_forms' );
And the fields still don’t get translated. Am I using the wrong function? which one should I use?
This is getting more complicated than it needs to be ??
Forum: Plugins
In reply to: [WP Multilang - Translation and Multilingual Plugin] Gravity FormsI’ve been playing around with the plugin on a test server amd, after ironing out a few problems with migration, it doesn’t seem to work with gravity forms at all.
See this screenshot: https://goo.gl/vWU6xV
None of the (manually) translated fields get switched.
Forum: Plugins
In reply to: [WP Multilang - Translation and Multilingual Plugin] Gravity FormsThat’s the plan.
Forum: Plugins
In reply to: [WP Multilang - Translation and Multilingual Plugin] Gravity FormsCool, thanks a lot. I’m considering switching from
qtranslate-x
before it breaks the site on an update.Forum: Plugins
In reply to: [WP Multilang - Translation and Multilingual Plugin] Gravity FormsWould the manually translated fields (
[:en][:]
syntax) still work?Forum: Plugins
In reply to: [Featured Video Plus] Please remove .gitignore fileIt’s okay, I did remove it, I’d just preferred it didn’t come back. Thanks for looking into this.
Forum: Plugins
In reply to: [qTranslate X] Release 3.4.6.5 is a fixer for WP 4.5Thank you! I confirm, this really fixed my issue too. Great job!
Forum: Plugins
In reply to: [qTranslate X] Issues with WordPress 4.5I think I tracked down the issue!
I’m in the middle of re-creating the menu and I have a custom link in the menu which has a font-awesome icon markup in it’s name, like
<i class="fa fa-phone"></i>
and once I add that to the menu, it breaks the translations.Note: html elements like
<span></span>
without classes don’t break the translations. I’ve tried both single and double quotes for the class.Note 2: I’m so glad this is the 1st item in a menu with 33 items and I didn’t rebuild the whole menu before finding this.
Forum: Plugins
In reply to: [qTranslate X] Issues with WordPress 4.5I’ve increased the max_input_vars to 3000, still not saving. I’ve had WP_DEBUG on true the entire time and I have no errors like:
Warning: Input variables exceeded 1000 Warning: Invalid argument supplied for foreach() in /wp-content/plugins/qtranslate-x/admin/qtx_admin.php on line 14
I have some accent characters in the menu like ?, ?, a, ? and ?. Could those cause problems?
PS: I’ve sent the plugin to that address
Forum: Plugins
In reply to: [qTranslate X] Issues with WordPress 4.5As I said, I’ve tried deactivating all plugins and reverting back to a default theme, it still didn’t save.
The weird thing is that it’s only happening on this one multi-level menu, set as this site’s primary menu. I’ve tried other menus and even created a new menu and they all acted ok. This might be and edge case and I might get around to re-creating the entire menu, but it’s a big one, it’s got 30-ish items.
OFF TOPIC: I actually had to rewrite some of the “qTranslate Menu Item” plugin, it used deprecated functions (which i fixed by looking at the source of qtx), but the one qtx offers is different, yours has a menu item with the actual languages being sub-items, this one add only one item to the menu and it’s switching it based on what language is actually active, not showing the active language.
Forum: Plugins
In reply to: [qTranslate X] Issues with WordPress 4.5Wonder if this will affect our issues: WP Tavern: WordPress 4.5.1 Expected Early Next Week
Forum: Plugins
In reply to: [qTranslate X] Issues with WordPress 4.5I did some more testing. I disabled all plugins and activated the twentyfifteen theme. Tried translating the menu again and it still doesn’t save the translations. It just saves whatever the active language is at the time when I press the save button. I’m testing on my localhost, otherwise I’d be glad to provide you access.
Forum: Plugins
In reply to: [qTranslate X] Issues with WordPress 4.5I’ve tried disabling all the other q-translate related plugins, still not saving the translations of that particular menu.
Here’s a screenshot of my qTranslate related plugins:
https://postimg.org/image/p71g664zb/
I’m running the latest version on WP with everything up to date.