1. Joerg
  2. CTransifex
  3. Saturday, 04 May 2013
  4.  Subscribe via email
Extension developers who use the Akeeba Live Update, usually place the xx-XX.liveupdate.ini into a folder like in the following examples:

domainname\administrator\components\com_ctransifex\liveupdate\language
domainname\administrator\components\com_virtuemart\liveupdate\language
domainname\administrator\components\com_akeeba\liveupdate\language

I suppose this makes sense, because extensions may use a customized version of the Akeeba Live Update system, including a slightly different xx-XX.liveupdate.ini.

Any idea how to instruct ctransifex to include the full path of the xx-XX.liveupdate.ini in the generated zip file? I've tried to add the full path in the Transifex config file - in my case:

file_filter = translations/administrator/components/com_virtuemart/liveupdate/language<lang>/<lang>.liveupdate.ini

This works with the Windows tx client, but using ctransifex the path for this file in the generated zip always is the Joomla admin language folder.
Responses (5)
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
That is interesting problem. Currently ctransifex can only package the language files of 1 extension & it tries to automatically figure out where to put the files:
https://github.com/compojoom/ctransifex/blob/master/source/administrator/components/com_ctransifex/helpers/package.php#L28

With the current code there is no way to put the liveupdate in the folder you want. Care to submit a pull request?

Daniel
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. CTransifex
  3. # 1
Accepted Answer Pending Moderation
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... :)
  1. more than a month ago
  2. CTransifex
  3. # 2
Accepted Answer Pending Moderation
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 :
[code type=php] $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;
}[/code]

By this :
[code type=php] $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;
}[/code]

Replace this :
[code type=php] 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');
[/code]

By this :
[code type=php] 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');[/code]

And then, Replace this :
[code type=php] $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);

[/code]

By this :
[code type=php] $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);[/code]

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 :
[code type=xml] <fileset>
@@ADMIN_FILENAMES@@
@@FRONTEND_FILENAMES@@
</fileset>
[/code]
By this :
[code type=xml] <fileset>
@@ADMIN_FILENAMES@@
@@FRONTEND_FILENAMES@@
@@LIVEUPDATE_FILENAMES@@
</fileset>
[/code]

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! B)

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)
  1. more than a month ago
  2. CTransifex
  3. # 3
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Wow, that is interesting! I will have a look at this again for the next update :)
Thanks!
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. CTransifex
  3. # 4
Accepted Answer Pending Moderation
Wow, that is interesting! I will have a look at this again for the next update :)
Thanks!


I've just discovered your component, and i think it's a good project !
Really interresting, and promissing!

I'm a developper too, of extensions, so i've got ideas for this component (but not always time!)

About liveupdate files, what can be done is to set "standard" in file_folder tags.

For example, using "administrator" is not good, because it is a joomla core folder.

I think, we can use exactly as it is for joomla language packs : "admin" and "site".

So that, we can add a function, if "admin" or "site" not found, to use the path indicated in file_folder tag.

Something like this :
[code type=php]
if (in_array('admin', $fileFilter)) {
$path = $adminPath.$fileName;
}
elseif (in_array('site', $fileFilter)){
$path = $frontendPath.$fileName;
}
else {
$path = $filePath.$fileName; // (or only $filePath, if use of all file_folder tag, but getting file path without filename can help to use filepath as target in xml)
}[/code]

Where file path is the path wanted by user for a specific file, in config file.

For example :

[code type=config]file_filter = administrator/components/com_XXX/liveupdate/language/<lang>/<lang>.liveupdate.ini
source_file = administrator/components/com_XXX/liveupdate/language/en-GB/en-GB.liveupdate.ini
host = https://www.transifex.com
source_lang = en_GB[/code]


Like this, you can add file everywhere you need (for example, in a module folder, to be able to replace missing strings in a module, by english strings)
;)
  1. more than a month ago
  2. CTransifex
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Last questions

Buchung PayPal wird nicht als bezahlt markiert
Hallo Daniel, ich hab jetzt auch nochmal eine Frage. Wir nutzen Matukio nu...
17 Replies
Posted on Thursday, 09 November 2023
Complete Uninstall to Work in J4??
We have recently updated a site from Joomlav3 to v4 (4.4.2). Now when we go to m...
4 Replies
Posted on Tuesday, 30 April 2024
  • New
  • verschiedene URL's für Kursübersicht einer Kategor
    Hallo, ich habe eine Frage in Bezug auf SEO: ein externer Spezialist macht die...
    1 Replies
    Posted on Monday, 29 April 2024
  • New
  • Google no index für bestimmte Seiten/Details
    Hallo ich habe eine kleine Frage: wo kann ich einstellen, dass Google die Seite...
    1 Replies
    Posted on Wednesday, 24 April 2024
    Changes to Submission Form?
    Are you able to make changes to the Hotspot submission form? There are several f...
    0 Replies
    Posted on Friday, 26 April 2024