Code layout
Architecture
The module has no Composer dependency. The module class routes AJAX calls to classes specialised by domain (content, modules, themes, emails).
| Class | Role |
|---|---|
Freshappiatranslator | Module class: hooks, internal AJAX dispatcher (module_action parameter, about twenty actions). |
TranslateApi | Orchestrates a single translation: smart dictionary, excluded words, HTML-safe splitting, transliteration, internal URL rewriting. |
AbstractProvider + 8 adapters | DeeplV2Provider, GoogleV2Provider, OpenAiProvider, MicrosoftV3Provider, LibreTranslateProvider, MammouthProvider, ReviradaProvider, CopyProvider. |
HtmlParser / HtmlSplitter | Extracts and reinjects the text nodes of HTML content; splits text at the provider's maximum characters per request. |
AbstractTableAdapter / GenericLangAdapter | Registry of translatable tables: 26 dedicated adapters (products, categories, CMS…) plus automatic discovery of any *_lang table. |
TableTranslation / TableBackup | Paginated translation of a table between two languages; SQL backup (gzipped when available) before a bulk run. |
FailedTranslation | Logs translation failures (failed_translation table) for review and retry. |
ModulesTranslator / ThemesTranslator / MailsTranslator | Inventory of translatable modules, themes and mail templates. |
TranslateContentCron / TranslateCommand | Bulk translation from the command line (bin/console freshappiatranslator:translate) or via cron.php, with no browser execution-time limit. |