Change language on on blog page?

dragana
74 Posts
dragana posted this 07 February 2021

How do I change the [comment] on blog page?

How do I change the [comment] on blog page?

Last edited 07 February 2021 by dragana

Vote to pay developers attention to this features or issue.
7 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 08 February 2021

Hello Dragana,

If this word is not listed in translation file or setting in the language plugin you use, you can try adding this code via Themler -> Home -> Settings -> CMS Code:

add_filter( 'gettext', 'wps_translate_words_array' );
add_filter( 'ngettext', 'wps_translate_words_array' );
function wps_translate_words_array( $translated ) {
$words = array(
// 'word to translate' = > 'translation'
'comment' => 'yourtranslation',
'Comment' => 'Yourtranslation',
);
$translated = str_ireplace( array_keys($words), $words, $translated );
return $translated;
}

Where you need to replace yourtranslation with the correct word.

Gina
Themler Support

Hello Dragana, If this word is not listed in translation file or setting in the language plugin you use, you can try adding this code via Themler -> Home -> Settings -> CMS Code: add_filter( 'gettext', 'wps_translate_words_array' ); add_filter( 'ngettext', 'wps_translate_words_array' ); function wps_translate_words_array( $translated ) { $words = array( // 'word to translate' = > 'translation' 'comment' => 'yourtranslation', 'Comment' => 'Yourtranslation', ); $translated = str_ireplace( array_keys($words), $words, $translated ); return $translated; } Where you need to replace yourtranslation with the correct word. Gina Themler Support
dragana
74 Posts
dragana posted this 08 February 2021

It totally messed up my site. All I now see is: Parse error: syntax error, unexpected end of file in /home/desincse/kristensresa.se/wp-content/themes/Untitled/functions-additional.php on line 14

I can't even log in anymore...

Edit: Got it to work. Did it directly via ftp.

However, it doesn't work. I also need "Leave a" to be translated.

It totally messed up my site. All I now see is: Parse error: syntax error, unexpected end of file in /home/desincse/kristensresa.se/wp-content/themes/Untitled/functions-additional.php on line 14 I can't even log in anymore... Edit: Got it to work. Did it directly via ftp. However, it doesn't work. I also need "Leave a" to be translated.

Last edited 08 February 2021 by dragana

Support Team
Support Team posted this 08 February 2021

What is your WP version?
Could you please try to add the code to functions.php directly?

Gina
Themler Support

What is your WP version? Could you please try to add the code to functions.php directly? Gina Themler Support
dragana
74 Posts
dragana posted this 08 February 2021

Just anywhere in functions.php?

Just anywhere in functions.php?
Support Team
Support Team posted this 09 February 2021

You can add it to the end of the file.

Gina
Themler Support

You can add it to the end of the file. Gina Themler Support
dragana
74 Posts
dragana posted this 14 February 2021

Ok, I didn't do that yet. But now when I opened themler in wordpress I got this message: 'syntax error, unexpected end of file - WordPress'.
And that's all I see. I'm supposed to see first page.

Ok, I didn't do that yet. But now when I opened themler in wordpress I got this message: 'syntax error, unexpected end of file - WordPress'. And that's all I see. I'm supposed to see first page.

Last edited 14 February 2021 by dragana

Support Team
Support Team posted this 15 February 2021

Remove the code added previously to functions-additional.php file via FTP.
I am waiting on the reply from the developers about the translation.

If you switch to standard WP theme, do all of the words get translated?

Gina
Themler Support

Remove the code added previously to functions-additional.php file via FTP. I am waiting on the reply from the developers about the translation. If you switch to standard WP theme, do all of the words get translated? Gina Themler Support
You must log in or register to leave comments