Joerg wrote: Hi Daniel,
unfortunately I'm not a coder (php illiterate), so I'm unable to write code for a pull request. But maybe somebody else can take care of this...
Don't know if you have found the solution, but if not, there is one :
In ROOT/administrator/components/com_ctransifex/helpers/package.php
Replace this :
$adminPath = JPATH_ROOT . '/media/com_ctransifex/packages/'.$project->transifex_slug.'/'.$jLang.'/admin/';
$frontendPath = JPATH_ROOT . '/media/com_ctransifex/packages/'.$project->transifex_slug.'/'.$jLang.'/frontend/';
if(in_array('admin', $fileFilter) || in_array('administrator', $fileFilter) || in_array('backend', $fileFilter)) {
$path = $adminPath.$fileName;
}
else {
$path = $frontendPath.$fileName;
}
By this :
$adminPath = JPATH_ROOT . '/media/com_ctransifex/packages/'.$project->transifex_slug.'/'.$jLang.'/admin/';
$frontendPath = JPATH_ROOT . '/media/com_ctransifex/packages/'.$project->transifex_slug.'/'.$jLang.'/frontend/';
if(in_array('admin', $fileFilter) || in_array('administrator', $fileFilter) || in_array('backend', $fileFilter)) {
$path = $adminPath.$fileName;
}
elseif (in_array('liveupdate', $fileFilter)){
$path = $filePath.$fileName;
}
else {
$path = $frontendPath.$fileName;
}
Replace this :
if(JFolder::exists($folder.'/admin')) {
JFolder::delete($folder.'/admin');
}
if(JFolder::exists($folder.'/frontend')) {
JFolder::delete($folder.'/frontend');
}
if(JFile::exists($folder.'/install.xml')) {
JFile::delete($folder.'/install.xml');
By this :
if(JFolder::exists($folder.'/admin')) {
JFolder::delete($folder.'/admin');
}
if(JFolder::exists($folder.'/frontend')) {
JFolder::delete($folder.'/frontend');
}
if(JFolder::exists($folder.'/liveupdate')) {
JFolder::delete($folder.'/liveupdate');
}
if(JFile::exists($folder.'/install.xml')) {
JFile::delete($folder.'/install.xml');
And then, Replace this :
$admin = self::getFiles($folder . '/admin');
if($admin) {
$adminFiles = '<files folder="admin" target="administrator/language/'.$jLang.'">'.$admin.'</files>';
}
$content = str_replace('@@ADMIN_FILENAMES@@', $adminFiles , $content);
$frontend = self::getFiles($folder . '/frontend');
if($frontend) {
$frontendFiles = '<files folder="frontend" target="language/'.$jLang.'">'.$frontend.'</files>';
}
$content = str_replace('@@FRONTEND_FILENAMES@@', $frontendFiles, $content);
By this :
$admin = self::getFiles($folder . '/admin');
if($admin) {
$adminFiles = '<files folder="admin" target="administrator/language/'.$jLang.'">'.$admin.'</files>';
}
$content = str_replace('@@ADMIN_FILENAMES@@', $adminFiles , $content);
$frontend = self::getFiles($folder . '/frontend');
if($frontend) {
$frontendFiles = '<files folder="frontend" target="language/'.$jLang.'">'.$frontend.'</files>';
}
$content = str_replace('@@FRONTEND_FILENAMES@@', $frontendFiles, $content);
$liveupdate = self::getFiles($folder . '/liveupdate');
if($liveupdate) {
$liveupdateFiles = '<files folder="admin" target="administrator/components/COM_NAME_OF_YOUR_COMPONENT/liveupdate/language/'.$jLang.'">'.$liveupdate.'</files>';
}
$content = str_replace('@@LIVEUPDATE_FILENAMES@@', $liveupdateFiles , $content);
Don't forget to replace COM_NAME_OF_YOUR_COMPONENT
You can do the same last change in ROOT/administrator/components/com_ctransifex/controllers/packager.raw.php
Then last edit in ROOT/administrator/components/com_ctransifex/assets/install.xml
Replace this :
<fileset>
@@ADMIN_FILENAMES@@
@@FRONTEND_FILENAMES@@
</fileset>
By this :
<fileset>
@@ADMIN_FILENAMES@@
@@FRONTEND_FILENAMES@@
@@LIVEUPDATE_FILENAMES@@
</fileset>
Then, in your Transifex config (added too in ctransifex), for file_folder, declare this :
SOURCE/liveupdate/language/<lang>/<lang>.liveupdate.ini
Hope this could help!
Note: this can be implement in a generic way, but it should maybe have to reconsider naming for frontend (as for admin, use of 'site' or 'frontend' and maybe not use of administrator to be able to use it in path for none language core folder)