Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

problem with localization to persian language #553

Open
farzanenadem opened this issue Feb 29, 2020 · 4 comments
Open

problem with localization to persian language #553

farzanenadem opened this issue Feb 29, 2020 · 4 comments

Comments

@farzanenadem
Copy link

i trying to localize kordy ticketit to persian language but some of my content are translated correctly and others have utf-8 problem and are display as "ت�کت �ا� �عا�" , i put charset utf-8 in every blade and also i put "\Blade::setEchoFormat('e(utf8_encode(%s))');" in my service provider but again i have the problem and at last i try to run php artisan vendor:publish this code in my comment prompt and also i publish Tag:lang soccessfully but my blade again have that unicode problem , i attach a screenshot of my blade at the end of this message,what should i do to solve this problem and localize my ticketit correctly?

Screenshot (38)

@thekordy
Copy link
Owner

thekordy commented Mar 2, 2020

@farzanenadem If you are using the ticketit-app, it's UTF-8 by default. and you could also view the page source and make sure the HTML charset attribute is set to utf-8.

You could try mb_detect_encoding($str, 'UTF-8', true); to make sure the translation text you added is UTF-8.

@farzanenadem
Copy link
Author

farzanenadem commented Mar 3, 2020

tnx a lot because of the answer , this problem is solved but i have another problem i tried to make custom dialog for ticketing in every page of my site
this is my vuejs code

askforsupport(){
if(this.$refs.asksupform.validate()){
this.loading = true
axios.post('/useraskforsupport', {
subject:this.subject,
comment:this.comment,
supportdetail:this.supportdetail,
 dataType: 'json',
}).then((response) => {
if(response.data.status  == 'found' ){ 
}else{
    }
}).catch((error) => {

});
    }
    },

and this is my backend code and my route

Route::post('/useraskforsupport/{id?}', '\Kordy\Ticketit\Controllers\TicketsController@supportform');

and
public function supportform(Request $request , $id){

        $subject= $request->subject; 
        $comment = $request-> comment; 
        $supportdetail = $request-> supportdetail; 
         $ticket = $this->tickets->findOrFail($id);
             $supportmessage = DB::table('ticketit')->insert([
                    'subject'=>$subject,
                    'content'=>$comment,
                    'html'=>$supportdetail,
                    'status_id'=> 1,
                    'priority_id'=>1,
                    'agent_id'=>1,
                    'category_id'=>1,
                    'user_id'=>auth()->user()->id
                            ]);
        return response()->json(['status'=>'Okay','supportmessage'=>$supportmessage]);
    }

my data is insert and set in database but i have this error in vue
datatables warning table id=datatables_table_0 - exception message
Screenshot (40)

@thekordy
Copy link
Owner

thekordy commented Mar 3, 2020

@farzanenadem did you add your code directly to the package source code (Kordy\Ticketit\Controllers\TicketsController)? If so, please don’t modify locally the Package source code.
In such case (you might have done that already) create another controller and add the new method there.

Regarding the error, If I were you I’d try first to search The issues here. if no solution found, then that needs debugging on your side for more information about the error causes.
Debug the frontend first by using the browser inspection tools:

  1. See if browser console logs reveal more related info.
  2. See the network tab if the data is returned correctly and if the http status is 200

Thereafter head to backend logs, in this case laravel log file could be useful.

@farzanenadem
Copy link
Author

i change my controller to
Route::post('/useraskforsupport', 'SupportController@supportform');
and i check my network i have 200 http status and my data is set in database but in my ticketlist i mean the blade of the list of ticket i have still this database error,
i think its comefrom where to select data to display in list but i dont know how to solve it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants