Home › Forums › Quform WordPress › Translate Form Label.
- This topic has 7 replies, 5 voices, and was last updated 5 years, 8 months ago by Ally.
- AuthorPosts
- February 15, 2017 at 4:56 pm #20810alessio.candelmaParticipant
Hi,
I read how translate the form.
But how I can translate form labels I create?If I create a form, it’s not possible translate by translating .po file.
Thanks
Alessio
February 16, 2017 at 7:20 pm #20819AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
February 23, 2017 at 9:25 am #20831VenomParticipantHi
May I know the schedule of the next major update that we can decide the approach for development.
Regards,
Venom
February 24, 2017 at 7:39 pm #20834AllanSupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 31, 2018 at 12:06 pm #24155tonitarresParticipantHi,
Is possible now, translate Labels with WPML?Thanks
February 2, 2018 at 10:13 am #24202AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 25, 2018 at 4:58 pm #26377VenomParticipantHi,
I want to propose a workaround for adding support multi language for fields or labels.
A shortcode would be created to surround the Quform that will act as global string replacement for the form before rendering at the client side. I am using WPML, therefore, I could retrieve the current language running apply_filters( ‘wpml_current_language’, NULL );
[eventitect_i18n_replace]
[quform id="XX" name="Form Name"]
[/eventitect_i18n_replace]function strip_tag($str_text, $tag){ $regex = '~\['.$tag.'[^]]*\](.+?)\[/'.$tag.'\]~'; $str_text = preg_replace($regex, '$1', $str_text); return $str_text; } function replace_tag_content($str_text, $tag, $replacement) { $reg_str = '/\['.$tag.'\](.*)\[\/'.$tag.'\]/U'; preg_match_all ($reg_str, $str_text, $pat_array); foreach($pat_array[0] as $val) { $str_text = str_replace($val,$replacement,$str_text); } return $str_text; } function eventitect_i18n_replace($atts = [], $content = null, $tag = ''){ $lang_current = apply_filters( 'wpml_current_language', NULL ); $return_string = do_shortcode($content); if($lang_current == 'zh-hant'){ $return_string = replace_tag_content($return_string , 'en', ''); $return_string = strip_tag($return_string , 'tw'); }else if($lang_current == 'en'){ $return_string = replace_tag_content($return_string , 'tw', ''); $return_string = strip_tag($return_string , 'en'); } return $return_string; } add_shortcode('eventitect_i18n_replace', 'eventitect_i18n_replace');
Would it be easier to implement this feature to the Quform for future version?
Regards,
Venom
- This reply was modified 5 years, 9 months ago by Venom.
Attachments:
You must be logged in to view attached files.August 1, 2018 at 10:41 am #26461AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.