This repository contains the source code for the TeleCloud web interface.
templates/: Go HTML templates.static/: Frontend assets (CSS, JS, Fonts).static/locales/: JSON translation files.tailwind.config.js: Tailwind CSS configuration.package.json: Dependencies and build scripts.build.js: Unified Node.js build engine (Tailwind, esbuild, sync/minify locales).
If you would like to contribute a new language or improve an existing translation, please follow these steps:
- Locate translation files: Language files are located in the
static/locales/directory in JSON format (e.g.,en.json,vi.json). - Add a new language:
- Create a new JSON file with the ISO language code (e.g.,
fr.jsonfor French). - Copy the content from
en.jsonand translate the values into your language. - Open
static/js/common.jsand add the new language to theavailableLangsarray:{ code: 'fr', name: 'Français', flag: '🇫🇷' }
- Create a new JSON file with the ISO language code (e.g.,
- Submit a Pull Request: Once finished, submit a Pull Request (PR) to this repository.
Nếu bạn muốn đóng góp bản dịch cho một ngôn ngữ mới hoặc cải thiện bản dịch hiện có, hãy làm theo các bước sau:
- Tìm tệp bản dịch: Các tệp ngôn ngữ nằm trong thư mục
static/locales/dưới định dạng JSON (ví dụ:vi.json,en.json). - Thêm ngôn ngữ mới:
- Tạo một tệp JSON mới với mã ngôn ngữ ISO (ví dụ:
fr.jsoncho tiếng Pháp). - Sao chép nội dung từ
en.jsonvà dịch các giá trị sang ngôn ngữ của bạn. - Mở tệp
static/js/common.jsvà thêm ngôn ngữ mới vào mảngavailableLangs:{ code: 'fr', name: 'Français', flag: '🇫🇷' }
- Tạo một tệp JSON mới với mã ngôn ngữ ISO (ví dụ:
- Gửi Pull Request: Sau khi hoàn tất, hãy gửi một Pull Request (PR) vào repository này.
The main TeleCloud repository integrates this as a git submodule. During the build process (Docker or GitHub Actions), the following steps are performed:
- Fetch this submodule into the
web/directory. - Run
build-frontend.shto generate minified assets (*.min.js,*.min.css,*.min.json). - Compile the Go binary with embedded assets.
- Cleans up old minified files.
- Optionally pulls latest changes from
origin/main(controlled by argument). - Verifies npm is installed, then runs
npm install. - Executes
build.jswhich handles:- Building Tailwind CSS via
@tailwindcss/cli. - Bundling and minifying JS and CSS files via
esbuild. - Minifying theme CSS files.
- Syncing and minifying JSON locale files.
- Building Tailwind CSS via
To manually build the frontend assets:
- Ensure you have Node.js and npm installed.
- Run the build command:
Alternatively, you can use the wrapper scripts:
cd web npm install npm run build# Linux/macOS ./build-frontend.sh # Windows build-frontend.bat
Minified files are ignored by git to keep the repository clean. They are generated only during the build process.
Developed by @dabeecao