simoptimtheme
asked 10 years ago

Hello,
i have some problems to translate the dw-minion theme. There is no language file?
Then i used Loco Translate and changed something into my language (i used “1 Comment” to test it. But it changed northing on my blog.
 
Hope you can help me.
Greetings.

5 Answers
DominicStaff
answered 10 years ago

To translate the DW Minion theme, you can use the qtranslate plugin. Please find the plugin here: http://wordpress.org/plugins/qtranslate/
Please try and let us know if it works for you.

simoptimtheme
replied 10 years ago

Hey Dominic, thanks for answer.
This plugin didnt work for me.
When i activated it, it crashed my “date” text in the blog into this for example:

%A, 30UTCWed, 30 Oct 2013 12:34:42 +0000 %e. %B %Y 1 Comment

DominicStaff
answered 10 years ago

To change the date in your site, You can log in to Dashboard > Setting > General Setting.
See the Screenshot:

simoptimtheme
answered 10 years ago

Thanks for answer. Got it.
But there are some none translated words left.
For example:
“Continue Reading”, “X Comments” or “By Authorname
In the german .po file in my language folder, there is everything translated.
Hope you can help me.
Greetings.

DominicStaff
answered 10 years ago

Hi Simoptimtheme !
If you want to translate the “Continue Reading”, “X Comments” or “By Authorname” in the DW Minion, Please do as the following:
+ Continue Reading : You can open the content.php file, find the line 10.
+ X Comments :  Please open the template-tags.php file, find the line 147.
+ By Authorname : Please open the template-tags.php file, find the line 108.
Hope this helps !

simoptimtheme
replied 10 years ago

Thanks for your help. It took a while, till i answer to this. I changed the words in this files but the changes in the “templae-tags.php” didnt work.
Im using a child theme, created a folder called “inc” and put the edited templates-tags.php into it. But the two things didnt changed.

Dominic Staff
replied 10 years ago

Hi,
Please do as the following:
+ X Comments : Please open the template-tags.php file in the folder path “wp-content\themes\dw-minion\inc”, find the line 118.
+ By Authorname : Please open the template-tags.php file in the folder path “wp-content\themes\dw-minion\inc”, find the line 86
If you still face the issue, please send me your FTP (via private answer) for further checking.
Regards,

Camille F.
answered 10 years ago

Hi Dominic, there are a few texts for which I cannot find where to translate them in the php files:
– for the comments at the bottom of an article, where can I translate the button “Post comment” + where can I translate the text fields (name, email, website, comment)
– the text in the search field “search” ?
– in the widget Last comments, I’d like to translate “on” (xxx on article X)
 
Thanks in advance!

DominicStaff
answered 10 years ago

–  button “Post comment”.
By default the comment form creates its submit button. There is no filter or action to change or remove it. But we can hide it using CSS and create a new one by hooking to other action. Please add the following code to the function.php file in the folder path “wp-content\themes\dw-minion”.

    add_action('comment_form', 'bootstrap3_comment_button' );
    function bootstrap3_comment_button() {
    echo '<button class="btn btn-default" type="submit">' . __( 'Submit' ) . '</button>';
    }

After the changes we made above, we need to hide the default submit botton add custom styles to reduce the width of the input name, email and website. In this example we will set the width to 50%. We can add this style to the theme styles.css file.

.form-submit {
     display: none;
}
.single-post #comments .btn {
    float: right;
    padding: 3px 30px;
}

– To translate the text fields (name, email, website, comment).
You can add the following code to the Functions.php file:

    add_filter( 'comment_form_default_fields', 'bootstrap3_comment_form_fields' );
    function bootstrap3_comment_form_fields( $fields ) {
    $commenter = wp_get_current_commenter();
    $req = get_option( 'require_name_email' );
    $aria_req = ( $req ? " aria-required='true'" : '' );
    $html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0;
    $fields = array(
    'author' => '<div class="form-group comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .

    '<input class="form-control" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></div>',

    'email' => '<div class="form-group comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .

    '<input class="form-control" id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></div>',

    'url' => '<div class="form-group comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
    '<input class="form-control" id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></div>',
    );
    return $fields;
    }

add_filter( 'comment_form_defaults', 'bootstrap3_comment_form' );
    function bootstrap3_comment_form( $args ) {
    $args['comment_field'] = '<div class="form-group comment-form-comment">
    <label for="comment">' . _x( 'Comment', 'noun' ) . '</label>
    <textarea class="form-control" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>
    </div>';
    return $args;
    }

– To translate the search field “Search”, you can open the extras.php file in the folder path “wp-content\themes\dw-minion\inc”. Find the line 255.

<input type="text" placeholder="Search" id="s" name="s" class="search-query">

– To translate “on” (xxx on article X), you can open the default-widget.php file in the folder “\wp-includes”. Find the line 700.

$output .=  '<li class="recentcomments">' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . esc_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';

Hope this helps !

Camille F.
replied 10 years ago

Thanks a lot! The support you offer for a free theme is really appreciated!

Powered by DW Question & Answer Pro