"Done! Now it works AND looks good" - Mads
"Just like the EchoDitto Dev team." - Dan
Today I Learned: Translate custom (core) strings
On a site we're starting to build, Drupal's core "Sticky at top of lists" functionality isn't necessary (using Nodequeue for lists), but nodes need to be included or excluded from search results on a per-node basis. Rather than create a custom CCK field, and since we're building search (as usual) through Views, I decided the simplest answer was to rename "Sticky" to "Appear in Search Results," and filter accordingly in the view.
So how to do this? hook_locale() only works on non-English languages (see t()) and seems to define groups rather than strings.
The simplest solution, it seems, is to use settings.php (or in this case, a common.settings.php used by all the others). Like so:
<?php
$conf['locale_custom_strings_en'] = array(
'Sticky at top of lists' => 'Appear in search results',
);
?>Voila! It works even with the Locale module disabled. (It's not really needed since it's an English-only site.) And since the string is always run (by core and Views) through
t(), it applies universally. It's still `sticky` to the database but that doesn't matter.



Comments
Perfect. I was trying to do the same thing. Thanks for saving me a little headache.
I was not able to try this, but try this soon.
It supposes to be needful to accomplish a best range thesis while you study at the university. Therefore, your superb story related to this good post is a a really good issue for the dissertation reference performers.
Post new comment