1. Detlef Volmer
  2. CTransifex
  3. Sunday, 13 January 2013
  4.  Subscribe via email
Hello,

First of all a gret thank you for this component. This is great and seems to be a great timesaver.

I installed it and it all works fine. But I have a question. In my Joomla! component I use for simplification reasons the same (identical) language file in frontend and backend.

I was not able to create a config file doing that. It always left either one out in the final install manifest file.

Here my interesting parts of the config:
[jpodium.adminen-gbcom_jpodiumini]
file_filter = admin\language\<lang>\<lang>.com_jpodium.ini
source_file = admin\language\en-GB\en-GB.com_jpodium.ini
source_lang = en_GB

[jpodium.en-gbcom_jpodiumsysini]
file_filter = admin\language\<lang>\<lang>.com_jpodium.sys.ini
source_file = admin\language\en-GB\en-GB.com_jpodium.sys.ini
source_lang = en_GB

[jpodium.siteen-gbcom_jpodiumini]
file_filter = site\language\<lang>\<lang>.com_jpodium.ini
source_file = admin\language\en-GB\en-GB.com_jpodium.ini
source_lang = en_GB


The unfortunate part is that in total three ressources are created on Transifex, but I need only two.

Thank you for any help or advise in this direction.

Regards from Germany

Detlef Volmer
Responses (4)
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Hey Detlef,
You should not need to copy the same file in the frontend. All you need is the joomla API :)
In your componentname.php file in the frontend you could do (example from hotspots):


$jlang = JFactory::getLanguage();
$jlang->load('com_hotspots', JPATH_ADMINISTRATOR, 'en-GB', true);
$jlang->load('com_hotspots', JPATH_ADMINISTRATOR, $jlang->getDefault(), true);
$jlang->load('com_hotspots', JPATH_ADMINISTRATOR, null, true);


first line loads the admin English file. (this ensures that all strings will have a meaningful translation and not COM_HOTSPOTS_MY_AWESOME_SOMETHING_TEXT...)
the second line loads the language of the site (which can be German for example) And the third line loads the user language. (it can be for example Japanese).

With those 3 lines you can use the same admin language file in the frontend and you don't need to copy files around. 1 location = less things to maintain and less thinks can brake.

Cheers,
Daniel

edit: With this approach you can do even merging. For example you can grab the frontend language file and add it to the backend. Or you can load the files of a module or plugin in your component. Whatever you need...
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,

your suggestion works fine and I have now greatly improved my language translation deployment.

Thanks again.

One problem is still there: manually creating the lang packs from the backend works fine. The webhook link instead creates a corrupt file named ".com_jpodium.zip" in the packages/jpodium folder of my media directory.

I copied the URL manually in the browser and got the same results.

I honestly have no idea what's going wrong.

Thank you again

Detlef
  1. more than a month ago
  2. CTransifex
  3. # 2
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Well, I have not experienced that problem with the webhooks here on compojoom, but I also have the feeling that something there is not 100% ok. So far I haven't been able to track it down. With that said I'm starting to think that the webhooks are not the right way to sync the packs. Maybe a cronjob would be better.

Btw - you are welcome to debug and find out why it is not saving the files properly for you. A pull request is after that always welcome: https://github.com/compojoom/ctransifex

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. # 3
Accepted Answer Pending Moderation
OK, understood. I'll give it a try over the next weekend.

Detlef
  1. more than a month ago
  2. CTransifex
  3. # 4
  • Page :
  • 1


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

Last questions

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
  • New
  • Question regarding custom fields
    How do I access custom fields after I have created them?...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
    • #custom fields
    Google no index für bestimmte Seiten/Details
    Hallo ich habe eine kleine Frage: wo kann ich einstellen, dass Google die Seite...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
  • Language parameter in the link to the comment
    Hello. 1) I have a multilingual website (3 languages). If someone added a comme...
    1 Replies
    Posted on Saturday, 06 April 2024
    categories icon in header
    Hi! I saw this in the promo, but I can't find how to set it up. https://compo...
    0 Replies
    Posted on Monday, 22 April 2024
  • New
    • #style
    • #Categories