[pLog-svn] r5313 - in templates/branches/lifetype-1.2/FallingLeaves: . locale

reto at devel.lifetype.net reto at devel.lifetype.net
Sun Apr 15 13:02:13 EDT 2007


Author: reto
Date: 2007-04-15 13:02:13 -0400 (Sun, 15 Apr 2007)
New Revision: 5313

Added:
   templates/branches/lifetype-1.2/FallingLeaves/locale/
   templates/branches/lifetype-1.2/FallingLeaves/locale/locale.txt
Removed:
   templates/branches/lifetype-1.2/FallingLeaves/demosites.template
Modified:
   templates/branches/lifetype-1.2/FallingLeaves/archives.template
   templates/branches/lifetype-1.2/FallingLeaves/bookmark.template
   templates/branches/lifetype-1.2/FallingLeaves/footer.template
   templates/branches/lifetype-1.2/FallingLeaves/header.template
   templates/branches/lifetype-1.2/FallingLeaves/links.template
   templates/branches/lifetype-1.2/FallingLeaves/post.template
   templates/branches/lifetype-1.2/FallingLeaves/postandcomments.template
Log:
Fixed a lot of xhtml compliance bugs and added a localization config

Using the config as a repository for the specific locale strings of a template is new to LT templates. Pleas have a look at Header.template, where the config is included.
{config_load file="./locale/locale.txt" section=$locale->getLocaleCode() scope="global"}

I'm still not sure if it's ok to have one config for all languages. But at least it's a one-liner in the template like this.
Please see smarty.php.net for details. Looking at the implementation should be self-explanatory, though.

It may need some testing related to caching. I didn't so far...

Let me know what you think. Suggestions/Improvements are welcome!



Modified: templates/branches/lifetype-1.2/FallingLeaves/archives.template
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/archives.template	2007-04-15 16:43:42 UTC (rev 5312)
+++ templates/branches/lifetype-1.2/FallingLeaves/archives.template	2007-04-15 17:02:13 UTC (rev 5313)
@@ -1,12 +1,8 @@
 {include file="$blogtemplate/header.template"} 
 {include file="$blogtemplate/links.template"}
 		<!-- Loop Start -->
-				<h2 class=title>{$locale->tr("archives")}</h2>
-				<ul>
+				<h2 class="title">{$locale->tr("archives")}</h2>
 					{foreach from=$archives item=month}
-					<li>
-						<a href="{$month->getUrl()}">{$month->getName()}</a> [{$month->getNumArticles()}]
-					</li>
+						<a href="{$month->getUrl()}">{$month->getName()}</a> [{$month->getNumArticles()}]<br />
 					{/foreach}
-				</ul>
 {include file="$blogtemplate/footer.template"} 

Modified: templates/branches/lifetype-1.2/FallingLeaves/bookmark.template
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/bookmark.template	2007-04-15 16:43:42 UTC (rev 5312)
+++ templates/branches/lifetype-1.2/FallingLeaves/bookmark.template	2007-04-15 17:02:13 UTC (rev 5313)
@@ -4,12 +4,8 @@
 			<h2>{$locale->tr("my_links")}</h2>
 				{foreach from=$mylinkscategories item=linkcategory}
 				<H3>{$linkcategory->getName()}</h3>
-				<ul>
 					{foreach from=$linkcategory->getLinks() item=link}
-					<li>
-						<a href="{$link->getUrl()}" title="{$link->getDescription()}">{$link->getName()}</a>: {$link->getDescription()}
-					</li>
+						<a href="{$link->getUrl()}" title="{$link->getDescription()}">{$link->getName()}</a>: {$link->getDescription()}<br />
 					{/foreach}
-				</ul>
 				{/foreach}
 {include file="$blogtemplate/footer.template"} 

Deleted: templates/branches/lifetype-1.2/FallingLeaves/demosites.template
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/demosites.template	2007-04-15 16:43:42 UTC (rev 5312)
+++ templates/branches/lifetype-1.2/FallingLeaves/demosites.template	2007-04-15 17:02:13 UTC (rev 5313)
@@ -1,15 +0,0 @@
-{include file="$blogtemplate/header.template"}
-{include file="$blogtemplate/links.template"}
-		<!-- Loop Start -->
-			<p>
-				The following sites are running pLog. Have a look at them if you want to see how 
-				pLog feels like:
-			</p>
-			<ul>
-				<li><a href="http://www.renalias.net">Oscar's (one of the developers) own personal page</a> (Kind of slow sometimes)</li>
-				<li><a href="http://www.francesc.net">Francesc's (another developer) own personal page</a> (Faster than Oscar's :))</li>
-				<li><a href="http://www.lamevaweb.info">Free blogging service for the users of the #tarrega channel in the Spanish IRC network.</a>.</li>
-				<li><a href="http://ireport.sourceforge.net">iReport project</a></li>
-				<li><a href="http://darren.someblog.com">Darren's blog</a><br/></li>
-			</ul>
-{include file="$blogtemplate/footer.template"}

Modified: templates/branches/lifetype-1.2/FallingLeaves/footer.template
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/footer.template	2007-04-15 16:43:42 UTC (rev 5312)
+++ templates/branches/lifetype-1.2/FallingLeaves/footer.template	2007-04-15 17:02:13 UTC (rev 5313)
@@ -1,10 +1,14 @@
 </div><!-- begin footer -->
 <div id=footer>
-<p>{$blog->getBlog()} is proudly powered by <a href="http://www.lifetype.net/">LifeType</a> 
-<br />Syndicate <a href="{$url->rssLink("rss10")}">Entries (RSS)</a> <a class=alignright href="#top">Back to the top.</a>
-<br />Falling Leaves template design by <a href="http://www.hexfactor.com/">Shawn Grimes</a></p>
-
+<p>
+<a class="alignright" href="#header">{#lcl_backtotop#}</a>
+</p>
+<p>
+{$blog->getBlog()} {#lcl_proudlypowered#}
+</p>
 </div>
 </div>
+
+<!-- Original Design by Shawn Grimes (http://www.hexfactor.com/) -->
 </body>
 </html>

Modified: templates/branches/lifetype-1.2/FallingLeaves/header.template
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/header.template	2007-04-15 16:43:42 UTC (rev 5312)
+++ templates/branches/lifetype-1.2/FallingLeaves/header.template	2007-04-15 17:02:13 UTC (rev 5313)
@@ -1,4 +1,5 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+{config_load file="./locale/locale.txt" section=$locale->getLocaleCode() scope="global"}
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$locale->getLanguageId()}" 
       lang="{$locale->getLanguageId()}" dir="{$locale->getDirection()}">
 <head>
@@ -16,11 +17,10 @@
    {$badbehavior->showBB2JavaScript()}
 {/if}
 </head>
-<BODY>
+<body>
 
-<DIV id=container>
-	<DIV id=header>
-		<A name=top></A>
-		<H1><A href="{$url->blogLink()}">{$blog->getBlog()}</A></H1>
-		<DIV class=description>{$blog->getAbout()}</DIV>
-	</DIV>
+<div id="container">
+	<div id="header">
+		<h1><a href="{$url->blogLink()}">{$blog->getBlog()}</a></h1>
+		<div class="description">{$blog->getAbout()}</div>
+	</div>

Modified: templates/branches/lifetype-1.2/FallingLeaves/links.template
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/links.template	2007-04-15 16:43:42 UTC (rev 5312)
+++ templates/branches/lifetype-1.2/FallingLeaves/links.template	2007-04-15 17:02:13 UTC (rev 5313)
@@ -1,29 +1,28 @@
 <!-- begin sidebar -->
 <div id=sidebar>
-
-{$calendar}<br>
-
+
 {assign var=blogOwner value=$blog->getOwnerInfo()}
 {assign var=aboutMyself value=$blogOwner->getaboutMyself()}
 {if $blogOwner->hasPicture() && $aboutMyself}  
   	 <h2>{$locale->tr("about_myself")}</h2>
   	{assign var=picture value=$blogOwner->getPicture()}
   	<img id="UserPicture" src="{$picture->getPreviewlink()}" alt="{$blogOwner->getUsername()}" /><br/>
-  	<p>{$aboutMyself}</p>
+    {$aboutMyself}
 {/if}
-
-<br />
-
-<h2>Search:</h2>
+<br />
+
+<h2>{$locale->tr('search_s')}</h2>
 <form method="post" action="{$url->getIndexUrl()}">
 <input type="text" name="searchTerms" value="" size="12" />
 <input type="hidden" name="op" value="Search" />
 <input type="hidden" name="blogId" value="{$blog->getId()}"/>
 <input type="submit" name="Search" value="Search" />
 </form>
-<br />
+<br />
+
+<h2>{$locale->tr('calendar')}</h2>
+{$calendar}<br />
 
-
 <h2>{$locale->tr("recently")}</h2>
 <ul>
 {foreach from=$recentposts item=recentpost}
@@ -31,21 +30,22 @@
 <a title="{$recentpost->getText()|truncate:150:"..."|strip_tags|escape}" href="{$url->postlink($recentpost)}">{$recentpost->getTopic()}</a><br/>
 </li>
 {/foreach}
-</ul><br />
+</ul>
+<br />
 
 
-<h2>Categories</h2>
+<h2>{$locale->tr("categories")}</h2>
 <ul>
 {foreach from=$articlecategories item=articleCategory}
 <li>
 <a href="{$url->categorylink($articleCategory)}">{$articleCategory->getName()}</a> ({$articleCategory->getNumarticles()})
 </li>
 {/foreach}
-</ul><br />
+</ul>
+<br />
 
 
-
-<h2>Navigate</h2>
+<h2>{$locale->tr('menu')}</h2>
 <ul>
 <li><a title="{$locale->tr("main")}" href="{$url->bloglink()}">{$locale->tr("main")}</a>
 <li><a title="{$locale->tr("archives")}" href="{$url->templatePage("archives")}">{$locale->tr("archives")}</a>
@@ -53,14 +53,15 @@
 <li><a title="{$locale->tr("summary")}" href="{$url->getUrl("/summary.php")}">{$locale->tr("summary")}</a>
 </ul><br />
 
-<h2>Meta</h2>
+<h2>{#lcl_meta#}</h2>
 <ul>
 <li><a title="{$locale->tr("admin")}" href="{$url->getadminUrl()}">{$locale->tr("admin")}</a></li>
 <li><a title="{$locale->tr("albums")}" href="{$url->albumlink()}">{$locale->tr("albums")}</a></li>
 <li><a title="This page validates as XHTML 1.0 Transitional" href="http://validator.w3.org/check/referer">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> </li>
 <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a> </li>
-<li><a title="Powered by lifeType, state-of-the-art semantic personal publishing platform." href="http://www.lifetype.net/">lifeType</a> </li>
-</ul><br />
+<li><a title="Powered by lifeType, state-of-the-art semantic personal publishing platform." href="http://www.lifetype.net/">LifeType</a> </li>
+</ul>
+<br />
 
 
 

Added: templates/branches/lifetype-1.2/FallingLeaves/locale/locale.txt
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/locale/locale.txt	                        (rev 0)
+++ templates/branches/lifetype-1.2/FallingLeaves/locale/locale.txt	2007-04-15 17:02:13 UTC (rev 5313)
@@ -0,0 +1,33 @@
+# German locales for FallingLeaves Template
+[de_DE]
+lcl_leaveareply = "Hinterlasse eine Nachricht"
+lcl_meta = "Meta"
+lcl_proudlypowered = "is proudly powered by <a href="http://www.lifetype.net/">LifeType</a>"
+lcl_backtotop = "Nach oben"
+lcl_backhome = "Zur&uuml;ck zur Startseite"
+lcl_prevpost = "Vorheriger Artikel:"
+lcl_nextpost = "Nächster Artikel:"
+lcl_trackbackurl = "Trackback URL"
+lcl_commentssofar = "Antworten auf"
+lcl_says = "sagt:"
+lcl_visit = "besuche"
+lcl_publishedon = "Ver&ouml;ffentlicht am"
+lcl_at = "um"
+
+
+
+# English locales for FallingLeaves Template
+[en_UK]
+lcl_leaveareply = "Leave a Reply"
+lcl_meta = "Meta"
+lcl_proudlypowered = "is proudly powered by <a href="http://www.lifetype.net/">LifeType</a>"
+lcl_backtotop = "Nach oben"
+lcl_backhome = "Back to Home"
+lcl_prevpost = "Previous post:"
+lcl_nextpost = "Next post:"
+lcl_trackbackurl = "Trackback URL"
+lcl_commentssofar = "Responses to"
+lcl_says = "says:"
+lcl_visit = "Visit"
+lcl_publishedon = "Published on"
+lcl_at = "at"

Modified: templates/branches/lifetype-1.2/FallingLeaves/post.template
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/post.template	2007-04-15 16:43:42 UTC (rev 5312)
+++ templates/branches/lifetype-1.2/FallingLeaves/post.template	2007-04-15 17:02:13 UTC (rev 5313)
@@ -1,20 +1,21 @@
 <!-- {$url->postTrackbackLink($post)} -->
 {assign var="postDate" value=$post->getDateObject()}
 {assign var="postOwner" value=$post->getUserInfo()}
-	<div class=post>
-		<h2 class=storytitle ><A class=aposted href="{$url->postPermalink($post)}">{$post->getTopic()}</A></h2>
-		<div class=date>Published on {$locale->formatDate($postDate,"%H:%M, %m/%d,%Y")}</div>
+	<div class="post">
+		<h2 class="storytitle"><a class="aposted" href="{$url->postPermalink($post)}">{$post->getTopic()}</a></h2>
+		<div class="date">{#lcl_publishedon#} {$locale->formatDate($postDate,"%H:%M, %m/%d,%Y")}</div>
 		<div class=storycontent>
-		<P>{$post->getText()}</P>
-	</div><BR>
-	<div class=feedback>
-		<div class=meta>Posted under 
+		{$post->getText()}
+	</div><br />
+	<div class="feedback">
+		<div class="meta">
+		{$locale->tr("posted_in")}
 			{foreach name=categories from=$post->getCategories() item=postcategory}
 				<a href="{$url->categoryLink($postcategory)}">{$postcategory->getName()}</a>
 			{if !$smarty.foreach.categories.last}, {/if}
 			{/foreach}
-				| <A  href="{$url->postPermalink($post)}#comments">{$locale->tr("comment on this")} ({$post->getNumComments()})</A>
+				| <a  href="{$url->postPermalink($post)}#comments">{$locale->tr("comment on this")} ({$post->getNumComments()})</a>
 		</div>
 	</div>
-	<div class=sep></div>
+	<div class="sep">&nbsp;</div>
 	</div>

Modified: templates/branches/lifetype-1.2/FallingLeaves/postandcomments.template
===================================================================
--- templates/branches/lifetype-1.2/FallingLeaves/postandcomments.template	2007-04-15 16:43:42 UTC (rev 5312)
+++ templates/branches/lifetype-1.2/FallingLeaves/postandcomments.template	2007-04-15 17:02:13 UTC (rev 5313)
@@ -3,53 +3,52 @@
 
 {include file="$blogtemplate/header.template"}
 <div>
-	<div class=post>
+	<div class="post">
 		<!-- {$url->postTrackbackLink($post)} -->
 		{assign var="postDate" value=$post->getDateObject()}
 		{assign var="postOwner" value=$post->getUserInfo()}
-		<h2 class=storytitle>{$post->getTopic()}</h2>
-		<div class=date>Published on {$locale->formatDate($postDate,"%m/%d,%Y")}</div>
-		<P>{$post->getText()}</p>
-		<br clear=all>
+		<h2 class="storytitle">{$post->getTopic()}</h2>
+		<div class="date">Published on {$locale->formatDate($postDate,"%m/%d,%Y")}</div>
+		<p>{$post->getText()}</p>
+		<br style="clear:all" />
 	</div>
-	<div class=feedback>
-		<div class=meta>Posted by {$postOwner->getUsername()} at
+	<div class="feedback">
+		<div class="meta">{$locale->tr('posted_by')} {$postOwner->getUsername()} {#lcl_at#}
 			{$locale->formatDate($postDate,"%H:%M")}
-			<a class=aposted href="{$url->postPermalink($post)}#comments">{$locale->tr("comment on this")} ({$post->getNumComments()})</a> |
-			<a class=aposted href="{$url->postTrackbackStatsLink($post)}">{$locale->tr("trackbacks")} ({$post->getNumTrackbacks()})</a> |
+			<a class="aposted" href="{$url->postPermalink($post)}#comments">{$locale->tr("comment on this")} ({$post->getNumComments()})</a> |
+			<a class="aposted" href="{$url->postTrackbackStatsLink($post)}">{$locale->tr("trackbacks")} ({$post->getNumTrackbacks()})</a> |
 			{foreach name=categories from=$post->getCategories() item=postcategory}
-				<a class=aposted href="{$url->categoryLink($postcategory)}">{$postcategory->getName()}</a>
+				<a class="aposted" href="{$url->categoryLink($postcategory)}">{$postcategory->getName()}</a>
 				{if !$smarty.foreach.categories.last}, {/if}
-			{/foreach}<br>
+			{/foreach}<br />
 			{* Prevpost and nextpost use *}
-			<a href="{$url->blogLink()}">Back to Home</a>
+			<a href="{$url->blogLink()}">{#lcl_backhome#}</a>
 			{assign var=nextpost value=$post->getNextArticle()}
 			{assign var=prevpost value=$post->getPrevArticle()}
 			{if $nextpost == true}
-				<a href="{$url->postPermalink($nextpost)}" title="Previous post: {$nextpost->getTopic()}">{$locale->tr("previous_post")}</a>
+				<a href="{$url->postPermalink($nextpost)}" title="{#lcl_nextpost#} {$nextpost->getTopic()}">{$locale->tr("next_post")}</a>
 			{/if}
 			{if $prevpost == true}
-				<a href="{$url->postPermalink($prevpost)}" title="Next post: {$prevpost->getTopic()}">{$locale->tr("next_post")}</a>
+				<a href="{$url->postPermalink($prevpost)}" title="{#lcl_prevpost#} {$prevpost->getTopic()}">{$locale->tr("prev_post")}</a>
 			{/if}
 			{* End of article_index *}
 		</div>
 	</div>
 	
-	<a name="trackback"></a>
-	<h3>Trackback URL</h3>
+
+	<h3 id="trackback">{#lcl_trackbackurl#}</h3>
 	<div class="trackback-url">{$url->getTrackbackUrl()}?id={$post->getId()}</div>
 
-	<a name="comments"></a>
-	<h3 id="respond">Leave a Reply</h3>
+
 	{if $blogsettings->getValue("comments_enabled") && $post->getCommentsEnabled()==1}
+	<h3 id="respond">{#lcl_leaveareply#}</h3>
 		{include file="$misctemplatepath/commentform.template"}
 	{/if}
-	<h3 id="comments">One Response to {$post->getTopic()}</h3>
+	<h3 id="comments">{#lcl_commentssofar#} <em>{$post->getTopic()}</em></h3>
 	<ol class="commentlist">
 	
 	{assign var="counter" value=1}
 	{foreach name=comment from=$comments item=comment}
-		<a name="{$comment->getId()}"></a>
 		{if $counter%2!=0}
 		<li class="alt" id="comment-{$comment->getId()}">
 		
@@ -57,9 +56,15 @@
 		<li class="" id="comment-{$comment->getId()}">
 		{/if}
 		
-			<small class="commentmetadata"><strong>{$comment->getUsername()}</strong> says:</small><br>
+			<small class="commentmetadata"><strong>{$comment->getUsername()}</strong> {#lcl_says#}</small><br />
 			<small class="commentmetadata"><a href="#comment-{$comment->getId()}" title="">{assign var=commentDate value=$comment->getDateObject()} {$locale->formatDate($commentDate, "%m/%d,%Y, at %H:%M")}</a> </small><br />
-			<small><a href="{$comment->getUserUrl()}">Visit {$comment->getUsername()}</a></small>
+			<small>
+			{if $comment->getUserUrl()}
+			<a href="{$comment->getUserUrl()}">{#lcl_visit#} {$comment->getUsername()}</a>
+			{else}
+			{#lcl_visit#} {$comment->getUsername()}
+			{/if}
+			</small>
 		
 			{if $comment->IsPosterAuthenticated()}
 	{assign var=poster value=$comment->getUser()}



More information about the pLog-svn mailing list