Pimp your Globalize: Extensions, Plugins and Patches - Get on Rails with Globalize! Part 6 of 8
posted: May 26th, 2007 · by: Sven
This article is part of the series “Get on Rails with Globalize!” and like the last installment it’s a catch-all list: this time we’re going to get some really cool extensions, plugins and patches caught. Stuff that makes Globalize an even mightier tool by adding useful functionality or connecting it to other important tools:
- Multilingual URLs
- Get Globalize working with :include and no base language
- Translate your application while browsing it
- Localized, concise Rails URL helpers
- Get Liquid templates to play nice with Globalize
- Globalize time_ago_in_words method of Rails
- Multiple arguments to fetch
I’ll edit and complete this list as needed. If you know of a Globalize extension, a library, plugin or patch that you found useful and that would fit into this collection, please drop me a note!
Read the rest of this entryAdvanced techniques, tips and tricks - Get on Rails with Globalize! Part 5 of 8
posted: May 18th, 2007 · by: Sven
This article is part of the series “Get on Rails with Globalize!” and it’s a bit of a catch all list of useful techniques, tips and tricks. Stuff that you probably don’t necessarily need in every project but that you should be aware of:
- Bridge Globalize and TZInfo
- Preload View Translations in Production
- Clear Globalize’s translations runtime cache
- Use nice predicated block helpers in your views
- Organize your translations through Globalize’s namespaces
- Alternative Storage Mechanism for Model Translations
I’ll edit and complete this list as needed. If you know of a tip or trick that you found handy and that would fit into this collection, please drop me a note!
Read the rest of this entryConcise, localized Rails URL helpers? Solved (twice).
posted: May 13th, 2007 · by: Sven
Originally triggered by Jeremy Hubert I’ve posted some thoughts about more concise and transparently localized Rails url_helper methods last month.
Basically Jeremy nailed a problem that occurs as soon as you define a Rails route that includes the locale as the leftmost parameter: you now can’t use Rails’ url_helper methods in a reasonable DRY way any more! A reasonable solution was pending.
Plugins to the rescue. By the end of this article you’ll be able to choose between two different solutions to this problem.
Read the rest of this entryReport: 30 days with no blog spam on Mephisto!
posted: May 8th, 2007 · by: Sven
I promised to keep you posted with the results of my experimental ”outer spam floodgate” Mephisto extension. Tell you what. I’m super-happy with the results as I haven’t seen any blog spam this month! Yes, right. No spam.
Read the rest of this entryServe CSS and Javascript even faster: improved Rails bundled_assets plugin
posted: April 27th, 2007 · by: Sven
I recently showed a Rails plugin that allows to transparently bundle your various CSS and Javascript resources (“assets” in Rails talk) into just one single CSS and Javascript file respectively.
I received some quite positive feedback on it and from various discussions some improvements have emerged that are now available in the repository.
Thanks go especially to Witold Rugowski who pointed me to the execution times of the Ruby implementation of JSMin with larger Javascript bundles. He also found a small bug in Uladzislau Latynski’s otherwise flawless JSMin implementation in Ruby that we are using by default.
Read the rest of this entryConcise & transparently localized Rails url_helper methods?
posted: April 24th, 2007 · by: Sven
Update: It’s worth noting that the following information has been updated in the follow-up article: Concise, localized Rails URL helpers? Solved (twice).
Recently Jeremy Hubert commented on my tutorial about routes setup for Globalize. In short he criticized that Globalize doesn’t provide a solution for transparently adding the locale to Rails url_helpers where needed. Instead of being able to say:
article_url(@article)
You have to specify the locale for each and every call to an url_helper, like so:
article_url(@current_locale, @article)
Needless to say that this does raise some eyebrows in the Rails community. So let’s see if we can come up with an acceptable solution here. This post describes some intermediary results.
Read the rest of this entryA new code repository for useful stuff at artweb-design.de
posted: April 22nd, 2007 · by: Sven
Update: some of the links in this summary might not work anymore and some information may be outdated. I’ve changed some of my code repository structure and some of the code has evolved. I’ve set up a central page though which I’ll keep updated. You can find it here: Small projects, plugins, patches and stuff like that.
Those of you who are subscribed to my RSS feed might have noticed that I’ve updated some URLs to plugins and patches in recent articles. That’s because I’ve decided that it’s a cool idea to have an own repository for “stuff” like: plugins, patches, utilities and the like. You can find it at http://stuff.artweb-design.de/svn.
I’ve also set up a Trac for this repository just to be able to track commits at http://trac.artweb-design.de. I don’t think that I’m ever going to need the tickets and wiki portions so that’s rather oversized. But Trac is already running for other projects, so that’s been the easiest way to get something going.
I’m going to add more stuff subsequently. Currently there are the following bits and pieces checked in yet.
Read the rest of this entryRails plugin: Blazing fast page loads through bundled CSS and Javascript
posted: April 14th, 2007 · by: Sven
I recieved an interesting Sitepoint newsletter the other day which talked about bundling CSS and Javascript ressources (or “assets” like that’s called in Rails talk) to achieve faster page loads. This caught my attention specifically because I experienced the need to repackage many small CSS files on the fly a while back when I worked on a large CMS-type system.
Skimming through the PHP source article and code I thought that something similar could be done as a Rails plugin pretty easily and elegantly. I couldn’t resist, sat down and started coding away … so here are my results.
Read the rest of this entryHow to add a floodgate to Mephisto's nearly perfect spam protection
posted: April 4th, 2007 · by: Sven
Mephisto comes with Akismet support baked right into its heart and it works like a charm. I’ve been totally pleased with it spotting nearly every spam comment and collecting them for later review and bulk deletion.
Now, 30 days later, I found it was time to clean up the spammy comments piles that Mephisto hunted down for me. Actually nearly 900 comments had piled up. Year, that’s 30 per day. I don’t think that’s that much compared to what others receive.
But to me 900 spam comments in 30 days is too much. I don’t want to spend the time to manually check 900 comments even if I’d have to do it only once a month. No way.
I thus revisited an idea that Damien Katz called “negative captcha”. I realized that I’ve actually had experiences with this type of “protection” and they’ve been pretty good.
Read the rest of this entryHowto use: Mephisto article list pagination plugin
posted: April 3rd, 2007 · by: Sven
I’ve been asked for instructions on how to use the Mephisto pagination plugin that I’ve published last week. Well, that makes sense :-) So there you go.
The plugin allows you to add very basic pagination functionality to your article section pages (that is, pages like your blog homepage, sub-section pages etc.). Right now, there are only means to add a “older posts” and “newer posts” links to access the previous and next paginated articles list’s pages - you can see this at the bottom of my blog’s homepage.
Read the rest of this entryMephisto article list pagination plugin
posted: March 28th, 2007 · by: Sven
When I switched to Mephisto last month I could not believe my eyes that there’s no post pagination on any of the section pages that list blog posts besides the archives.
Since, I wondered if that’s probably just a bit too closeminded to consider this a usability breakdown or something like this … might just be a matter of taste, too. But then I happened to run in this very issue twice the other day.
I consider this functionality crucial because it’s a well-known usability pattern all across the web these days. Millions of blogging engines do it this way (don’t they?), so it should be default in Mephisto, too, IMO … but actually it isn’t. So I decided to follow Rick’s suggestion and write a plugin to implement this.
Read the rest of this entryMephisto Globalization and new Globalize features
posted: March 21st, 2007 · by: Sven
In case that you’re interested in the Globalize plugin but you haven’t subscribed to the right blogs ;-) … let me link up some interesting articles for you.
Read the rest of this entryHow to set up your routes? - Get on Rails with Globalize! Part 4 of 8
posted: March 17th, 2007 · by: Sven
Routes are one of the harder-to-grasp areas of Rails. How should you set up your routes for Globalize? Do you need to change anything at all?
As often, the short answer is: it depends. It might well be that you can leave your routes setup completely untouched. Probably they’ll need some easy touches though.
This article tries to provide a (slightly) longer answer and shows some of the basic options you have. (There has been quite some request for a howto on this topic, so I’ve decided to change the original outline of this series).
Read the rest of this entryJoin the release-party: Globalize now ready for Rails 1.2!
posted: March 7th, 2007 · by: Sven
If you haven’t joined the masses yet camping in the front of the doors of the Globalize developers team, eagerly awaiting the Globalize for-1.2 release to get out of the doors … finally, time has come now.
Globalize is now fully compatible with the much celebrated Ruby on Rails 1.2 release! So get your party heads on, use your noise makers and start dancing!
Read the rest of this entryUpcoming Globalize feature: an alternative way of storing model translations
posted: January 31st, 2007 · by: Sven
Saimon Moore, one of the Globalize committers, pointed me to some terrific new Globalize functionality that most likely will make it into the next (for-1.2 that is) release of Globalize (which is expected to arrive pretty soon).
Saimon has described said feature himself in a blog article: Alternative implementation of Globalize Model Translations. But there’s a lot of code to read over there so I thought I’d sum things up a bit for you.
Read the rest of this entry