NP_Text.php

Internationalise your skins by using skin language files.

General Plugin info
Author: Armon Toubman
Current Version: 0.51
Code: NP_Text_code
Forum Thread: http://forum.nucleuscms.org/viewtopic.php?t=14904

Installing

  1. Copy and paste the code into a text editor and save it as NP_Text.php
  2. Install the plugin (How do I install a plugin?)

How to use the plugin

Requires skin language file (skins/skin/language/language.php) where language is the language set by member, if it is not set it will default to globally set language.

Language file must be of the following form:

<?php
 
define("SL_NAME", "value");
// ... etc.
 
?>

I (Armon) have chosen SL_ as the prefix because Nucleus internally uses the _WHAT_ prefix (where WHAT can be SKIN, ADMIN, etc.).

If the skin language file is not found no text will be output but an error will be thrown in the Action Log.

Available SkinVars and/or TemplateVars

  • <%Text(CONSTANT)%>: Display constants from language files. E.g. define the phrase “add comment” as variable SL_ADDCOMMENT in skin language file, then display in your skin using <%Text(ADDCOMMENT)%>

Options

Tips and Tricks

Wishlist

Bugs

History

  • Version 0.2, released 18-Jan-2007
    • Initial release
  • Version 0.3, released 19-Jan-2007
    • Able to change language when logged out
  • Version 0.4, released 24-Jan-2007
    • Action log bug fix
  • Version 0.5, released 1-Feb-2007
    • Added templatevar
  • Version 0.51, released 2-Feb-2007
    • Added SL_ constant prefix
text.txt · Last modified: 2008/01/03 23:35 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki