*

Wiz

  • ****
  • 143 posts
In English, the listing url is https://osclass.test/en/vehicles/cars/mercedes_i2

In Arabic, the same listing url is https://osclass.test/ar/%d9%85%d8%b1%d9%83%d8%a8%d8%a7%d8%aa/%d8%b3%d9%8a%d8%a7%d8%b1%d8%a7%d8%aa/%d8%b3%d9%8a%d8%a7%d8%b1%d8%a7%d8%aa-%d9%81%d9%8a-united-arab-emirates-dubai-dubai_i2

The problem isn't the Arabic part of the Arabic url but is with country, region, city being added instead of listing title "mercedes" ... so for some reason, under Arabic, listing title is replaced with country, region, city.

I think it has something to do with the regex rules used in permalink creation, specifically, the case when the Arabic listing title is not available or stored.

Ideally, the English title should be returned when no value is returned in other languages.
« Last Edit: June 20, 2024, 05:15:56 PM by Wiz »

*

MB Themes

I would say its just standard routine when title does not exists in selected locale
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Wiz

  • ****
  • 143 posts
I would say its just standard routine when title does not exists in selected locale

If so, then why do we have multiple cases for this scenario? Is another function used to return the listing title to construct the URL?

function osc_item_title($locale = "") {
  if ($locale == "") $locale = osc_current_user_locale();
  $title = osc_item_field("s_title", $locale);
  if($title=='') {
    $title = osc_item_field("s_title", osc_language());
    if($title=='') {
      $aLocales = osc_get_locales();
      foreach($aLocales as $locale) {
        $title = osc_item_field("s_title", @$locale['pk_c_code']);
        if($title!='') {
          break;
        }
      }
    }
  }
  return (string) $title;
}

Of which none are returning the desired default value ie. the English value, or any other value stored in different locales.

What's strange is that the same function returns English titles correctly for listings under Arabic when no Arabic title is stored ... so something to do with the construction of the url.

Update: for those interested, I found the culprit function - osc_item_url_from_item ... now to code a fix for the bug.

Thanks anyway
« Last Edit: June 20, 2024, 05:55:38 PM by Wiz »

*

MB Themes

There are pros and cons. Depends on user preference.
I think most important issue that could arrive is that on site, with russian, arabic and english, for listing published in arabic only, user with russian locale would see arabic URLs.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots