×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Code contribution

Code contribution 11 years 7 months ago #20317

  • Jeremy Magne
  • Jeremy Magne's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Hi,

Great extension. Thank you for providing this, it is very helpful.
Here is a small contribution to the project:

in the project detail view, I'd suggest to add 3 simple lines of code to add the current project to the breadcrumb:

/components/com_ctransifex/views/project/view.html.php
class ctransifexViewProject extends JViewLegacy {
 
    public function display() {
        $this->item = $this->get('Item');
		/* CUSTOM CHANGE BEGIN */
		$app = JFactory::getApplication();
		$pathway = $app->getPathway();
		$pathway->addItem($this->item->title);
		/* CUSTOM CHANGE END */
        $this->languages = $this->get('Languages');
        $document = JFactory::getDocument();
        $document->setTitle($document->getTitle() . ' ' . JText::sprintf('COM_CTRANSIFEX_TRANSLATIONS_FOR_PROJECT',$this->item->title));
        parent::display();
    }
}

I also wrote a small router.php file (attached) to transforms urls
?view=project&id=xx
=> /project-alias/

?task=download.download&language=xx
=> /project-alias/download/xx-XX

File Attachment:

File Name: router.zip
File Size: 1 KB
Attachments:

Code contribution 11 years 6 months ago #20435

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey there!
Do you think that you can add those suggestions as pull requests on github?
github.com/compojoom/ctransifex

Thanks!
Daniel

Code contribution 11 years 5 months ago #21097

  • Joerg
  • Joerg's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 1
Just thought you might be interested in reading this code:
http://paste.opensuse.org/2308fd44
This is what we've used before switching to ctransifex.
  • Page:
  • 1
Time to create page: 0.114 seconds