Lochneil sandbox

From TNG_Wiki
Jump to navigation Jump to search

This page is where I develop a new article or edit an existing one, as a temporary scratchpad.

Checking cust_text.php files

This page describes a mod which adds a new tab Check Custom Text Files to the Languages page of the Admin menu. The mod seeks to report errors in files in the languages folder, and reports its results in tables.

The first report is from Setup >> Configuration >> General Settings >> Language options, thus:

Default Language English I'm sure we will need to know this
Character Set ISO-8859-1 Should check that database and all language files are consistent with this choice
Dynamic Language Change Allow (or Disallow) I'm sure we will need to know this

The second report checks files in the languages folder, like this example:

Folder German English Spanish French Italian Dutch Norwegian
Display name Deutsch English Español Français Italiano Nederlands Norsk
File admintext.php Present Present Present Present Present Present Present
File alltext.php Present Present Present Present Present Present Present
File cust_text.php Present Present Present Present Present Missing! Missing!
File text.php Present Present Present Present Present Present Present
Example Example Example Example Example Example Example Example
Example Example Example Example Example Example Example Example
Example Example Example Example Example Example Example Example
Example Example Example Example Example Example Example Example
Example Example Example Example Example Example Example Example

The third report compiles a list of all definitions in all cust_text files, and then shows a table with a column for each language and a row for each definition, with "MIssing" in cells where the definition is missing.

Rules

  • File cust_text.php must not be in the TNG root folder (see Custom text not being displayed)
  • File cust_text.php should not be in the languages folder
  • The first characters in cust_text.php must be "<?php"
  • The last characters in cust_text.php must be "?>"
  • The above two tests need repeating for cust_text.php (if found) in each language in use
  • Each line beginning with "$" must terminate with ";"