Blog2009 ≫ Trying to avoid thinking about work for a whole hour

FAIL

I can't seem to do it, have et my tin of spaghetti bolognaise (nice one Sainsbury's for stocking a vegan friendly version of this convenient lunch again, it's been a while) and have things going round in my mind. BUT trying to take a proper break so as to keep me fresh for the afternoon. If I blog about what I'm thinking about at work do you think that will keep me fresh enough? Here's what's troubling me anyway, I want a smarty plugin1 that is REALLY REALLY REALLY simple so it can be called like

{translate 'hello'}

I've already got the back end actually doing the translation so that's fine, and I know I can do

{translate word='hello'}

but I want something even simpler. For a while I tried a modifier instead of a function like

{'hello'|translate}

But I want something more. A modifier like that doesn't have access to the $smarty object for one thing, so I can't see (for example) if other things have been assigned on the page without a whole lot of globalising...

Maybe @theHuzz2 has solved this3 while I've been writing this, as I twittered it too hoping someone would:

@pauly what about a block function then you could use {translate}hello{/translate} ?

It's a bit longer, and is slightly more complex for my target audience to use but it might do the job. In fact the example here4 is, um, a translation function.

I will carry on thinking about this after lunch.

Should have spent that time working on making my venue urls look like this as an seo experiment...

⬅️ :: ➡️

Paul Clarke's weblog - I live in A small town. Married + father to 2, I am a full-stack web developr, and I do js / nodejs, some ruby, other languages ect ect. I like pubs, running, eating, home automation and other diy jiggery-pokery, history, tree stuff, TV, squirrels, pirates, lego, + TIME TRAVEL.