Sfoglia il codice sorgente

index.php: prepare for i18n

Frag Fulgor 14 anni fa
parent
commit
8674eb7583
2 ha cambiato i file con 20 aggiunte e 13 eliminazioni
  1. 19 12
      index.php
  2. 1 1
      readme.txt

+ 19 - 12
index.php

@@ -12,19 +12,26 @@
 							
 							<h1 class="h2"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
 							
-							<p class="meta"><?php _e("Posted", "bonestheme"); ?> <time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time('F jS, Y'); ?></time> <?php _e("by", "bonestheme"); ?> <?php the_author_posts_link(); ?> <span class="amp">&</span> <?php _e("filed under", "bonestheme"); ?> <?php the_category(', '); ?>.</p>
+							<p class="meta"><?php _e('Posted', 'bonestheme'); ?> <time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time(get_option('date_format')); ?></time> <?php _e('by', 'bonestheme'); ?> <?php the_author_posts_link(); ?> <span class="amp">&</span> <?php _e('filed under', 'bonestheme'); ?> <?php the_category(', '); ?>.</p>
 						
 						</header> <!-- end article header -->
 					
 						<section class="post_content clearfix">
-							<?php the_content(_e('<span class="read-more">Read more on "'.the_title('', '', false).'" &raquo;</span>', "bonestheme")); ?>
-					
+							<?php
+							    $more_link_text = '<span class="read-more">' . __('Read more on', 'bonestheme') . the_title(' "', '" &raquo;</span>', false) ;
+							    the_content( $more_link_text ); 
+							?>
+
 						</section> <!-- end article section -->
 						
 						<footer>
-			
-							<p class="tags"><?php the_tags('<span class="tags-title">Tags:</span> ', ', ', ''); ?></p>
-							
+
+							<?php  // count tags of post and use plural where appropriate
+							    $posttags = get_the_tags(); $count=0; if ($posttags) { foreach($posttags as $tag) { $count++; } };
+							    $before_tags_text = '<p class="tags"><span class="tags-title">' . _n('Tag', 'Tags', $count, 'bonestheme') . '</span>: ';
+							    the_tags( $before_tags_text, ', ', '</p>'); 
+							?>
+
 						</footer> <!-- end article footer -->
 					
 					</article> <!-- end article -->
@@ -33,15 +40,15 @@
 					
 					<?php endwhile; ?>	
 					
-					<?php if (function_exists('page_navi')) { // if expirimental feature is active ?>
+					<?php if (function_exists('page_navi')) { // if experimental feature is active ?>
 						
 						<?php page_navi(); // use the page navi function ?>
 						
 					<?php } else { // if it is disabled, display regular wp prev & next links ?>
 						<nav class="wp-prev-next">
 							<ul class="clearfix">
-								<li class="prev-link"><?php next_posts_link(_e('&laquo; Older Entries', "bonestheme")) ?></li>
-								<li class="next-link"><?php previous_posts_link(_e('Newer Entries &raquo;', "bonestheme")) ?></li>
+								<li class="prev-link"><?php next_posts_link(_e('&laquo; Older Entries', 'bonestheme')) ?></li>
+								<li class="next-link"><?php previous_posts_link(_e('Newer Entries &raquo;', 'bonestheme')) ?></li>
 							</ul>
 						</nav>
 					<?php } ?>		
@@ -50,10 +57,10 @@
 					
 					<article id="post-not-found">
 					    <header>
-					    	<h1>Not Found</h1>
+					    	<h1><?php _e('Not Found', 'bonestheme') ?></h1>
 					    </header>
 					    <section class="post_content">
-					    	<p>Sorry, but the requested resource was not found on this site.</p>
+					    	<p><?php _e('Sorry, but the requested resource was not found on this site.', 'bonestheme'); ?></p>
 					    </section>
 					    <footer>
 					    </footer>
@@ -67,4 +74,4 @@
     
 			</div> <!-- end #content -->
 
-<?php get_footer(); ?>
+<?php get_footer(); ?>

+ 1 - 1
readme.txt

@@ -1,5 +1,5 @@
 /******************************************************************
-Bones 
+Bones .
 A Lightweight Wordpress Development Theme
 
 Bones is designed to make the life of developers easier. It's built