Code layout

Architecture

The module has no Composer dependency. The module class routes AJAX calls to classes specialised by domain (content, modules, themes, emails).

ClassRole
FreshappiatranslatorModule class: hooks, internal AJAX dispatcher (module_action parameter, about twenty actions).
TranslateApiOrchestrates a single translation: smart dictionary, excluded words, HTML-safe splitting, transliteration, internal URL rewriting.
AbstractProvider + 8 adaptersDeeplV2Provider, GoogleV2Provider, OpenAiProvider, MicrosoftV3Provider, LibreTranslateProvider, MammouthProvider, ReviradaProvider, CopyProvider.
HtmlParser / HtmlSplitterExtracts and reinjects the text nodes of HTML content; splits text at the provider's maximum characters per request.
AbstractTableAdapter / GenericLangAdapterRegistry of translatable tables: 26 dedicated adapters (products, categories, CMS…) plus automatic discovery of any *_lang table.
TableTranslation / TableBackupPaginated translation of a table between two languages; SQL backup (gzipped when available) before a bulk run.
FailedTranslationLogs translation failures (failed_translation table) for review and retry.
ModulesTranslator / ThemesTranslator / MailsTranslatorInventory of translatable modules, themes and mail templates.
TranslateContentCron / TranslateCommandBulk translation from the command line (bin/console freshappiatranslator:translate) or via cron.php, with no browser execution-time limit.
Loading...
Back to top