Curry gives me the best ideas
Posted on Thursday, July 24th, 2008 at 12:15 am
So, I made curry tonight, and it gave me a really good idea:
What options does a non-English speaking user have when visiting an English-only website?
My server logs tell me they use Babelfish.
The problem with Babelfish (or any net-translator) is that it breaks the website. It pushes it through a Find-and-Replace dictionary of terms that completely changes your site. It also tends to ignore cookies, and really butchers your Javascript because of cross-domain issues.
What can web developers do?
What can you do if you don't have the funds to hire an extensive localization team?
Why not use Javascript to cycle through all the elements on a page that need to be translated (menu items, headlines, form labels, etc), and push them through to a web service (like, Yahoo! Pipes) to translate it for you! Use JSONP to get the results back and replace the text of the elements dynamically as they're loaded/translated.
I actually made a more optimized version that took an array of items to speed up translation/load time, but Yahoo! Pipes was down when I tried to save it, so it wouldn't let me. (I would also like to have it talk to a Flash file to dynamically save/cache translations as they're made).
Machine translation isn't perfect, but it's better than making your users go to Babelfish just to figure out how to login.
What options does a non-English speaking user have when visiting an English-only website?
My server logs tell me they use Babelfish.
The problem with Babelfish (or any net-translator) is that it breaks the website. It pushes it through a Find-and-Replace dictionary of terms that completely changes your site. It also tends to ignore cookies, and really butchers your Javascript because of cross-domain issues.
What can web developers do?
What can you do if you don't have the funds to hire an extensive localization team?
Why not use Javascript to cycle through all the elements on a page that need to be translated (menu items, headlines, form labels, etc), and push them through to a web service (like, Yahoo! Pipes) to translate it for you! Use JSONP to get the results back and replace the text of the elements dynamically as they're loaded/translated.
$('h2, form p, form label, legend').each(function() {
var item = $(this);
var translate = encodeURI($(this).text());
$.getJSON('http://pipes.yahoo.com/pipes/pipe.run?_id=NsgXF0pZ3RG4DUvBjtzu1g&_render=json&translateStr=' + translate + '&_callback=?', function(data) {
item.text(data.value.items[0].translation);
});
});I actually made a more optimized version that took an array of items to speed up translation/load time, but Yahoo! Pipes was down when I tried to save it, so it wouldn't let me. (I would also like to have it talk to a Flash file to dynamically save/cache translations as they're made).
Machine translation isn't perfect, but it's better than making your users go to Babelfish just to figure out how to login.
How Dylan avoids widows
Posted on Tuesday, July 22nd, 2008 at 12:05 am
Typographical widows, that is. Learning jQuery (an excellent blog, even for the power users) had a wonderful post on how to use jQuery to append widows.
(If you didn't take a print class in high school, a widow is a word that ends on the next line like
this.
This is a print master's nightmare and a typographical no-no.)
Their solution uses regular expressions, which is nice, but not the most efficient way to split strings, and a bit of a memory hog on older systems.
Why not use CSS property
This snippit of jQuery wraps the last two words of every H2 tag with a span tag that has an inline style that prevents line-breaks. The result? No more widows without the performance hit of Regex.
(If you didn't take a print class in high school, a widow is a word that ends on the next line like
this.
This is a print master's nightmare and a typographical no-no.)
Their solution uses regular expressions, which is nice, but not the most efficient way to split strings, and a bit of a memory hog on older systems.
Why not use CSS property
white-space: nowrap;?
$('h2').each(function() {
var h2Contents = $(this).html().split(" ");
h2Contents[h2Contents.length-2] = '<span style="white-space: nowrap; color: red;">' + h2Contents[h2Contents.length-2];
h2Contents[h2Contents.length-1] = h2Contents[h2Contents.length-1] + '</span>';
$(this).html(h2Contents.join(' '));
});
This snippit of jQuery wraps the last two words of every H2 tag with a span tag that has an inline style that prevents line-breaks. The result? No more widows without the performance hit of Regex.
Pure CSS LightBox, no javascript
Posted on Thursday, February 21st, 2008 at 10:07 am
Current Javascript solutions for LightBoxes are kind of cumbersome, bloated, and CPU-intense.
Unsatisfied with the current state of LightBoxing, I developed a pure, organic, CSS-powered LightBox. Absolutely zero javascript. All of this under 1kb.
Click here to preview the CSS LightBox
The core of Multi-state CSS is the
Unsatisfied with the current state of LightBoxing, I developed a pure, organic, CSS-powered LightBox. Absolutely zero javascript. All of this under 1kb.
Click here to preview the CSS LightBox
The core of Multi-state CSS is the
:target pseudo class. When a user clicks a page-anchor the :target pseudo class is activated, revealing the lightbox element. Here's the code:
div.lb {
display: none;
}
div.lb:target {
display: block !important;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
text-align: center;
background: url('screen.png');
position: fixed;
padding: 2em;
}
The business card that never was
Posted on Thursday, December 27th, 2007 at 10:46 am

This is my ill-fated business card for Jaguar Design...the company that I'm leaving next week for a better-paid position in San Francisco.
Jaguar is a really small company, so my ability to wear many different hats was indispensable. One day I would be their print master, then I was their web master...so we decided my utility should be expressed on my business card.
Three check boxes for my most frequent titles, and a blank line for anything else that might come up.
omg, Chumby
Posted on Sunday, December 9th, 2007 at 5:23 pm

It's a Flash Embedded device for $180.
Touch screen, accelerometer, microphone, speakers, light sensor, wifi, leather panels...mmm...
Anything I make in Flash I can put on this baby as a fun new toy. Like an alarm clock that streams music from my web server, or a FAP browser that I'm pretty sure only I would use.
FAP Forever, HTML redux
Posted on Sunday, December 9th, 2007 at 5:22 pm
I'm considering replacing the current paginated results when you browse with this FAP Forever style of browsing.
Thoughts?
FAP Forever
Thoughts?
FAP Forever
New toy: Mass FAPloader
Posted on Sunday, December 9th, 2007 at 5:21 pm

My Apollo/Flex mass upload tool was taking too long to code, so I sat down and made this simple mass upload tool for FAP.
The tool I'm working on in Apollo/Flex will let you select an entire folder and upload that to FAP. Until then, please enjoy Mass FAPloader.
FAP Trail
Posted on Sunday, December 9th, 2007 at 5:06 pm

One part breadcrumb trail, one part FAP.
FAP Trail starts with a page of random works. By clicking on works that you like it learns and offers works that you might be more interested in. Eventually you will recieve a gallery of works that accurately reflects your tastes in art.
This was built using fAPI, the open API for Furry Art Pile.
Goofing off with AS3
Posted on Sunday, December 9th, 2007 at 4:59 pm
I have a weird relationship with AS3. As a designer, I hate how different it is, but, as a developer, I love how much easier it is to work with:
A Quick FAP
Posted on Sunday, December 9th, 2007 at 4:55 pm
To help inspire growth on FAP, I've released A Quick FAP. It's kind of like how people share videos on YouTube, now artists can share their works on their blog.
A Recommended FAP
Posted on Sunday, December 9th, 2007 at 4:51 pm
fAPI has been getting a lot of attention since I released it!
Inspired by all this activity, I created Recommended FAP. Enter your username, and it finds works that you will like based on your favourites.
Let me know how accurate/wrong it is in the comments.
Inspired by all this activity, I created Recommended FAP. Enter your username, and it finds works that you will like based on your favourites.
Let me know how accurate/wrong it is in the comments.
The algorithm
Posted on Sunday, December 9th, 2007 at 4:51 pm
I finished the tags.xml data feed for fAPI today.
One of the interesting new features offered by tags.xml is finding related tags. A simple query on tags.xml?related=fox returns vixen, kitsune, vulpine, canine and tiger. The algorithm relies on people tagging things...so the more that people tag, the more accurate it becomes.
After that, I tried plugging in a few power tags to some surprising results...
tags.xml?related=favbyekigyuu finds tags that I'm most interested in, and tags.xml?related=userekigyuu finds tags that I use frequently.
Won't be long until FAP is offering super accurate suggestions for works and artists that you would really like.
One of the interesting new features offered by tags.xml is finding related tags. A simple query on tags.xml?related=fox returns vixen, kitsune, vulpine, canine and tiger. The algorithm relies on people tagging things...so the more that people tag, the more accurate it becomes.
After that, I tried plugging in a few power tags to some surprising results...
tags.xml?related=favbyekigyuu finds tags that I'm most interested in, and tags.xml?related=userekigyuu finds tags that I use frequently.
Won't be long until FAP is offering super accurate suggestions for works and artists that you would really like.
Search
Tag Cloud
ajax as3 businesscard captcha chumby css design fap fapi flash hack hotlinking interface javascript jquery json lightbox myspace pipes site translation typography usability webservice wigits xss yahoo