I’m almost finished building a multilingual website, but came across a problem when using comment_url_title_auto_path. It’s basically the same issue described in this archived forums post.
If viewing my site in Spanish, it makes sense that a “Read more” link would direct to the corresponding entry in Spanish. But, when using comment_url_title_auto_path, the country code doesn’t tag along.
I’m using the Alternative method so my urls look like this: site.com/countrycode/index.php/...
In the archived forum post, it looked like the poster had got something to work by modifying mod.weblog.php, it looked like this:
if ($key == "comment_url_title_auto_path")
{
$path = ($row['comment_url'] == '') ? $row['blog_url'] : $row['comment_url'];
if(isset($global_vars["country_code"])) {
$url_segments = split("/", $row['blog_url']);
switch(true) {
case count($url_segments) < 3:
$path = "/" . $global_vars["country_code"] . '/' . $path;
break;
default:
$url_segments[3] = $global_vars["country_code"].'/'.$url_segments[3];
$path = implode("/", $url_segments);
break;
}
} else {
$path = ($row['comment_url'] == '') ? $row['blog_url'] : $row['comment_url'];
}
$tagdata = $TMPL->swap_var_single(
$key,
$path.$row['url_title'].'/',
$tagdata
);
}I’m using the latest version of EE2, and I’m PHP illiterate. I was hoping to get some help here on how I could modify the correct file (I’m assuming it is mod.comment.php) for EE2.