⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Error with RTL view style When loading lang files



Mu_Nizar
  • profile picture
  • Member

Posted 19 June 2013 - 14:08 PM

Hi all ,

I am using grocery crud with CI and every thing is well.
I have more than one controller and they all use the same crud view with different $output

my crud view looks like:

<?php foreach ($css_files as $file): ?>
    <link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>
<?php foreach ($js_files as $file): ?>
    <script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>
<div class="headings">
    <h1><?php echo ucfirst(str_replace("_", " ", $current)); ?></h1>
</div>
<br/>
<div>
    <?php echo $output; ?>
</div>

and my controllers look like:
 

function __construct() {
        parent::__construct();
        $this->load->database();
        $this->load->helper('url');
        $this->load->library('grocery_CRUD');
        $this->load->library('validator');
        $this->load->library('form_validation');
        $this->lang->load('folders', 'arabic');/*lol*/
        $this->lang->load('common', 'arabic');/*lol*/
    }

public function index() {
$crud = new grocery_CRUD();
if (isset($this->session->userdata["gui_lang"]))
         $crud->set_language($this->session->userdata("gui_lang"));
      else
         $crud->set_language("arabic");
      $crud->set_table('message');
      $crud->set_subject('Draft');
      $crud->columns(.....);
      $crud->where(....);
      $crud->display_as('...', $this->lang->line('...'))
      $output = $crud->render();
      $this->load->view('header');
      $this->load->view('sidebar');
      $this->load->view('crud', $output);
      $this->load->view('footer');
}        

       
I want to convert layout to RTL, I download file from /topic/141-right-to-left-theme-for-rtl-languages/
and use it, the style damaged after I load language file !!!
 

Important Note: when I omit lines /*lol*/ in the construct (omit loading language files) the damage resloved! but no language then.

pleace any help...
thanks in advance


Mu_Nizar
  • profile picture
  • Member

Posted 20 June 2013 - 08:49 AM

thanks!

I found the answer :) it is strange :huh:

for each language file I do:

 - select all $lang lines

 - cut them

 - ctrl + a

 - delete

 - open <?php

 - ctrl + v

 - close ?>

 

may there were hidden charterers in the language files (Arabic files) (although they are working in English mode)

----


Mu_Nizar
  • profile picture
  • Member

Posted 20 June 2013 - 09:03 AM

I would ask why I didn't get any answer or any interaction :ph34r:


jad
  • profile picture
  • Member

Posted 20 June 2013 - 13:20 PM

hi all and Mu_Nizar :)

 

thanks you ,I face the same problem in my previous project, it confuse me :blink:

 

also and one more time thank you and crud founder


davidoster
  • profile picture
  • Member

Posted 20 June 2013 - 16:56 PM

Hello [member=mu_nizar]. I haven't used the RTL version of the language files so I can't comment on that!

Strange though!

 

Maybe the original file was on different encoding?