I have a multilingual site where I use Advanced Sort Options, like these:
Post date Desc|Newest first
Price Asc|Lowest Price

The problem is that "Newest first" and "Lowest Price" remain untranslatable into other languages.

Comments

Martin.’s picture

This is still an issue. Any updates ?

mikeker’s picture

Status: Active » Postponed (maintainer needs more info)

The main problesm that t() is not supposed to be used with variables. Specifically:

You should never use t() to translate variables, such as calling

t($text);
, unless the text that the variable holds has been passed through t() elsewhere (e.g., $text is one of several translated literal strings in an array). It is especially important never to call

t($user_text);
, where $user_text is some text that a user entered - doing that can lead to cross-site scripting and other security problems.

Granted the XSS opening would only be for those with Administer Views permissions.

I'm not sure how to handle this, but I'm open to any suggestions/advice/pointers. Thanks.

mikeker’s picture

Priority: Critical » Normal

I knew this issue sounded familiar: #1670140: Translate replacement_value in sort options and in filter options. Are you using the latest release of BEF?

Currently translation is only available for exposed sort rewrites and should be extended to exposed filter rewrites as well.

heddn’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
Related issues: +#2185077: Allow translations for all BEF settings
sgurlt’s picture

Could you give an example how the translated string should look like? I found this on the string translation page:

Distance Asc|Distance Distance Desc| Date Asc|Date Date Desc|

When I try to change it to german:

Distance Asc|Entfernung Distance Desc| Date Asc|Datum Date Desc|

Nothing happens.

heddn’s picture