News Manager blog

Custom frontend strings (2.4.0+)

Since version 2.4.0 you can redefine all frontend language strings, allowing some basic customization. (With previous versions of the plugin, some of them could be modified by editing the language file, but then you had to be careful not to overwrite it when upgrading.)

To use this feature, you can insert some lines in your site's gsconfig.php file. Here's an example where we redefine the "Published on" string, the date format and those three dots after an excerpt:

$nm_i18n = array();
$nm_i18n["PUBLISHED"]   = "Posted on";
$nm_i18n["DATE_FORMAT"] = "%d.%m.%Y";
$nm_i18n["ELLIPSIS"]    = "...";

The first line is recommended.

This is the full list of frontend strings (with their default values):

$nm_i18n["FOUND"]       = "The following posts have been found:",
$nm_i18n["NOT_FOUND"]   = "Sorry, your search returned no hits.",
$nm_i18n["NOT_EXIST"]   = "The requested post does not exist.",
$nm_i18n["NO_POSTS"]    = "No posts have been found.",
$nm_i18n["PUBLISHED"]   = "Published on",
$nm_i18n["TAGS"]        = "Tags",
$nm_i18n["OLDER_POSTS"] = "← Older Posts",
$nm_i18n["NEWER_POSTS"] = "Newer Posts →",
$nm_i18n["SEARCH"]      = "Search",
$nm_i18n["GO_BACK"]     = "<< Go back to the previous page",
$nm_i18n["ELLIPSIS"]    = " [...]",
$nm_i18n["LOCALE"]      = "en_US.utf8,en.utf8,en_US.UTF-8,en.UTF-8,en_US,en",
$nm_i18n["DATE_FORMAT"] = "%b %e, %Y"

It's not necessary to insert all lines, only those corresponding to texts you want to redefine (as in the example above).

Note that if you have non-English (US-ASCII) characters you must use a text editor that supports UTF-8 without BOM (e.g. Notepad++ for Windows) or use html entities for charactes like ä, é, ñ, ...

« Back to News Manager blog

blog comments powered by Disqus