ePages 7.28.0 - DE_EPAGES/Dictionary/API/Compare.pm

Package DE_EPAGES::Dictionary::API::Compare

Functions to compare dictionaries

@EXPORT_OK
ListMissingKeywords
ListMissingKeywordsFromTranslationFile
CompareDictionaryFile
CompareTranslationFile

Functions

CompareDictionaryFile
CompareTranslationFile
ListMissingKeywords
ListMissingKeywordsFromTranslationFile

CompareDictionaryFile

This function compares two localization files, finds missing keywords in file1 & file2 and returns all errors

Syntax
$aMissingList = CompareDictionaryFile ($Language1, $Language2, $BaseFilename);
Example
$aMissingList = CompareDictionaryFile ("en", "de", "example");
Input
$Language1 (string)
language code (en,de ...)
$Language2 (string)
language code (en,de ...)
$BaseFilename
filename without language code and .xml extension
Return
$aMissingList (ref.array.string)
list of errors

CompareTranslationFile

This function compares two localization files, finds missing keywords in file1 & file2 and returns all errors

Syntax
$aMissingList = CompareTranslationFile ($Language1, $Language2, $BaseFilename);
Example
$aMissingList = CompareTranslationFile ("en", "de", "example");
Input
$Language1 (string)
language code (en,de ...)
$Language2 (string)
language code (en,de ...)
$BaseFilename
filename without language code and .xml extension
Return
$aMissingList (ref.array.string)
list of errors

ListMissingKeywords

This function compares two localization files and finds missing keywords in file2 and returns a ref.array with all missing keywords

Syntax
$aMissingList = ListMissingKeywords ($FilePath1, $FilePath2, $Language1, $Language2);
Example
$aMissingList = ListMissingKeywords ("example.en.xml", "example.de.xml", "en", "de");
Input
$FilePath1 (string)
file name
$FilePath2 (string)
file name
$Language1 (string)
language code (en,de ...)
$Language2 (string)
language code (en,de ...)
$OnlyJS (boolean)
(optional, dault=false) read ony translation tags that are
marked with the JS="1" attribute
Return
$aMissingList (ref.array.hash.string)
each list element has the following structure
  • Error - error message
  • File - file name where the error occured

ListMissingKeywordsFromTranslationFile

This function compares two translation files and finds missing keywords in file2 and returns a ref.array with all missing keywords

Syntax
$aMissingList = ListMissingKeywordsFromTranslationFile ($Filename1, $Filename2, $Language1, $Language2);
Example
$aMissingList = ListMissingKeywordsFromTranslationFile ("example.en.xml", "example.de.xml", "en", "de");
Input
$Filename1 (string)
file name
$Filename2 (string)
file name
$Language1 (string)
language code (en,de ...)
$Language2 (string)
language code (en,de ...)
Return
$aMissingList (ref.array.hash.string)
each list element has the following structure
  • Error - error message
  • File - file name where the error occured