messaliberty

about hulor and us

Next WordBench Osaka at messaliberty

WordPress studying session WordBench will be held at messaliberty. Please join if you’re in Kansai area!

See more detail here: WordBench 大阪 » Blog Archive » 2010年新年会を1月31日(日)開催

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Reddit
  • StumbleUpon
  • Technorati
  • MySpace
  • Tumblr
  • Yahoo! Buzz
  • Twitter

Localizing dates in WordPress themes

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.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Reddit
  • StumbleUpon
  • Technorati
  • MySpace
  • Tumblr
  • Yahoo! Buzz
  • Twitter

Free Japanese prefecture icons

Here are some icons I created of some prefectures in Japan.  The prefectures are Tokyo, Aomori, Hyogo, Kyoto, Okinawa and Shimane . They are in png format (256×256) and you are free to reuse them, but a link back to here would be appreciated. To download, just right click and select Save As.

If anyone has a request for one of the other 41 prefectures, just leave a comment and I’ll make one when I have time.  I chose these prefectures for various random reasons.  For example, Shimane is the home to the Ruby language which is what we do most of our web development on, and Okinawa is my favourite place in Japan.

Tokyo

Tokyo

Aomori

Aomori

Hyogo

Hyogo

Kyoto

Kyoto

Okinawa

Okinawa

Shimane

Shimane

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Reddit
  • StumbleUpon
  • Technorati
  • MySpace
  • Tumblr
  • Yahoo! Buzz
  • Twitter

[JRuby on Rails on GAE/J] how-to put rubygems into a jar file to get around file limitations

GAE (Google App Engine) has a limit number to the number files you can upload.
To get around this limit, we need to compress rubygems into jar files.

There may not be easy way to load rubygems in jar files with JRuby.
But with JRuby on GAE/J, it’s easy to load.

  • JRuby on Rails on GAE/J, can load rubygems in RAILS_ROOT/vendor/gems, just do require “gem-name”.
  • But rubygems often contain a lot of files and that can eat into the quota pretty quickly.
  • JRuby on GAE/J, can load rubygems from jar files.
  • Therefore it makes sense to put rubygems into jar files, and I am going to show you how step by step.

Steps:

  • install rubygems into a specific temporary directory (not into the system dir)
    • use -i option to install rugygems into a temporary directory.
    • use –no-rdoc and –no-ri options, to skip to install rdoc and ri, to reduce jar file size.
  • compress rubygems by jar command in the temporary directory.
  • add require “installed-gem.jar” line in RAILS_ROOT/config/environment.rb

Read the rest of this entry »

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Reddit
  • StumbleUpon
  • Technorati
  • MySpace
  • Tumblr
  • Yahoo! Buzz
  • Twitter

How To Edit Videos Taken By Vado HD on iMovie7

Vado - iMovie 01

Vado - iMovie 01

Hi, I’m an editor of messa.tv. Today I’ll explain how to edit videos taken by our favorite cam Vado HD.

That is because iMovie 7.1.4 doesn’t support container format of Vado HD. To make a long story short, can’t use AVI format. Need to convert to some formats or through iMovie away if you don’t want to lose video quality.

OK, let’s start it.

First of all, you need to get the MPEG Streamclip (Free App). Install the MPEG Streamclip and launch it then select your video file.

Vado - iMovie 02

Vado - iMovie 02

Choose [File] > [Export to MPEG-4]

Vado - iMovie 03

Vado - iMovie 03

Videos which taken by Vado HD have these kind of file informations. (By VLC media player.)

Vado - iMovie 04

Vado - iMovie 04

Now we need to be careful to pick the better format to keep video quality.

  • [Quality] to [100 %]
  • [Sound] > [Channel] to [Mono]
  • [Sound] > [Bit Rate] to [128 kbps]
Vado - iMovie 05

Vado - iMovie 05

Then click [Make MP4] to create a video file.

Vado - iMovie 06

Vado - iMovie 06

File informations may broken when you check it by VLC media player but don’t care about it, keep on.

It’s time to launch iMovie.

Vado - iMovie 07

Vado - iMovie 07

[File] >[Import Movies]

Vado - iMovie 08

Vado - iMovie 08

Fill out your favorite settings. Videos are saved on here:

/Users/{USERNAME}/Movies/iMovie Events/{EVENTNAME}

Vado - iMovie 09

Vado - iMovie 09

Done! Enjoy!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Reddit
  • StumbleUpon
  • Technorati
  • MySpace
  • Tumblr
  • Yahoo! Buzz
  • Twitter
Get Adobe Flash playerPlugin by wpburn.com wordpress themes