- This topic has 9 replies, 3 voices, and was last updated 4 years, 6 months ago by Tom.
-
AuthorPosts
-
October 15, 2019 at 2:25 am #1034965sirlouen
Hello
How can I translate this string? (READ MORE LABEL)October 15, 2019 at 7:51 am #1035311DavidStaffCustomer SupportHi there,
is the Site Multi Lingual ?
If so the string should be automatically translated.October 15, 2019 at 9:25 am #1035428sirlouenYes, It’s multilingual
https://theworldmarch.org/noticiasAs you can see it’s not translated into Spanish the “READ MORE” buttons.
Neither to ItalianOctober 15, 2019 at 6:22 pm #1035773TomLead DeveloperLead DeveloperHi there,
Which plugin are you using to translate your site?
October 16, 2019 at 1:25 am #1035931sirlouen@Tom Polylang
October 16, 2019 at 10:29 am #1036488TomLead DeveloperLead DeveloperHmm, it should work by default as we have a
wpml-config.xml
file which lists that option as translatable.You could try something like this:
add_action( 'init', function() { if ( function_exists( 'pll_register_string' ) ) { pll_register_string( 'gp-premium', 'Read more' ); } } ); add_filter( 'option_generate_blog_settings', function( $options ) { if ( function_exists( 'pll__' ) ) { $options['read_more'] = pll__( 'Read more' ); } return $options; } );
October 16, 2019 at 10:32 am #1036491sirlouenI think the problem is that the label is displayed under the customization options. Is not an static label. I think the “Read more” you are talking about is a different Read more.
Theorically If I override the text is the customizer, then it will appear that text unconditionally (regardless of the language)
But if I leave it empty the button just not appears.
October 16, 2019 at 11:14 am #1036531sirlouenOk, I think I’ve found the issue
wp-content/plugins/gp-premium/langs# ls
gp-premium-cs_CZ.mo gp-premium-da_DK.po gp-premium-fr_FR.mo gp-premium-it_IT.po gp-premium.pot gp-premium-pt_PT.mo gp-premium-ru_RU.po gp-premium-sv_SE.mo gp-premium-zh_CN.po
gp-premium-cs_CZ.po gp-premium-de_DE.mo gp-premium-fr_FR.po gp-premium-pl_PL.mo gp-premium-pt_BR.mo gp-premium-pt_PT.po gp-premium-sk_SK.mo gp-premium-sv_SE.po
gp-premium-da_DK.mo gp-premium-de_De.po gp-premium-it_IT.mo gp-premium-pl_PL.po gp-premium-pt_BR.po gp-premium-ru_RU.mo gp-premium-sk_SK.po gp-premium-zh_CN.moThere are no es_ES or it_IT translations there !
October 16, 2019 at 12:41 pm #1036603sirloueniT is there but no translations (i’ve put it to test it , but doesn’t work either)
https://theworldmarch.org/it/notizie/I’ve modified the blog/functions/generate-blog.php
And now it works fine the translation. Obviously, this is not a great tweak…
October 16, 2019 at 9:20 pm #1036845TomLead DeveloperLead DeveloperThe code I provided above should achieve something very similar to the change you made in
generate-blog.php
.Doing this is the exact same thing, but without altering the plugin:
add_filter( 'option_generate_blog_settings', function( $options ) { $options['read_more'] = __( 'Read more', 'gp-premium' ); return $options; } );
-
AuthorPosts
- You must be logged in to reply to this topic.