}
- function get()
+ function get($module, $opts = Array())
{
+
+ if (!empty($module)) {
+ $this->init();
+ //DB_DataObject::debugLevel(1);
+ require_once 'Services/JSON.php';
+ $d = DB_DataObject::factory('translations');
+ $d->module = $module;
+ $d->selectAdd();
+ $d->selectAdd('distinct(tlang) as tlang');
+ header('Content-type: text/javascript');
+ $langs= $d->fetchAll('tlang');
+ foreach($langs as $lang) {
+ // output the translations strings file..
+
+
+ $this->loadOriginalStrings($module);
+
+ $data = $this->loadTranslateDB($lang,$module);
+
+ $j = new Services_JSON();
+ echo "_T.{$lang}= Roo.apply( _T.{$lang} || { }, " . $j->stringify($data, null, 4) . ");\n";
+
+ }
+ exit;
+
+ }
+
// load and parse json file containing all translations...
if (isset($_REQUEST['id'])) {
return $this->post();
$this->loadOriginalStrings($module); // what needs translating..
-
-
+ $ff = $this->bootLoader;
+ if (empty($ff->Pman['public_cache_dir'])) {
+ $this->jerr("public_cache_dir has not been set up");
+ }
}
- function post()
+ function post($v)
{
$d = DB_DataObject::factory('translations');
$d->module = $module;
$d->tlang = $lang;
-
+ $d->whereAdd('LENGTH(tval) > 0');
$ret = array();
+
if ($d->count()) {
// since key includes file
$ret = $d->fetchAll('tkey','tval'); /// shoudl we include updates
if (!isset($this->originalKeys[$k])) {
continue;
}
+
// it's current..
$this->saveTranslateDB($lang, $module, $this->originalKeys[$k], $k, $v);
$ret[$k] = $v;
//$this->writeTrans($lang);
}
-
+
}
\ No newline at end of file