Difference between revisions of "Esmith::FormMagick::LexTester"

From SME Server
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
 
=== SYNOPSIS ===
 
=== SYNOPSIS ===
 
           use esmith::FormMagick::LexTester;
 
           use esmith::FormMagick::LexTester;
 
+
 
           my $lt = esmith::FormMagick::Lextester->new();
 
           my $lt = esmith::FormMagick::Lextester->new();
 
+
 
           foreach my $lang (qw(en fr de)) {
 
           foreach my $lang (qw(en fr de)) {
 
               my $ok = $lt->lextest($lang);
 
               my $ok = $lt->lextest($lang);
Line 33: Line 33:
 
[[Category:SME Server Development Framework]]
 
[[Category:SME Server Development Framework]]
 
[[Category:Development Tools]]
 
[[Category:Development Tools]]
[[Category:SME9-Development]]
 

Latest revision as of 12:03, 1 February 2014

PythonIcon.png Skill level: developer
Risk of inconsistencies with Koozali SME Server methodology, upgrades & functionality is high. One must be knowledgeable about how changes impact their Koozali SME Server. Significant risk of irreversible harm.


NAME

      esmith::FormMagick::LexTester - test FormMagick lexicon completeness

In a root terminal you can do the command below if you want to display the up-to-date content

perldoc esmith::FormMagick::LexTester

SYNOPSIS

          use esmith::FormMagick::LexTester;

          my $lt = esmith::FormMagick::Lextester->new();

          foreach my $lang (qw(en fr de)) {
              my $ok = $lt->lextest($lang);
              unless ($ok) {
                  my @untranslated = @{$lt->{untranslated}};
                  warn "Untranslated terms for $lang: @untranslated\n",
              }
          }

DESCRIPTION

esmith::FormMagick::LexTester is a subclass of esmith::FormMagick whose speciality is checking the completeness of localisation lexicons.

new();

Exactly as for esmith::FormMagick

$lt->lextest($lang)

Given a two-letter language code, checks the completeness of the lexicon for that language. Returns true on success, false on failure. If it fails, it sets $lt->{untranslated}, which is an arrayref containing a list of strings to be translated.

SEE ALSO

      CGI::FormMagick
      Esmith::FormMagick