The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Translation for lab...
 
Share:
Notifications
Clear all

[Solved] Translation for labels "Post Comment" and "COMMENTS" on frontend

2 Posts
2 Users
0 Reactions
8,700 Views
Posts: 1
Topic starter
(@osmanybg84)
New Member
Joined: 4 years ago

I translated wpdiscuz using PO files and loco translate plugin. The result can bee seen on the 1st attachment "before.png": I could translate almost everything except for the labels "Post Comment" and "COMMENTS".

I made two changes adding two call the __() function on the followind files:

1- /wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/DefaultField/Submit.php - ln:100

from: <input id="wpd-field-submit-<?php echo esc_attr($uniqueId); ?>" class="wc_comm_submit wpd_not_clicked wpd-prim-button" type="submit" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($args["name"]); ?>" />

to: <input id="wpd-field-submit-<?php echo esc_attr($uniqueId); ?>" class="wc_comm_submit wpd_not_clicked wpd-prim-button" type="submit" name="<?php echo esc_attr($name); ?>" value="<?php echo __(esc_attr($args["name"])); ?>" />

 

2- /home1/cronicas/public_html/wp-content/plugins/wpdiscuz/themes/default/comment-form.php - ln:333

from: echo "<span class='wpdtc'>" . esc_html($commentsCount) . "</span> " . esc_html(1 == $commentsCount ? $form->getHeaderTextSingle() : $form->getHeaderTextPlural());

to: echo "<span class='wpdtc'>" . esc_html($commentsCount) . "</span> " . __(esc_html(1 == $commentsCount ? $form->getHeaderTextSingle() : $form->getHeaderTextPlural()));

 

After these changes the labels were successfully transtaled as shown int he 2nd image "after.png".

Maybe these changes can be applied on the next update or somewhere else if the texts on those points were expected to be already translated.

1 Reply
Asti
Posts: 7661
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

Hi @osmanybg84,

Please navigate to Dashboard > wpDiscuz > Forms admin page, edit the Default Form, then find and edit the "Post Comment (Submit Button)" button and change the value of the "Name" field. More info here:  https://wpdiscuz.com/docs/wpdiscuz-documentation/getting-started/custom-comment-form/comment-form-builder/#edit_and_delete_fields

On the same page find the following two fields and change the values as you like:

  • Comment form header text (singular)
  • Comment form header text (plural)

More info here: https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment_form_header_text

Share: