messaliberty

about hulor and us

Posts Tagged ‘themes’

Localizing dates in WordPress themes

December 15th, 2009 post by ianc
cal2

Ken's stuck in time calendar

Our theme on the English side and the Japanese side are the same.  And by that I mean, we only have one copy of the theme files that is used for both sides.  For this to work, it has to be  fully localised and independant. One thing that is quite different in the two languages is the formatting of dates.  A date like Dec 13th 2009 might be formatted as 2009年12月13日

Chapp worked from a theme that had the date formats hard coded into the theme.  As in:

<?php the_time('F jS, Y'); ?>

If we left that in, the Japanese side’s dates wouldn’t be right, but if we took out the ‘F jS, Y’ part, it defaulted to outputting the time.  As a workaround, we used:

<?php the_date(); ?>

which does fetch and use the right formatted date on both sides.  Yay! But… when WordPress generated archive pages, we found an unexpected behaviour of date().  It only outputs a certain date once.  So if two posts were written on the same day, only one post would have the date.  I think somewhere in the theme there is an ugly workaround involving an array.  But this is a better approach:

<?php the_time(get_option('date_format')); ?>

What this is doing is fetching the date format string that is set in Settings > General > Date Format and using that.  Which for the record is F jS, Y on the English side, and Y年n月j日 on the Japanese side.  I know it may sound obvious but at the time it had us scratching our collective heads.

And while not many installations will be using the same set of theme files for two or more languages at the same time (except for WordPress MU themes), localizing the theme this way lets you or your users to just set the date format in the General Settings screen.

Thoughts on the GPL and WordPress themes

October 26th, 2009 post by ianc

gnu_gpl_logo

Why the GPL doesn’t matter

WordCamp Kyoto 2009 was a great experience. One presentation by Digital Cube provoked a discussion about GPL amongst a small group of attendees, myself included.

The major worry about releasing themes or plugins as GPL is that after all the work and effort at producing it, someone you sell it to is going to turn around and re-release it either at a discount or for free. Leaving you, the original developer, feeling cheated.

The GPL definitely allows this. But it doesn’t much matter if you understand the concept of competitive advantage. Let me explain:

(more…)

WordPress and MovableType

January 22nd, 2009 post by take
WordPress&MovableType

WordPress&MovableType

In recent years, I have constructed and customized many kind of web blog software and japanese blog service.
This time, I share my feelings I had used “WordPress” and “MovableType” represent two of them all.

I have used “MovableType” before about three years, but we switch it to “WordPress” in this our official site updating.
I begin to use “WordPress” over the past a month, there are differences of “WordPress” and “MovableType” of the points I’ve noticed.

[WordPress]

+ Open source project
+ No restructuring
+ Easily developing design themes
+ Post revision

- Creating new blog difficulty
- Need to having PHP skill for easily customizing

[MovableType]

+ Creating new blog easily
+ Easily customizing through use of MT Tag

- Need restructuring
- Not easily developing template set

In the future, I will customize something using PHP on “WordPress”.
I hope I can report it in next post.