progress on #24 to add i18n and wpml support

This commit is contained in:
Ben Word
2011-04-30 20:22:06 -06:00
parent e5d81e5d06
commit 119c20704f
12 changed files with 59 additions and 59 deletions

12
404.php
View File

@@ -2,15 +2,15 @@
<div id="content" class="<?php echo roots_container_class; ?>"> <div id="content" class="<?php echo roots_container_class; ?>">
<div id="main" role="main"> <div id="main" role="main">
<div class="container"> <div class="container">
<h1>File Not Found</h1> <h1><?php _e('File Not Found', 'roots'); ?></h1>
<div class="error"> <div class="error">
<p class="bottom">The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.</p> <p class="bottom"><?php _e('The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.', 'roots'); ?></p>
</div> </div>
<p>Please try the following:</p> <p><?php _e('Please try the following:', 'roots'); ?></p>
<ul> <ul>
<li>Check your spelling</li> <li><?php _e('Check your spelling', 'roots'); ?> </li>
<li>Return to the <a href="<?php echo home_url(); ?>/">home page</a></li> <li><?php printf(__('Return to the <a href="%s">home page</a>', 'roots'), home_url()); ?></li>
<li>Click the <a href="javascript:history.back()">Back</a> button</li> <li><?php _e('Click the <a href="javascript:history.back()">Back</a> button', 'roots'); ?></li>
</ul> </ul>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->

View File

@@ -4,14 +4,14 @@
<article id="comment-<?php comment_ID(); ?>"> <article id="comment-<?php comment_ID(); ?>">
<header class="comment-author vcard"> <header class="comment-author vcard">
<?php echo get_avatar($comment,$size='32'); ?> <?php echo get_avatar($comment,$size='32'); ?>
<?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?> <?php printf(__('<cite class="fn">%s</cite>', 'roots'), get_comment_author_link()) ?>
<time datetime="<?php echo comment_date('c') ?>"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s'), get_comment_date(), get_comment_time()) ?></a></time> <time datetime="<?php echo comment_date('c') ?>"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s', 'roots'), get_comment_date(), get_comment_time()) ?></a></time>
<?php edit_comment_link(__('(Edit)'),' ','') ?> <?php edit_comment_link(__('(Edit)', 'roots'), '', '') ?>
</header> </header>
<?php if ($comment->comment_approved == '0') : ?> <?php if ($comment->comment_approved == '0') : ?>
<div class="notice"> <div class="notice">
<p class="bottom"><?php _e('Your comment is awaiting moderation.') ?></p> <p class="bottom"><?php _e('Your comment is awaiting moderation.', 'roots') ?></p>
</div> </div>
<?php endif; ?> <?php endif; ?>
@@ -28,12 +28,12 @@
<?php <?php
// Do not delete these lines // Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!'); die (__('Please do not load this page directly. Thanks!', 'roots'));
if ( post_password_required() ) { ?> if ( post_password_required() ) { ?>
<section id="comments"> <section id="comments">
<div class="notice"> <div class="notice">
<p class="bottom">This post is password protected. Enter the password to view comments.</p> <p class="bottom"><?php _e('This post is password protected. Enter the password to view comments.', 'roots'); ?></p>
</div> </div>
</section> </section>
<?php <?php
@@ -43,7 +43,7 @@
<?php // You can start editing here. ?> <?php // You can start editing here. ?>
<?php if ( have_comments() ) : ?> <?php if ( have_comments() ) : ?>
<section id="comments"> <section id="comments">
<h3><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3> <h3><?php comments_number(__('No Responses to', 'roots'), __('One Response to', 'roots'), __('% Responses to', 'roots') ); ?> &#8220;<?php the_title(); ?>&#8221;</h3>
<ol class="commentlist"> <ol class="commentlist">
<?php wp_list_comments('type=comment&callback=roots_comments'); ?> <?php wp_list_comments('type=comment&callback=roots_comments'); ?>
<?php // wp_list_comments(); ?> <?php // wp_list_comments(); ?>
@@ -60,37 +60,40 @@
<?php else : // comments are closed ?> <?php else : // comments are closed ?>
<section id="comments"> <section id="comments">
<div class="notice"> <div class="notice">
<p class="bottom">Comments are closed.</p> <p class="bottom"><?php _e('Comments are closed.', 'roots') ?></p>
</div> </div>
</section> </section>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<?php if ( comments_open() ) : ?> <?php if ( comments_open() ) : ?>
<section id="respond"> <section id="respond">
<h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3> <h3><?php comment_form_title( __('Leave a Reply', 'roots'), __('Leave a Reply to %s', 'roots') ); ?></h3>
<p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p> <p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p>
<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?> <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
<p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p> <p><?php printf( __('You must be <a href="%s">logged in</a> to post a comment.', 'roots'), wp_login_url( get_permalink() ) ); ?></p>
<?php else : ?> <?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( is_user_logged_in() ) : ?> <?php if ( is_user_logged_in() ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p> <p><?php printf(__('Logged in as <a href="%s"/wp-admin/profile.php">%s</a>.', 'roots'), get_option('siteurl'), $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php __('Log out of this account', 'roots'); ?>"><?php _e('Log out &raquo;', 'roots'); ?></a></p>
<?php else : ?> <?php else : ?>
<p> <p>
<label for="author">Name <?php if ($req) echo "(required)"; ?></label> <label for="author"><?php _e('Name', 'roots'); if ($req) _e(' (required)', 'roots'); ?></label>
<input type="text" class="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?>> <input type="text" class="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?>>
</p> </p>
<p> <p>
<label for="email">Email (will not be published) <?php if ($req) echo "(required)"; ?></label> <label for="email"><?php _e('Email (will not be published)', 'roots'); if ($req) _e(' (required)', 'roots'); ?></label>
<input type="email" class="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?>> <input type="email" class="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?>>
</p> </p>
<p> <p>
<label for="url">Website</label> <label for="url"><?php _e('Website', 'roots'); ?></label>
<input type="url" class="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3"> <input type="url" class="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3">
</p> </p>
<?php endif; ?> <?php endif; ?>
<p><textarea name="comment" id="comment" rows="10" tabindex="4"></textarea></p> <p>
<p><input name="submit" class="button" type="submit" id="submit" tabindex="5" value="Submit Comment"></p> <label for="comment"><?php _e('Comment', 'roots'); ?></label>
<textarea name="comment" id="comment" tabindex="4"></textarea>
</p>
<p><input name="submit" class="button" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment', 'roots'); ?>"></p>
<?php comment_id_fields(); ?> <?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?> <?php do_action('comment_form', $post->ID); ?>
</form> </form>

View File

@@ -10,13 +10,13 @@
<p class="copy"><small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p> <p class="copy"><small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p>
<?php if (get_option('roots_footer_social_share') == 'checked') { ?> <?php if (get_option('roots_footer_social_share') == 'checked') { ?>
<p class="social"> <p class="social">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php echo home_url('/'); ?>" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> <a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php echo home_url('/'); ?>" data-count="horizontal"><?php _e('Tweet', 'roots');?></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo home_url('/'); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=110&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:21px;" allowTransparency="true"></iframe> <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo home_url('/'); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=110&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:21px;" allowTransparency="true"></iframe>
</p> </p>
<?php } ?> <?php } ?>
<?php if (get_option('roots_footer_vcard') == 'checked') { ?> <?php if (get_option('roots_footer_vcard') == 'checked') { ?>
<p class="vcard"> <p class="vcard">
<a class="fn org url" href="<?php echo home_url('/'); ?>" title="Contact Information for <?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a><br> <a class="fn org url" href="<?php echo home_url('/'); ?>"><?php bloginfo('name'); ?></a><br>
<span class="adr"> <span class="adr">
<span class="street-address"><?php echo get_option('roots_vcard_street-address'); ?></span><br> <span class="street-address"><?php echo get_option('roots_vcard_street-address'); ?></span><br>
<span class="locality"><?php echo get_option('roots_vcard_locality'); ?></span>, <span class="locality"><?php echo get_option('roots_vcard_locality'); ?></span>,

View File

@@ -36,7 +36,7 @@ if (!defined('roots_container_class')) {
} }
function get_roots_stylesheets() { function get_roots_stylesheets() {
$roots_css_framework = get_option('roots_css_framework'); $roots_css_framework = get_option('roots_css_framework');
$template_uri = get_template_directory_uri(); $template_uri = get_template_directory_uri();
$styles = ''; $styles = '';
@@ -71,25 +71,25 @@ function get_roots_stylesheets() {
// set the maximum 'Large' image width to the maximum grid width // set the maximum 'Large' image width to the maximum grid width
if (!isset($content_width)) { if (!isset($content_width)) {
switch ($roots_css_framework) { switch ($roots_css_framework) {
case 'blueprint': case 'blueprint':
$content_width = 950; $content_width = 950;
break; break;
case '960gs_12': case '960gs_12':
$content_width = 940; $content_width = 940;
break; break;
case '960gs_16': case '960gs_16':
$content_width = 940; $content_width = 940;
break; break;
case '960gs_24': case '960gs_24':
$content_width = 940; $content_width = 940;
break; break;
case '1140': case '1140':
$content_width = 1140; $content_width = 1140;
break; break;
default: default:
$content_width = 950; $content_width = 950;
break; break;
} }
} }
// tell the TinyMCE editor to use editor-style.css // tell the TinyMCE editor to use editor-style.css
@@ -105,8 +105,8 @@ add_theme_support('post-thumbnails');
add_theme_support('menus'); add_theme_support('menus');
register_nav_menus( register_nav_menus(
array( array(
'primary_navigation' => 'Primary Navigation', 'primary_navigation' => 'Primary Navigation',
'utility_navigation' => 'Utility Navigation' 'utility_navigation' => 'Utility Navigation'
) )
); );

View File

@@ -50,7 +50,5 @@
</header> </header>
<?php if (get_option('roots_css_framework') === '1140') { ?> <?php if (get_option('roots_css_framework') === '1140') { ?>
</div><!-- /.row --> </div><!-- /.row -->
<?php } ?>
<?php if (get_option('roots_css_framework') === '1140') { ?>
<div class="row"> <div class="row">
<?php } ?> <?php } ?>

View File

@@ -1,5 +1,5 @@
<?php /* Start loop */ ?> <?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<?php if (function_exists('yoast_breadcrumb')) { if (is_page() && $post->post_parent) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } } ?> <?php if (function_exists('yoast_breadcrumb')) { if (is_page() && $post->post_parent) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } } ?>
<h1><?php the_title(); ?></h1> <h1><?php the_title(); ?></h1>

View File

@@ -1,22 +1,22 @@
<?php /* If there are no posts to display, such as an empty archive page */ ?> <?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php if (!have_posts()) : ?> <?php if (!have_posts()) : ?>
<div class="notice"> <div class="notice">
<p class="bottom">Sorry, no results were found.</p> <p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p>
</div> </div>
<?php get_search_form(); ?> <?php get_search_form(); ?>
<?php endif; ?> <?php endif; ?>
<?php /* Start loop */ ?> <?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header> <header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<time pubdate datetime="<?php the_time('c'); ?>">Posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>.</time> <time pubdate datetime="<?php the_time('c'); ?>"><?php printf(__('Posted on %s at %s.', 'roots'), get_the_time('l, F jS, Y'), get_the_time()); ?></time>
<?php if (get_option('roots_post_author') == 'checked') { ?> <?php if (get_option('roots_post_author') == 'checked') { ?>
<p class="byline author vcard"> <p class="byline author vcard">
Written by <span class="fn"><?php the_author(); ?></span> <?php _e('Written by', 'roots');?> <span class="fn"><?php the_author(); ?></span>
</p> </p>
<?php } ?> <?php } ?>
</header> </header>

View File

@@ -1,21 +1,21 @@
<?php /* Start loop */ ?> <?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>"> <article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<header> <header>
<h1 class="entry-title"><?php the_title(); ?></h1> <h1 class="entry-title"><?php the_title(); ?></h1>
<time class="updated" datetime="<?php the_time('c'); ?>" pubdate>Posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>.</time> <time class="updated" datetime="<?php the_time('c'); ?>" pubdate><?php printf(__('Posted on %s at %s.', 'roots'), get_the_time('l, F jS, Y'),get_the_time())?></time>
<?php if (get_option('roots_post_author') == 'checked') { ?> <?php if (get_option('roots_post_author') == 'checked') { ?>
<p class="byline author vcard"> <p class="byline author vcard">
Written by <span class="fn"><?php the_author(); ?></span> <?php _e('Written by', 'roots');?> <span class="fn"><?php the_author(); ?></span>
</p> </p>
<?php } ?> <?php } ?>
<?php if (get_option('roots_post_tweet') == 'checked') { ?> <?php if (get_option('roots_post_tweet') == 'checked') { ?>
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal"><?php _e('Tweet', 'roots');?></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<?php } ?> <?php } ?>
</header> </header>
<div class="entry-content"> <div class="entry-content">
<?php the_content('<p>Read the rest of this entry &raquo;</p>'); ?> <?php the_content('<p>'.__('Read the rest of this entry &raquo;', 'roots').'</p>'); ?>
</div> </div>
<footer> <footer>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?> <?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?>
@@ -25,4 +25,3 @@
</article> </article>
<?php endwhile; // End the loop ?> <?php endwhile; // End the loop ?>

View File

@@ -1,22 +1,22 @@
<?php /* If there are no posts to display, such as an empty archive page */ ?> <?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php if (!have_posts()) : ?> <?php if (!have_posts()) : ?>
<div class="notice"> <div class="notice">
<p class="bottom">Sorry, no results were found.</p> <p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p>
</div> </div>
<?php get_search_form(); ?> <?php get_search_form(); ?>
<?php endif; ?> <?php endif; ?>
<?php /* Start loop */ ?> <?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header> <header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<time pubdate datetime="<?php the_time('c'); ?>">Posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>.</time> <time pubdate datetime="<?php the_time('c'); ?>"><?php printf( __('Posted on %s at %s.','roots'), get_the_time('l, F jS, Y'), get_the_time()) ?></time>
<?php if (get_option('roots_post_author') == 'checked') { ?> <?php if (get_option('roots_post_author') == 'checked') { ?>
<p class="byline author vcard"> <p class="byline author vcard">
Written by <span class="fn"><?php the_author(); ?></span> <?php _e('Written by', 'roots');?> <span class="fn"><?php the_author(); ?></span>
</p> </p>
<?php } ?> <?php } ?>
</header> </header>

View File

@@ -7,11 +7,11 @@ get_header(); ?>
<div id="main" class="<?php echo get_option('roots_main_class'); ?>" role="main"> <div id="main" class="<?php echo get_option('roots_main_class'); ?>" role="main">
<div class="container"> <div class="container">
<?php get_template_part('loop', 'page'); ?> <?php get_template_part('loop', 'page'); ?>
<h2>Pages</h2> <h2><?php _e('Pages', 'roots'); ?></h2>
<ul><?php wp_list_pages('sort_column=menu_order&depth=0&title_li='); ?></ul> <ul><?php wp_list_pages('sort_column=menu_order&depth=0&title_li='); ?></ul>
<h2>Posts</h2> <h2><?php _e('Posts', 'roots'); ?></h2>
<ul><?php wp_list_categories('title_li=&hierarchical=0&show_count=1'); ?></ul> <ul><?php wp_list_categories('title_li=&hierarchical=0&show_count=1'); ?></ul>
<h2>Archives</h2> <h2><?php _e('Archives', 'roots'); ?></h2>
<ul><?php wp_get_archives('type=monthly&limit=12'); ?></ul> <ul><?php wp_get_archives('type=monthly&limit=12'); ?></ul>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->

View File

@@ -2,7 +2,7 @@
<div id="content" class="<?php echo roots_container_class; ?>"> <div id="content" class="<?php echo roots_container_class; ?>">
<div id="main" class="<?php echo get_option('roots_main_class'); ?>"> <div id="main" class="<?php echo get_option('roots_main_class'); ?>">
<div class="container"> <div class="container">
<h1>Search Results for <?php echo get_search_query(); ?></h1> <h1><?php _e('Search Results for', 'roots'); ?> <?php echo get_search_query(); ?></h1>
<?php get_template_part('loop', 'search'); ?> <?php get_template_part('loop', 'search'); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
@@ -12,4 +12,4 @@
</div> </div>
</aside><!-- /#sidebar --> </aside><!-- /#sidebar -->
</div><!-- /#content --> </div><!-- /#content -->
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -1,5 +1,5 @@
<form role="search" method="get" id="searchform" action="<?php echo home_url('/'); ?>"> <form role="search" method="get" id="searchform" action="<?php echo home_url('/'); ?>">
<label class="visuallyhidden" for="s">Search for:</label> <label class="visuallyhidden" for="s"><?php _e('Search for:', 'roots'); ?></label>
<input type="search" value="" name="s" id="s" placeholder="Search <?php bloginfo('name'); ?>"> <input type="search" value="" name="s" id="s" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>">
<input type="submit" id="searchsubmit" value="Search" class="button"> <input type="submit" id="searchsubmit" value="<?php _e('Search', 'roots'); ?>" class="button">
</form> </form>