Skip to content

Commit

Permalink
Merge pull request #5 from glueckpress/i18n-improvements
Browse files Browse the repository at this point in the history
i18n improvements courtesy of @glueckpress. Merged without alterations.
  • Loading branch information
mor10 committed Jul 14, 2014
2 parents d5ce9a8 + a035be9 commit d59487b
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 87 deletions.
23 changes: 10 additions & 13 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,25 @@
<h1 class="page-title">
<?php
if ( is_category() ) :
printf( __( 'Posts in the ', 'simone' ) );
echo '<em>';
single_cat_title();
echo '</em> ' . __(' category', 'simone') . ':';
/* translators: %s = single category title */
printf( __( 'Posts in the %s category:', 'simone' ), '<em>' . single_cat_title( '', false ) . '</em>' );

elseif ( is_tag() ) :
printf( __( 'Posts with the ', 'simone' ) );
echo '<em>';
single_tag_title();
echo '</em> ' . __('tag', 'simone') . ':';
/* translators: %s = single tag title */
printf( __( 'Posts with the %s tag', 'simone' ), '<em>' . single_tag_title( '', false ) . '</em>' );

elseif ( is_author() ) :
printf( __( 'Author: %s', 'simone' ), '<span class="vcard">' . get_the_author() . '</span>' );

/* Prepending string for day, month and year needs context in order to be individually translatable. */
elseif ( is_day() ) :
printf( __( 'Posts from %s', 'simone' ), '<span>' . get_the_date() . '</span>' );
printf( _x( 'Posts from %s', 'archive for a day', 'simone' ), '<span>' . get_the_date() . '</span>' );

elseif ( is_month() ) :
printf( __( 'Posts from %s', 'simone' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'simone' ) ) . '</span>' );
printf( _x( 'Posts from %s', 'archive for a month', 'simone' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'simone' ) ) . '</span>' );

elseif ( is_year() ) :
printf( __( 'Posts from %s', 'simone' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'simone' ) ) . '</span>' );
printf( _x( 'Posts from %s', 'archive for a year', 'simone' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'simone' ) ) . '</span>' );

elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
_e( 'Asides', 'simone' );
Expand All @@ -59,14 +56,14 @@
?>
</header><!-- .page-header -->

<?php
<?php
if ( is_author() && get_the_author_meta( 'description' ) ) {
echo '<div class="author-index shorter">';
get_template_part('inc/author','box');
echo '</div>';
}
?>

<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>

Expand Down
4 changes: 2 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="comment-navigation clear" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'simone' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '<i class="fa fa-arrow-circle-o-left"></i> Older Comments', 'simone' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments <i class="fa fa-arrow-circle-o-right"></i>', 'simone' ) ); ?></div>
<div class="nav-previous"><?php previous_comments_link( sprintf( '<i class="fa fa-arrow-circle-o-left">%s</i> ', __( 'Older Comments', 'simone' ) ) ); ?></div>
<div class="nav-next"><?php next_comments_link( sprintf( '<i class="fa fa-arrow-circle-o-right">%s</i> ', __( 'Newer Comments', 'simone' ) ) ); ?></div>
</nav><!-- #comment-nav-below -->
<?php endif; // check for comment navigation ?>

Expand Down
2 changes: 1 addition & 1 deletion content-aside.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<footer class="entry-footer entry-meta">
<?php simone_posted_on(); ?>
<?php edit_post_link( __( ' | Edit', 'simone' ), '<span class="edit-link">', '</span>' ); ?>
<?php edit_post_link( sprintf( ' | %s', __( 'Edit', 'simone' ) ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</div>
</article><!-- #post-## -->
25 changes: 15 additions & 10 deletions content-none.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
<div class="index-box">
<header class="entry-header">
<h1 class="entry-title">
<?php
if ( is_404() ) { _e( 'Page not available', 'simone' ); }
else if ( is_search() ) { printf( __( 'Nothing found for <em>', 'simone') . get_search_query() . '</em>' ); }
else { _e( 'Nothing Found', 'simone' );}
<?php
if ( is_404() ) { _e( 'Page not available', 'simone' );

} else if ( is_search() ) {
/* translators: %s = search query */
printf( __( 'Nothing found for %s', 'simone'), '<em>' . get_search_query() . '</em>' );
} else {
_e( 'Nothing Found', 'simone' );
}
?>
</h1>
</header><!-- .page-header -->
Expand All @@ -24,12 +29,12 @@
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>

<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'simone' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>

<?php elseif ( is_404() ) : ?>

<p><?php _e( 'You seem to be lost. To find what you are looking for check out the most recent articles below or try a search:', 'simone' ); ?></p>
<?php get_search_form(); ?>

<?php elseif ( is_search() ) : ?>

<p><?php _e( 'Nothing matched your search terms. Check out the most recent articles below or try searching for something else:', 'simone' ); ?></p>
Expand All @@ -43,10 +48,10 @@
<?php endif; ?>
</div><!-- .entry-content -->
</div><!-- .index-box -->

<?php
if ( is_404() || is_search() ) {

?>
<header class="page-header"><h1 class="page-title"><?php _e( 'Most recent posts:', 'simone' ); ?></h1></header>
<?php
Expand All @@ -71,5 +76,5 @@
wp_reset_postdata();
}
?>

</section><!-- .no-results -->
26 changes: 13 additions & 13 deletions content.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
<?php
if( $wp_query->current_post == 0 && !is_paged() && is_front_page() ) { // Custom template for the first post on the front page
if (has_post_thumbnail()) {
echo '<div class="front-index-thumbnail clear">';
Expand All @@ -15,7 +15,7 @@
echo '</a>';
echo '</div>';
echo '</div>';
}
}
echo '<div class="index-box';
if (has_post_thumbnail()) { echo ' has-thumbnail'; };
echo '">';
Expand All @@ -28,17 +28,17 @@
echo '</a>';
echo '</div>';
}

}
?>
<header class="entry-header clear">
<?php

// Display a thumb tack in the top right hand corner if this post is sticky
if (is_sticky()) {
echo '<i class="fa fa-thumb-tack sticky-post"></i>';
}

/* translators: used between list items, there is a space after the comma */
$category_list = get_the_category_list( __( ', ', 'simone' ) );

Expand All @@ -51,25 +51,25 @@
<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php simone_posted_on(); ?>
<?php
if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) {
<?php
if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link( __( 'Leave a comment', 'simone' ), __( '1 Comment', 'simone' ), __( '% Comments', 'simone' ) );
echo '</span>';
}
?>
<?php edit_post_link( __( ' | Edit', 'simone' ), '<span class="edit-link">', '</span>' ); ?>
<?php edit_post_link( sprintf( ' | %s', __( 'Edit', 'simone' ) ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<?php
if( $wp_query->current_post == 0 && !is_paged() && is_front_page() ) {

<?php
if( $wp_query->current_post == 0 && !is_paged() && is_front_page() ) {
echo '<div class="entry-content">';
the_content( __( '', 'simone' ) );
echo '</div>';
echo '<footer class="entry-footer continue-reading">';
echo '<a href="' . get_permalink() . '" title="' . _x('Read ', 'First part of "Read *article title* in title tag of Read more link', 'simone') . get_the_title() . '" rel="bookmark">' . __('Read <span aria-hidden="true">the article</span>', 'simone') . '<i class="fa fa-arrow-circle-o-right"></i><span class="screen-reader-text"> ' . get_the_title() . '<span></a>';
echo '<a href="' . get_permalink() . '" title="' . _x('Read ', 'First part of "Read *article title* in title tag of Read more link', 'simone') . get_the_title() . '" rel="bookmark">' . __('Read <span aria-hidden="true">the article</span>', 'simone') . '<i class="fa fa-arrow-circle-o-right"></i><span class="screen-reader-text"> ' . get_the_title() . '<span></a>';
echo '</footer><!-- .entry-footer -->';
} else { ?>
<div class="entry-content">
Expand All @@ -80,6 +80,6 @@
</footer><!-- .entry-footer -->
<?php } ?>


</div>
</article><!-- #post-## -->
13 changes: 11 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@
<?php get_sidebar( 'footer' ); ?>
<div class="site-info">
<?php do_action( 'simone_credits' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'my-simone' ) ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'simone' ), 'WordPress' ); ?></a>
<?php
printf(
/* translators: %s = text link: WordPress, URL: http://wordpress.org/ */
__( 'Proudly powered by %s', 'simone' ),
'<a href="http://wordpress.org/" rel="generator">' . esc_attr__( 'WordPress', 'simone' ) . '</a>'
); ?>
<span class="sep"> | </span>
<?php printf( __( 'Theme: Simone by <a href="%1$s" rel="designer nofollow">mor10.com</a>.', 'simone' ), esc_url('http://mor10.com/') ); ?>
<?php
printf(
/* translators: %s = text link: mor10.com, URL: http://mor10.com/ */
__( 'Theme: Simone by %s', 'simone' ),
'<a href="http://mor10.com/" rel="designer nofollow">' . esc_attr__( 'mor10.com', 'simone' ) . '</a>' ); ?>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
Expand Down
14 changes: 7 additions & 7 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
</a>
</figure>
<?php } // End header image check. ?>
<?php
if ( get_header_image() && !('blank' == get_header_textcolor()) ) {
echo '<div class="site-branding header-background-image" style="background-image: url(' . get_header_image() . ')">';
<?php
if ( get_header_image() && !('blank' == get_header_textcolor()) ) {
echo '<div class="site-branding header-background-image" style="background-image: url(' . get_header_image() . ')">';
} else {
echo '<div class="site-branding">';
}
Expand All @@ -47,13 +47,13 @@
<h1 class="menu-toggle"><a href="#"><?php _e( 'Menu', 'simone' ); ?></a></h1>

<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

<div class="search-toggle">
<i class="fa fa-search"></i>
<a href="#search-container" class="screen-reader-text"><?php _e( 'Search', 'twentyfourteen' ); ?></a>
<a href="#search-container" class="screen-reader-text"><?php _e( 'Search', 'simone' ); ?></a>
</div>
<?php simone_social_menu(); ?>


</nav><!-- #site-navigation -->

Expand All @@ -62,7 +62,7 @@
<?php get_search_form(); ?>
</div>
</div>

</header><!-- #masthead -->

<div id="content" class="site-content">
12 changes: 6 additions & 6 deletions image.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
<main id="main" class="site-main" role="main">

<?php while ( have_posts() ) : the_post(); ?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<header class="entry-header clear">

<h1 class="entry-title"><?php the_title(); ?></h1>

<div class="entry-meta">
<?php _e('Featured in: ', 'simone'); ?><span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>.
<?php _e('Full size image: ', 'simone'); ?><span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>.
<?php _e('Featured in: ', 'simone'); ?><span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>.
<?php _e('Full size image: ', 'simone'); ?><span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>.
<?php edit_post_link( __( 'Edit attachment post', 'simone' ), '<span class="edit-link">', '</span>.' ); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
Expand All @@ -39,13 +39,13 @@
<?php endif; ?>
</figure><!-- .wp-caption -->


</div><!-- .entry-attachment -->

<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'simone' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
Expand Down
32 changes: 19 additions & 13 deletions inc/author-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
<div class="reveal-bio">
<?php echo '<a href="#" class="fa fa-minus-circle" title="' . __('Hide Author Bio', 'simone') . '"><span class="screen-reader-text">' . __('Hide Author Bio', 'simone') . '</span></a>'; ?>
</div>

<div class="author-info">

<div class="author-avatar">
<?php
echo get_avatar( get_the_author_meta( 'user_email' ), 96 );
?>
</div><!-- .author-avatar -->
<div class="author-meta">
<div class="author-meta">
<h2 class="author-title"><?php printf( __( 'About %s', 'simone' ), get_the_author() ); ?></h2>
<div class="share-and-more">
<?php
<?php
// Change language depending on number of posts
$posts_posted = get_the_author_posts();
if ( $posts_posted == 1) { printf(__( 'One article and counting. ', 'simone' ) ); }
else { printf(__( '%s articles and counting. ', 'simone' ), the_author_posts() ); }

$author_firstname = get_the_author_meta('first_name');
// Check if social media info is collected in user profile
// Usually handled by a plugin like WordPress SEO by Yoast
Expand All @@ -35,24 +35,30 @@
if ( $author_twitter || $author_googleplus || $author_facebook ) {
echo '<div class="author-social-media">';
printf(__( 'Follow %s on social media: ', 'simone' ), get_the_author_meta('first_name') );
if ($author_twitter) { echo '<a href="https://twitter.com/' . esc_attr( $author_twitter ) . '" title="' . __('Follow ', 'simone') . $author_firstname . __(' on Twitter', 'simone') . '" target="_blank"><i class="fa fa-twitter"></i><span class="screen-reader-text">Twitter</span></a>';}
if ($author_googleplus) { echo '<a href="' . esc_url( $author_googleplus ) . '" title="' . __('Add ', 'simone') . $author_firstname . __(' to your Google+ circles', 'simone') . '" rel="author" target="_blank"><i class="fa fa-google-plus"></i><span class="screen-reader-text">Google+</span></a>';}
if ($author_facebook) { echo '<a href="' . esc_url( $author_facebook ) . '" title="' . __('Like ', 'simone') . $author_firstname . __(' on Facebook', 'simone') . '" target="_blank"><i class="fa fa-facebook"></i><span class="screen-reader-text">Facebook</span></a>';}
if ( $author_twitter ) {
echo '<a href="https://twitter.com/' . esc_attr( $author_twitter ) . '" title="' . sprintf( __( 'Follow %s on Twitter', 'simone' ), $author_firstname ) . '" target="_blank"><i class="fa fa-twitter"></i><span class="screen-reader-text">' . __( 'Twitter', 'simone' ) . '</span></a>';
}
if ( $author_googleplus ) {
echo '<a href="' . esc_url( $author_googleplus ) . '" title="' . sprintf( __( 'Add %s to your Google+ circles', 'simone' ), $author_firstname ) . '" rel="author" target="_blank"><i class="fa fa-google-plus"></i><span class="screen-reader-text">' . __( 'Google+', 'simone' ) . '</span></a>';
}
if ( $author_facebook ) {
echo '<a href="' . esc_url( $author_facebook ) . '" title="' . sprintf( __( 'Like %s on Facebook', 'simone' ), $author_firstname ) . '" target="_blank"><i class="fa fa-facebook"></i><span class="screen-reader-text">' . __( 'Facebook', 'simone' ) . '</span></a>';
}
echo '</div>';
}



?>
</div>
</div>
<div class="author-description">

<p class="author-bio">
<?php the_author_meta( 'description' ) ?>
</p>
<a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php printf( __( 'All posts by %s <i class="fa fa-arrow-circle-o-right"></i>', 'simone' ), get_the_author_meta('first_name') ); ?>
<?php printf( __( 'All posts by %s', 'simone' ), get_the_author_meta('first_name') . ' <i class="fa fa-arrow-circle-o-right"></i>' ); ?>
</a>
</div><!-- .author-description -->
</div><!-- .author-info -->
Loading

0 comments on commit d59487b

Please sign in to comment.