Documentation
LingoSync is an AI-powered translation addon for Sngine that brings multilingual translation directly into your social network, using OpenAI or DeepSeek as the translation engine.
Sngine ships with a client-side "Translate" feature that calls Google Translate / Yandex directly from the visitor's browser — which means your Google/Yandex API key sits in plain sight in the page source for anyone to copy. LingoSync replaces that feature entirely with a server-side translation engine: your AI provider key never leaves your server, every translation is cached to control cost, and you get real usage tracking and limits in AdminCP.
LingoSync translates Posts, Comments, Messages & Conversations, Blogs, Profiles, and Products — with Manual (click-to-translate), Automatic (translates instantly for every viewer), or a combined Manual + Automatic mode.
Features
- Server-side AI translation — your OpenAI/DeepSeek key is never exposed to the browser.
- Translates Posts, Comments, Messages, Blogs, Profiles and Products from a single settings panel.
- OpenAI and DeepSeek support, with configurable model, temperature, max tokens and request timeout.
- Manual, Automatic, or Manual + Automatic translation modes.
- Translation caching — identical text + target language + content type is never sent to the AI twice.
- Daily / weekly / monthly / yearly usage limits to keep API spend predictable.
- Live usage dashboard in AdminCP — requests, cache hits, API calls, failures.
- Original content in your database is never modified — translations only ever render client-side.
- Lightweight integration — its own
.js_lingosync-btnclass never collides with Sngine's existing translator handlers.
Perfect For
- Multilingual and international communities
- Marketplaces with buyers and sellers across languages
- Communities merging users from multiple regions
- Anyone replacing Sngine's legacy client-side translator (and its exposed API key) with a safer, server-side alternative
Requirements
- Sngine (verified against current 4.x core releases)
- An OpenAI API key and/or a DeepSeek API key
openai-php/clientandguzzlehttp/guzzle— already bundled in Sngine'svendor/folder on most installs, no Composer step needed
LingoSync installs in a handful of small, additive steps. Follow the Installation guide below.
System Requirements
LingoSync needs only a few things to run.
- Sngine core – the addon only adds files and small additive patches; it never removes or rewrites existing Sngine logic.
- Default Sngine theme – the front-end template hooks ship wired up for the default theme.
- PHP version – whatever version your Sngine install already runs on.
- MySQL / MariaDB – two new tables (
lingosync_cache,lingosync_usage) plus default rows in the existingsystem_optionstable. - An OpenAI or DeepSeek account – you only need a key for whichever provider you pick as active; the other can stay empty.
LingoSync ships pre-wired for the default Sngine theme. Porting it to a different theme is just adding a
.js_lingosync-btn span with the right data-content-type, plus a matching output container — the exact same pattern already used for Posts, Comments and Messages.
Every file below is small and additive, but a partial or dropped upload (especially through a browser-based file manager on large operations) can leave
bootstrap.php requiring a file that never actually arrived — which fatals on every page. Always verify each uploaded PHP file with php -l file.php before moving to the next step, ideally over SSH/SFTP rather than a browser file manager.
Installation Guide
LingoSync is delivered as a handful of new files plus small, additive patches to files Sngine already ships. Nothing existing is removed or rewritten — go step by step and verify as you go.
Step 1 – Extract the package
After purchasing and downloading LingoSync, you will find:
includes/lingosync.php– the core translation engine (new file)includes/ajax/lingosync/translate.php– the AJAX endpoint every content type calls (new file)includes/assets/js/core/lingosync.js– the front-end script (new file)content/themes/default/templates/admin.settings.lingosync.tpl– the AdminCP settings page (new file)sql/lingosync_install.sql– database structure and default options- Ready-to-upload full replacements for 8 existing Sngine files:
bootstrap.php,admin.php,includes/ajax/admin/settings.php, and 5 theme templates
Make sure all of these are present before proceeding.
Step 2 – Import the database
Log in to your hosting control panel and open phpMyAdmin (or any MySQL tool).
- Select your Sngine database.
- Go to the Import tab.
- Choose the
sql/lingosync_install.sqlfile from the LingoSync package. - Click Go to run the import.
This only adds the two new tables and a set of default system_options rows (LingoSync disabled, Manual mode, sensible default limits) — nothing existing is touched. It's safe to run again if you're re-importing; it uses guarded inserts.
mysql -u DBUSER -p DBNAME < sql/lingosync_install.sql
Step 3 – Upload the new files
Upload these three files first — they aren't referenced anywhere yet, so this step can't affect your live site either way:
| File in the package | Destination on your server |
|---|---|
includes/lingosync.php | /includes/lingosync.php |
includes/ajax/lingosync/translate.php | /includes/ajax/lingosync/translate.php (create the lingosync folder) |
includes/assets/js/core/lingosync.js | /includes/assets/js/core/lingosync.js |
Verify before moving on:
php -l includes/lingosync.php
php -l includes/ajax/lingosync/translate.php
ls -la includes/lingosync.php includes/ajax/lingosync/translate.php includes/assets/js/core/lingosync.js
All three must exist with a real file size and pass php -l. Browse your site now — it should be completely unaffected.
Step 4 – Upload the patched files
Now upload the full-replacement versions of these 8 existing files, in this order, testing navigation after each group:
bootstrap.php— activates the engine (adds onerequireline right after Sngine's own functions file). Restart PHP-FPM after this so no stale OPcache bytecode lingers.admin.phpandincludes/ajax/admin/settings.php— adds the AdminCP LingoSync page and its 5 save handlers.content/themes/default/templates/admin.settings.lingosync.tpl,admin.settings.tpl,admin.tpl— the settings screen itself and its sidebar link. Clearcontent/themes/default/templates_compiled/afterwards.__feeds_post.body.tpl,__feeds_comment.tpl,__feeds_comment.text.tpl,__feeds_message.tpl,_js_files.tpl— the front-end Translate buttons and output containers, and the script tag that loadslingosync.js.
Browser-based file managers can silently drop files on large or nested multi-file operations. Confirm every PHP file with
php -l and every changed template with a page reload before moving to the next group.
Step 5 – Enable & verify
Go to AdminCP → Settings → LingoSync (or directly visit https://yourdomain.com/admincp/settings/lingosync).
- Toggle Enable LingoSync on.
- Set Translation Mode — Manual, Automatic, or Manual + Automatic.
- Under the Models tab, pick your Active AI Provider and paste in its API key.
- Under Translation Features, confirm the content types you want are switched on.
- Save, then load a page with content in a different language and confirm it translates.
Posts, comments and messages ship fully wired as the reference implementation — blogs, profiles and products follow the exact same
.js_lingosync-btn pattern if you want to wire their templates too.
Updating LingoSync
Updates ship the same way as the initial install — a set of files to re-upload, following the same order and the same verification habits. Treat every update like a fresh install of Step 3–5 above, not a blind overwrite.
Before you update
- Back up every file you're about to replace — not just the ones you think changed. If an update touches
bootstrap.php,admin.php, or any template, back up all of them. - Note which Sngine core version you're currently on. LingoSync's patches are additive against a specific Sngine release; if Sngine itself was updated first, re-check that the exact "find" text in each patch still matches your current files before overwriting.
Update order
- Upload any brand-new files first (inert until referenced — safe to land ahead of time).
- Upload
bootstrap.phplast among the "core" files, and only once every file it mightrequireis already confirmed present withphp -l. Abootstrap.phpthat requires a file which hasn't landed yet will fatal on every single page of your site, not just LingoSync's. - Upload
admin.php/includes/ajax/admin/settings.php, then the AdminCP templates, then the front-end templates — testing navigation after each group. - Re-run
sql/lingosync_install.sqlif the update notes mention new tables or options — it's safe to run repeatedly. - Clear
content/themes/default/templates_compiled/and restart PHP-FPM after any template or core-file change.
It's almost never the new code — it's a file that didn't fully upload. Keep
tail -f your-error-log open in a second terminal while you update, and check the log the instant something looks wrong. A missing-file fatal in that log names the exact file and line, which is faster than guessing.
Rolling back
If an update misbehaves, restore your pre-update backups of the files you just replaced (all of them, not just the ones you suspect) and clear templates_compiled/ again. Then re-apply the update one file group at a time, verifying after each, instead of all at once.
Core Features
LingoSync brings a full server-side AI translation layer to your Sngine community.
Server-Side AI Translation
Your OpenAI/DeepSeek key lives only on your server — never printed into page source like the legacy client-side translator.
Dual AI Provider Support
Switch between OpenAI and DeepSeek from AdminCP at any time — only the active provider processes requests.
Smart Caching
Identical text + target language + content type is served from cache — the AI provider is never billed for the same translation twice.
Seamless Integration
Uses its own .js_lingosync-btn class, so it never collides with Sngine's existing .js_translator / .js_chat-translator handlers.
What You Can Do
- Choose your content types – Posts, Comments, Messages, Blogs, Profiles, Products, and general text, each with its own on/off switch.
- Pick a translation mode – Manual (click to translate), Automatic (translates instantly for every viewer), or both together.
- Cap your spend – set daily, weekly, monthly and yearly limits, or leave any window unlimited.
- Watch usage live – requests, cache hits, API calls and failures, broken down by day/week/month/year.
- Tune the model – model name, temperature, max output tokens and request timeout, per provider.
Multilingual communities, international marketplaces, and any site that wants translation without exposing an API key to every visitor's browser.
How It Works
From click (or page load, in Automatic mode) to translated text on screen, here's the exact path a request takes.
Request Flow
- A visitor loads a page, or new content streams in (infinite scroll, a new chat message, a newly loaded comment).
- In Automatic mode, LingoSync's script silently finds every eligible post/comment/message on the page and requests a translation for the viewer's language — no click needed. In Manual mode, nothing happens until the visitor clicks "Translate".
- The request hits
includes/ajax/lingosync/translate.php, which checks: is LingoSync enabled, is this content type enabled, does the current Translation Mode allow this specific request (manual clicks and automatic background scans are tagged separately, so a site set to "Automatic" only accepts automatic requests, and vice versa for "Manual"), is there text to translate, and is the target language supported. - LingoSync checks
lingosync_cachefor an identical (content type + original text + target language) combination. A cache hit returns instantly — no AI provider is called and no usage limit is spent. - On a cache miss, LingoSync checks your configured usage limits, then calls the active AI provider with a translation-only system prompt that preserves emojis, @mentions, #hashtags and links exactly as written.
- The result is cached, usage is logged, and the translated text is returned to the browser.
- The browser swaps the text in place — same element, same font, same layout — and the button becomes "View Original". A second click restores the original instantly, with no extra request.
Translation Modes
| Mode | Behavior |
|---|---|
| Manual | Visitors see a "Translate" link/button and nothing happens until they click it. |
| Automatic | Every eligible post/comment/message is translated the instant it appears — including content loaded later via infinite scroll or live chat — with no click needed. |
| Manual + Automatic | Content translates automatically, and the manual click-to-toggle "View Original" control still works on top of it. |
The original post, comment, message, blog, profile or product text in Sngine's own database tables is never modified. Translations only ever live in
lingosync_cache and render client-side.
Automatic mode translates every eligible item for every viewer, without first checking whether the content is already in the viewer's language — that would need a separate detection step. This matches the intended behavior, but does mean more AI requests than Manual mode; caching and the Limits tab are your main cost controls here.
AI Engine & Limits
Every knob that controls translation cost and quality lives in AdminCP → Settings → LingoSync.
Dual Provider Switch
Flip between OpenAI and DeepSeek at any time — each keeps its own key, model, and endpoint configured independently.
Custom API Endpoint
Point either provider at a custom/self-hosted-compatible endpoint instead of the public default.
Temperature & Max Tokens
Tune how literal vs. natural translations read, and cap how long a single response can run.
Request Timeout
Protects your page load from hanging if the AI provider is slow to respond.
Daily / Weekly / Monthly / Yearly Limits
Switch to Limited mode and cap real API calls per window — cached translations are always free and never count against a limit.
Live Usage Dashboard
Today / This Week / This Month / This Year, plus lifetime totals for requests, cache hits, API calls and failures.
Content Types at a Glance
| Content Type | Description | Default |
|---|---|---|
| Posts | Newsfeed posts | On |
| Comments | Comments on posts | On |
| Messages | Private messages & conversations | Off |
| Blogs | Blog articles and content | On |
| Profiles | Supported profile information | Off |
| Products | Marketplace / product information | Off |
| General | General text passed through the shared endpoint | Off |
Defaults come straight from sql/lingosync_install.sql and can be changed anytime under Translation Features — only enabled content types ever consume AI credits.
Changelog
All notable changes to LingoSync are documented here.
Update 1.0 – August 14, 2026
- Added a server-side translation engine supporting OpenAI and DeepSeek.
- Added Posts, Comments, Messages, Blogs, Profiles, Products and General content type support.
- Added Manual, Automatic and Manual + Automatic translation modes.
- Added translation caching so identical requests never repeat an API call.
- Added configurable daily/weekly/monthly/yearly usage limits.
- Added the AdminCP LingoSync settings panel with a live usage dashboard.
Frequently Asked Questions
Quick answers to the most common questions about LingoSync.
No, never. Translations only ever live in the separate lingosync_cache table and render client-side — nothing in posts, posts_comments, messages, or any other Sngine table is ever touched.
No — only the one you set as your Active AI Provider under AdminCP → Settings → LingoSync → Models. The other provider's key field can stay empty.
It can, especially on high-traffic pages — Automatic mode translates every eligible item for every viewer with no language-detection step first. Caching and the Limits tab (daily/weekly/monthly/yearly caps) are your main cost controls.
Manual shows a "Translate" link the visitor clicks. Automatic translates eligible content instantly for every viewer with no click needed. Manual + Automatic does both — content translates on its own, and the click-to-toggle "View Original" control still works on top of it.
Yes — LingoSync is designed to replace Sngine's client-side Google/Yandex post_translation_enabled feature, which exposes your translation API key in the browser's page source. LingoSync moves the entire translation flow server-side.
LingoSync ships fully wired up for the default Sngine theme. Porting it to another theme is just adding a .js_lingosync-btn span with the right data-content-type, plus a matching output container — the same pattern already used for Posts, Comments and Messages.
See the Updating section. The short version: upload new/unused files first, verify every PHP file with php -l, upload bootstrap.php only once everything it requires is confirmed present, clear templates_compiled/ after any template change, and restart PHP-FPM.
Contact our support team at portasale.com/u/zinklystudio. Please include your purchase ID and a detailed description of your issue.
Contact our support team at portasale.com/u/zinklystudio – we're happy to help.