Skip to content

EuphoriaTheme/Translations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Translations (Blueprint Extension)

Client-side UI translations for the Pterodactyl Panel using Blueprint.

This extension injects a language selector into the client UI and uses a translation API to translate visible text on the page.

Features

  • Language selector (top-right) for end users.
  • Admin-managed enabled languages list and default language.
  • Custom API base URL (optional). If set, the frontend will use it; otherwise it falls back to the default API.
  • Client-side caching and DOM mutation observing so dynamic content is translated too.

Requirements

  • Pterodactyl Panel with the Blueprint framework installed.
  • Blueprint target: beta-2024-12 (see conf.yml).

Installation

Install the compiled .blueprint release using Blueprint (typical flow):

  1. Upload the *.blueprint file to your server.
  2. From your Pterodactyl directory (usually /var/www/pterodactyl), run blueprint -install *.blueprint.

Uninstall:

  1. blueprint -remove translations

Configuration (Admin)

  1. Open the admin area: Admin -> Extensions -> Translations.
  2. Set:
    • Enabled Languages: languages users are allowed to select.
    • Default Language: used when a user has not chosen a language yet.
    • Custom API URL (Optional): base URL for the translations API (no trailing slash).
  3. Click Save Settings.

Notes:

  • If no languages are enabled, the language selector is hidden and the UI stays in English.
  • The user's selection is stored in localStorage under selectedLanguage.

Custom API URL

By default, the extension uses:

  • https://api.euphoriadevelopment.uk/translations

If you set a custom API URL in the admin view, it must expose the same basic endpoints:

  • GET {API_BASE}/ returns a JSON payload containing languages (and typically success).
  • POST {API_BASE}/translate/bulk accepts JSON: { "texts": string[], "targetLang": string } and returns { "success": boolean, "translations": { [original: string]: string } }.

The extension will automatically normalize a trailing / away and then append paths like /translate/bulk.

Notes:

  • Because the API is called from the browser, your custom API must allow CORS from your Panel domain.
  • Use http:// only for local/dev; production should be https://.

Where Things Live (Source)

  • Extension manifest: conf.yml
  • Admin view: admin/view.blade.php
  • Admin controller: admin/Controller.php
  • Client wrapper: client/wrapper.blade.php
  • Language selector partial: src/views/wrapper/container/language.blade.php
  • Client translation script: public/lib/translations.js
  • Routes: routes/web.php

Blueprint Placeholders

This repo contains Blueprint template placeholders such as {identifier}, {name}, and {timestamp}. They are replaced during packaging/install, so seeing placeholders in the source is expected.

Contributing

This repo is shared so the community can help improve and extend the addon, not because it's abandoned. Where it helps, the code includes comments explaining non-obvious behavior; keep comments high-signal.

Pull Request Requirements

  • Clearly state what was added/updated and why.
  • Include images or a short video of the change working/in action (especially for UI changes).
  • Keep changes focused and avoid unrelated formatting-only churn.
  • Keep credits/attribution intact (see LICENSE).

Helpful Contribution Ideas

  • Improve styling to better fit different themes.
  • Add small UX improvements (tooltip placement, accessibility, etc.).
  • Performance improvements (without changing behavior).

License

Source-available. Redistribution and resale (original or modified) are not permitted, and original credits must be kept within the addon. See LICENSE for the full terms.

About

Translations Source Code

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors