PDA

View Full Version : Multifield/Location Filter doesn't work for multilingual



Pragash Jayaraman
December 14, 2019, 03:31 PM
Hello, I'm currently developing two language site.

When posting a ad, It doesn't change the language on drop-down location level 1 fields, instead its only showing in english language.
(I could see the level 1 locations on left sidebar, but not in dropdown)

Its bug or the multilingual feature not implemented for this plugin.?

I'm happy to see that you have implemented the multilingual URL's for categories but it would be good if we can have multilingual URL's for locations too.!

Athanasios Christou
December 17, 2019, 09:23 PM
Hello @all,

i have the same problem.

I think Multifield does not support Multilanguages or it is a Bug.

The second dropdown only english


See pictures :

3522

3523

3524

is the error here?
the second field is built here ...

/plugins/multiField/static/lib.js


$.each(response.data, function(index, item) {
$nextField.append(
$('<option>')
.val(item.Key)
//.attr('data-path', item.Path) // TODO, do we still need Path here?
.attr('selected', item.Default == '1')
.text (item.name)
);



Thanks for Help!

Best Regards
Sakis

Rudi
December 18, 2019, 04:25 AM
Hello all,

It's caused by the "Multilingual Paths" feature which will be solved soon

To fix it go to ftp > public_html > includes > classes > rlLang.class.php > public function defineLanguage

find first:


global $config, $languages;

/* fix for links with wrong language in url */
if ($GLOBALS['rlNavigator']->cLang && $GLOBALS['rlNavigator']->cLang != $config['lang']) {
if (!$languages[$GLOBALS['rlNavigator']->cLang]) {
$GLOBALS['sError'] = true;
}
}


change it to:


global $config, $languages, $rlNavigator;

/* fix for links with wrong language in url */
if ($rlNavigator->cLang && $rlNavigator->cLang != $config['lang']) {
if (!$languages[$rlNavigator->cLang]) {
$GLOBALS['sError'] = true;
}
}



then find:


// Redirect user to selected language earlier
if ($_COOKIE[$cookie_lang]
&& ($_COOKIE['userLangChoice'] && $_COOKIE['userLangChoice'] !== $language)
&& !defined('AJAX_FILE')
) {
Util::redirect($GLOBALS['reefless']->getPageUrl('home', '', $_COOKIE['userLangChoice']));
}


replace it with:


// Redirect user to selected language earlier
if ($config['preffered_lang_redirect']
&& $_COOKIE[$cookie_lang]
&& ($_COOKIE['userLangChoice'] && $_COOKIE['userLangChoice'] !== $language)
&& !defined('AJAX_FILE')
&& !defined('REALM')
&& empty($rlNavigator->cPage)
) {
Util::redirect($GLOBALS['reefless']->getPageUrl('home', '', $_COOKIE['userLangChoice']));
}

Athanasios Christou
December 18, 2019, 09:14 PM
Thanks Rudi,

Unfortunately it does not work.

Viktor
December 19, 2019, 03:09 AM
Hello all,

Open file: ftp://plugins>>miltiField>>static>>lib.js

find code at line ~87:


var data = {
mode: 'mfNext',
item: value
};


and replace to:


var data = {
mode: 'mfNext',
item: value,
lang: rlLang
};


save and check again :)

Athanasios Christou
December 19, 2019, 06:37 PM
Thanks @Viktor,

it works!!!


Best regards
Sakis

Pragash Jayaraman
March 16, 2020, 04:30 PM
I'm happy to see that you have implemented the multilingual URL's for categories but it would be good if we can have multilingual URL's for locations too.!

//

In the latest update of this plugin, multilingual URL implemented.

Thank you, Flynax Team

Without URL its working fine, but when i enable "Add Location to URL" its returning 404 page error.
Example URL:

www.example.com/en/location1
www.example.com/de/location1

Viktor
March 17, 2020, 02:42 AM
Would you please create a new ticket with the problem. Our plugin creator will solve it.