Elxis CMS Forum

Support => Language => Topic started by: openita on December 29, 2015, 22:08:29

Title: Hotels 2.0 error language
Post by: openita on December 29, 2015, 22:08:29
Hi!
I have a problem with Hotels 2.0
When I enter iosr> hotels> and I insert a hotel, in the window description and terms, Terms and conditions, write text in different languages, but when I save the whole, the site appears to me in Italian or better in the primary language and not in the various languages included. You may depend on what?
Thanks for your help.
Title: Re: Hotels 2.0 error language
Post by: webgift on January 05, 2016, 09:04:25
Hello openita,
You have to initially write the terms and condition to your primary language and click apply.
While this process has been completed open the relative tab and choose from the list the
language you are interested in. Start translating the article into the other language of your
site and click on the save button [see attached image].
Now you can save the hotel with multilingual content.

(http://s22.postimg.org/l65bgz9r5/save_multiligual.jpg)
Title: Re: Hotels 2.0 error language
Post by: openita on January 14, 2016, 12:37:32
Thanks for the answer, but not working.
I did all the steps but the problem persists.
Main language Italian.
Secondary language German.
If I write in Italian and save, it all works out, I go in German, save the German, and I superimposed the Italian.
The problem is that when I do all these steps in the box description work perfectly, while pane terms and conditions Nos work makes me the above error.
Thank you
Title: Re: Hotels 2.0 error language
Post by: datahell on January 14, 2016, 20:22:25
I can't re-produce this problem, for me it works fine.
In a few hours IOSR Hotels v2.2 will be released. Update to that version and if the problem remains reply below.
Title: Re: Hotels 2.0 error language
Post by: openita on February 01, 2016, 19:07:52
Hello!
I installed IOSR Hotels v2.2 but the problem persists. How can we solve that? Thank you very much for helping.
Title: Re: Hotels 2.0 error language
Post by: datahell on February 01, 2016, 19:26:08
@openita Please send me a personal message with access details for your site administration section to see the problem by myself.
Title: Re: Hotels 2.0 error language
Post by: openita on February 02, 2016, 15:30:11
Ok!
I sent access details
Title: IOSR Hotels - Fix multilingual terms and conditions
Post by: datahell on February 02, 2016, 20:48:23
I did the check on your site, you are right. "Terms and conditions" is not multilingual. I fixed it and I will soon release an updated version of IOSR Hotels. I have no access to your site FTP so follow my instructions below to fix it.

Fix multilingual terms and conditions in IOSR Hotels 2.0/2.2
Open file components/com_reservations/ext/hotels/controllers/hotels.php

Go to lines 965-970:
$row = $this->model->fetchHotel($hid);
if (!$row) {
   $this->sendHeaders('text/plain');
   echo '<div class="elx_error">'.$eLang->get('HOTEL_NOTFOUND').'</div>';
   exit;
}

Add below:
if ($this->translate) {
   $translations = $this->model->elementTrans($row->hid, $this->lng);
   if ($translations) {
      foreach ($translations as $element => $translation) {
         switch($element) {
            case 'hottitle': $row->title = $translation; break;
            case 'hotdesc': $row->description = $translation; break;
            case 'hotterms': $row->terms = $translation; break;
            default: break;
         }
      }
   }
   unset($translations);
}

Thank for reporting this issue and sorry for the trouble.
Title: Re: Hotels 2.0 error language
Post by: openita on February 05, 2016, 12:03:30
Thanks to you for solving the problem ;)