Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

Re: Dynamic translation keys

$
0
0

Whilst I await much better solutions, I thought I would share what I am doing for the time being...

TranslateExtension.php

<?php

class TranslateExtension extends DataExtension {

function T($key) {
return _t($this->owner->ClassName . "_ss." . $key);
}

}

WidgetHolder.ss

$T(TITLE)

en.yml

en:
FlickrWidget_ss:
TITLE: "Flickr Photos"
PicasaWidget_ss:
TITLE: "Comments"


Posted to: Dynamic translation keys | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles