CSS is no cure for layout techniques abuse

Browsing the web for CSS related info often turns out to be a painful search through naive CSS glorification and anti table propaganda... :-/

So I always find it very refreshing when I stumble upon a more balanced article like Sitepoint's "Exploring the Limits of CSS Layout":

For better or worse, the vogue of Web design has evolved to favour a layout similar in style to a newspaper. Common design elements include:

  • a header and footer that each spans the page horizontally
  • content constrained by page width
  • vertical scrolling is acceptable, within reason
  • navigation and secondary content in vertical columns next to the main content

That last one is the real kicker. The sad reality is that the current CSS specificaton (CSS2) was not designed with multiple columns of content in mind. As a result, just as Web designers have always had to abuse HTML tables to achieve complex page layout, they must now abuse CSS positioning to achieve those same ends.

Read more »

GNU gettext

gettext is a package that includes everything you need to internationalize a piece of software and then let translators localize it on the run without worrying too much about it.

It's not perfect (for example, it's poor at using multiple languages simultaneously, i-e in the same output), but it's still very useful... and the best I found! ;)

When the browser wars began...

Eric Sink has this very interesting piece about how he witnessed the beggining of the browser wars, working at Spyglass (the company that licensed the original IE rendering engine to Miscrosoft).

About Spyglass:

"We considered ourselves to be the arms dealer for the browser wars."

Coding is an art, not a science!

If you don't believe me, have a look at what tools *real* coders use...

I'm not talking about emacs, I'm not talking about vi...

I'm talking about the real thing!

Read more »

Preparing Translatable Strings

I am currently considering using GNU gettext utilities to internationalize b2evolution.

I'm not done reading the docs, but right now I just felt like I needed to work this out:

The gettext manual has this totally valid understanding about preparing translatable string:

Hardcoded string concatenation is sometimes used to construct English strings:

strcpy (s, "Replace ");
strcat (s, object1);
strcat (s, " with ");
strcat (s, object2);
strcat (s, "?");

In order to present to the translator only entire sentences, and also because in some languages the translator might want to swap the order of object1 and object2, it is necessary to change this ...

This sounds very wise... but the "solution" leaves me baffled:

...change this to use a format string:

sprintf (s, "Replace %s with %s?", object1, object2);

Okay... how exactly am I supposed to swap the order of the objects? Swap %s with %s... ? yeah, right... :crazy:

(For those of you familiar with C but not with translation, rememenber that the translator can only act upon the string "Replace %s with %s?", not upon the sprintf statement.)

Update: Doh! Just learnt something kewl about printf syntax! :. Solution is easy:

sprintf (s, "Replace %1$s with %2$s?", object1, object2);

And there's no reason to specify those order numbers until you need to change the order... well, actually there is a reason: give a hint to the translator who "may not" be a printf syntax expert... :!: