Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Translate Neighborhood theme from english to german by .mo and .po file
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Translate Neighborhood theme from english to german by .mo and .po file
- This topic has 39 replies, 2 voices, and was last updated 7 years by Mohammad – SUPPORT.
-
Posted in: Neighborhood
-
September 8, 2016 at 8:30 am #291027
Hi,
Its ok.
Thanks
MohammadSeptember 10, 2016 at 3:02 pm #291337Dear Support,
Thanks most english words are translated to german… only “Add to shopping bag” is still in english.
I checked the .po file and found that it is already translated but it doesn’t work.
Best regards
Attachments:
You must be logged in to view attached files.September 12, 2016 at 6:29 am #291391Hi,
Please paste this code at functions.php of child theme.add_filter( 'gettext', 'sf_string_translate', 20, 3 ); function sf_string_translate( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'Name' : $translated_text = __( 'Add to Shopping Bag', 'Change Me' ); //just change it. break; } return $translated_text; }
Thanks
MohammadSeptember 12, 2016 at 3:21 pm #291550Dear Mohammad,
Thank you for your reply!
I paste this code into my functions.php. But it doesn’t work. I am sure I did something wrong, could you check it, please?
See at the attachment, there is my improved functions.php file.
My second problem is that I want to change the Text “Have a coupon…” in 1.phg. I think I can easily to this by changing the translation in the .po file (Look 2.png).
How can I do this?
Here is my functions.php:
<?php
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );}
load_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/language’ );
function sf_child_theme_locale() {
//echo get_stylesheet_directory() . ‘/language’ ;exit;
//load_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/language’ );
load_child_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/language’ );
}
//add_action( ‘init’, ‘sf_child_theme_locale’ );
}
add_filter( ‘gettext’, ‘sf_string_translate’, 20, 3 );
function sf_string_translate( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case ‘Name’ :
$translated_text = __( ‚Add to Shopping Bag‚, ‚In den Warenkorb legen‚ ); //just change it.
break;
}
return $translated_text;
}
?>Best regards, Jan
Attachments:
You must be logged in to view attached files.September 13, 2016 at 3:09 pm #291694Dear Mohammad,
Please, reply. I need your help….
September 13, 2016 at 5:46 pm #291711Hi,
I have managed to resolve the issue so please check it now.
Thanks
MohammadSeptember 14, 2016 at 8:47 am #291768Hi,
I have finally resolved it so please check it now.
Thanks
MohammadSeptember 14, 2016 at 5:52 pm #291858Dear Mohammad,
Sure?
Please, IMPROVE
Regards
Attachments:
You must be logged in to view attached files.September 14, 2016 at 5:58 pm #291861Dear Mohammad,
Just changed ‘ Change me ‘ and now it work perfectly :’D
Thanks!!!!
September 14, 2016 at 5:59 pm #291862Hi,
Just replace the Change me with your text string in functions.php of child theme.
Thanks
Mohammad -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.