DEFAULT_THEME_NAME
DEFAULT_THEME_NAME
Name of theme by default
filterTranslationFiles( $list)
Filter the translation files contained in a .gzip pack and return only the ones that we want.
Right now the function only needs to check that the modules for which we want to add translations are present on the shop (installed or not).
$list is the output of Archive_Tar::listContent()
$list |
getTranslationsInformations()
Get all translations informations for all type of translations
array( 'type' => array( 'name' => string : title for the translation type, 'var' => string : name of var for the translation file, 'dir' => string : dir of translation file 'file' => string : file name of translation file ) )
checkDirAndCreate(string $dest) : boolean
This method is only used by AdminTranslations::submitCopyLang().
It try to create folder in new theme.
When a translation file is copied for a module, its translation key is wrong. We have to change the translation key and rewrite the file.
string | $dest | file name |
findAndWriteTranslationsIntoFile(string $file_name, array $files, string $theme_name, string $module_name, string|boolean $dir = false) : void
This method check each file (tpl or php file), get its sentences to translate, compare with posted values and write in iso code translation file.
string | $file_name | |
array | $files | |
string | $theme_name | |
string | $module_name | |
string|boolean | $dir |
findAndFillTranslations(array $files, string $theme_name, string $module_name, string|boolean $dir = false) : void
This method get translation for each files of a module, compare with global $_MODULES array and fill AdminTranslations::modules_translations array With key as English sentences and values as their iso code translations.
array | $files | |
string | $theme_name | |
string | $module_name | |
string|boolean | $dir |
userParseFile( $content, $type_translation, string|boolean $type_file = false, string $module_name = '') : \return
This method parse a file by type of translation and type file
$content | ||
$type_translation | : front, back, errors, modules... |
|
string|boolean | $type_file | : (tpl|php) |
string | $module_name | : name of the module |
$matches
displayMailContent(array $mails, array $all_subject_mail, \Language $obj_lang, string $id_html, string $title, string|boolean $name_for_module = false)
Display mails in html format.
This was create for factorize the html displaying
array | $mails | |
array | $all_subject_mail | |
\Language | $obj_lang | |
string | $id_html | use for set html id attribute for the block |
string | $title | Set the title for the block |
string|boolean | $name_for_module | is not false define add a name for disntiguish mails module |
displayMailBlockTxt(array $content, string $lang, string $mail_name, string $group_name, string|boolean $name_for_module = false)
Just build the html structure for display txt mails
array | $content | with english and language needed contents |
string | $lang | iso code of the needed language |
string | $mail_name | name of the file to translate (same for txt and html files) |
string | $group_name | group name allow to distinguish each block of mail. |
string|boolean | $name_for_module | is not false define add a name for disntiguish mails module |
displayMailBlockHtml(array $content, string $lang, string $url, string $mail_name, string $group_name, string|boolean $name_for_module = false)
Just build the html structure for display html mails.
array | $content | with english and language needed contents |
string | $lang | iso code of the needed language |
string | $url | for the html page and displaying an outline |
string | $mail_name | name of the file to translate (same for txt and html files) |
string | $group_name | group name allow to distinguish each block of mail. |
string|boolean | $name_for_module | is not false define add a name for disntiguish mails module |
recursiveGetModuleFiles(string $path, array $array_files, string $module_name, string $lang_file, boolean $is_default = false)
This get files to translate in module directory.
Recursive method allow to get each files for a module no matter his depth.
string | $path | directory path to scan |
array | $array_files | by reference - array which saved files to parse. |
string | $module_name | module name |
string | $lang_file | full path of translation file |
boolean | $is_default |
getAllModuleFiles(array $modules, string $root_dir = null, string $lang, boolean $is_default = false)
This method get translation in each translations file.
The file depend on $lang param.
array | $modules | list of modules |
string | $root_dir | path where it get each modules |
string | $lang | iso code of choosen language to translate |
boolean | $is_default | set it if modules are located in root/prestashop/modules folder This allow to distinguish overrided prestashop theme and original module |
parsePdfClass(string $file_path, string $file_type, $lang_array, string $tab, array $tabs_array, $count_missing) : array
Parse PDF class
string | $file_path | file to parse |
string | $file_type | type of file |
$lang_array | ||
string | $tab | name to use with the md5 key |
array | $tabs_array | |
$count_missing |
containing all datas needed for building the translation form