Question: Slug In Hebrew Or Arabic

Slug In Hebrew Or Arabic

I've purchased the code and now noticed if someone post something with Hebrew or Arabic title, the post doesn't open, it gets error "Thread not found" can you help please

Y

yaronbal

Asked

I’ve purchased the code and now noticed if someone post something with Hebrew or Arabic title, the post doesn’t open, it gets error “Thread not found”

can you help please

  • Y

    yaronbal

    Answered

    it doesnt send also messeges in arabic or hebrew title, and also i can’t create category in arabic i understood this code supports multi language but it has lots of problem, can you help please?

  • MS

    Mian Saleem

    Answered

    Hello,

    Please edit the topic method of app/controllers/Forums.php and the following like around 218 before $topic = $this->forums_model->getTopicBySlug($slug);

    $slug  = urldecode($slug);
    

    If this don’t resolve the issue, then we can modify the slug method to generate random slug and not to use arabic chars.

    I didn’t get you second message. Please take screenshot so that I know what page are you talking about.

    Thank you

  • Y

    yaronbal

    Answered

    thats awesome! works great!

  • MS

    Mian Saleem

    Answered

    I am glad to now. Thank you for updating

  • Y

    yaronbal

    Answered

    Hello again, in the same topic, how can i make category slug in Arabic or Hebrew? it lets me enter slug only in english thanks

  • MS

    Mian Saleem

    Answered

    Hello,

    Yes, only sEnglish is support for slug that’s the reason for error for admins.

    To disable the validation, you will need to edit the add & edit methods of app/controllers/Categories.php and remove the alpha_dash rule for the slug.

    The line will look like this

    $this->form_validation->set_rules('slug', lang('slug'), 'trim|required|is_unique[categories.slug]');
    

    Thank you

  • Y

    yaronbal

    Answered

    i did as you instructed and unfortunaltely it still doesn’t work, i still get this message when i try to add category: Slug can only consist of alphabetical, numbers, underscores and dashes

  • MS

    Mian Saleem

    Answered

    Hello,

    That might be due to js validation, you can edit themes/default/views/categories/add.php and edit.php and remove the regex validation from data-fv-regexp="true" data-fv-regexp-regexp="^[a-zA-Z0-9\_-]+$" data-fv-regexp-message="' . lang('slug_regex') . '" slug form input.

    Thank you

  • Y

    yaronbal

    Answered

    hello, thank you! now it lets me create a category with slug in other langauge, But when i try to click on the category i get error 404, it says: We can’t seem to find the page your’re looking for.

  • MS

    Mian Saleem

    Answered

    Hello,

    It would be due to same reason as of topics.

    You can edit the index method of the app/controllers/Forums.php and add

    $category_slug  = urldecode($category_slug);
    

    Thank you

  • Login to Reply