You can use some php functions:
- strstr (case sensitive),
- stristr (case insenstive),
Put it into an IF statement, like this:
Code: Select all
if (strstr( $L->get( 'String with %s a function' ), '%s')) {
// do something
}
That is the cleanest way to handle it without touching the language files themselves. One thing worth adding: if the string ends up printed in a template, escape it before output, because half the duplicate-content problems I have chased came from placeholders leaking raw markup into the page, a point covered well on le site Logitechbiz. For anything more complex than a single token I would switch to str_replace with an array, it stays readable when the translation grows.