Podcastpedia.org can be accessed today in four languages – English, German, French and Romanian, with Spanish planned for the near future. In computing this is called internationalization (i18n). The post presents how this is configured under the hood with the help of Spring 3 MVC.
Application Context Configuration
Message Resource Files
Normally in the Java world, the locale-specific data is stored in message resource files. In Spring you configure it by adding the following bean
org.springframework.context.support.ReloadableResourceBundleMessageSource to the application context:
<!-- Application Message Bundle --> <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basename" value="classpath:messages/messages" /> <property name="defaultEncoding" value="UTF-8"/> </bean>
It all began back 2002, my first year at the university in Romania, when I wanted to improve my German skills. At that time my grammar was pretty good, my writing skills were satisfying, but I still had difficulties expressing myself and understanding what the Germans are talking about on TV. Being a self-taught kind of person, I began looking for ways to improve that. On my research I stumbled upon Deutsche Welle’s website, which had lots of useful resources for learning German. I first listened to Langsam Gesprochene Nachrichten (Slowly Spoken News), which turned out to be very accesible and easy to understand. Then followed „Deutsch – warum nicht?“ (German- why not?) and „Marktplatz“ (marketplace). Back then you could download audio files with transcripts from the website – I still have like half of tree worth of paper of that lying in my basement, sorry…
Looking for ways to improve Podcastpedia.org‘ mobile user-friendliness, I have discovered Google’s PageSpeed Insights . After analyzing the home page, a podcast’s page (The Naked Scientists Podcast – Stripping Down Science), an episode page and scoring an average of 70 out of 100 (even worse on mobile) two points needed urgent fixing:
1. Enabling compression
Compressing resources with gzip or deflate will reduce the number of bytes sent over the network at the expense of slightly increased CPU utilization. Smaller files also mean less bandwidth used and faster transfer time. At Google’s recommendation I have enabled file compression on the Apache web server, for which you have to use the mod_deflate module.
1.1 Enable mod_deflate on GoDaddy
To enable mod_deflate on a GoDaddy Virtual Private Server account, you have to use Easy Apache and the same procedure as in Troubleshooting WordPress installation on GoDaddy VPS. You need to check the Deflate option at step number 5. Exhaustive Options List and recompile the Apache Server.
To verify the module mod_deflate is active run the following command on CentOS
httpd -M | grep deflate_module
I recently switched to Eclipse Kepler, being very dissapointed in the Juno Version – sometimes it took a couple of seconds just to switch between open tabs, and that on a 16 GB RAM machine with a 8-core processor… Anyway, I will shortly present here how I have configured Eclipse for the further development of Podcastpedia.org:
This post is about automatically generating sitemaps. I chose this topic, because it is fresh in my mind as I have recently started using sitemaps for Podcastpedia.org After some research I came to the conclusion this would be a good thing – at the time of the posting Google had 3171 URLs indexed for the website (it has been live for 3 months now), whereby after generating sitemaps there were 87,818 URLs submitted. I am curios how many will get indexed after that…
So because I didn’t want to introduce over 80k URLs manually, I had to come up with an automated solution for that. Because Podcastpedia.org was developed with Java, it came easy to me to select sitemapgen4j
Check out the latest version here:
com.google.code sitemapgen4j 1.0.1