MantisBT: master af03f786

Author Committer Branch Timestamp Parent
dregad dregad master 2011-12-01 23:23 master 453e7d8f
Affected Issues  0013643: Definition of MANTIS_ERROR strings in plugin language file causes check in test_lang.php to fail
Changeset

Improve admin checks for language strings

This brings the following improvements to test_lang.php:

  • Simplify the code by defining a new checkplugins() function for
    plugins language checks, allowing to use a revised checklangdir()
    for both the main and the plugin language strings (removes the
    recursive call)

  • Use PHP scandir() function to retrieve a sorted array of files
    instead of manually building it using opendir() and a loop on
    readdir()

  • Process the languages in alphabetical order

  • Array having strings as keys are valid tokens. Fixes 0013643
    This avoids reporting errors is useful for plugin error strings like
    $MANTIS_ERROR['plugin_example_error1'] = 'Error message';

  • Better formatting of error messages

  • Whitespace and coding guidelines fixes

NOTE: This commit has been ported to master for consistency, although
the new format of the strings_english.txt file is not compatible with
the logic in test_lang.php.

mod - admin/test_langs.php Diff File