PHPackages                             u0-ani-nya/ani-nya\_i18n - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. u0-ani-nya/ani-nya\_i18n

ActiveFlarum-extension[Localization &amp; i18n](/categories/localization)

u0-ani-nya/ani-nya\_i18n
========================

Native Flarum 2.0 discussion and post auto-translation extension with built-in database translation cache.

1.3.3-beta(yesterday)03↑2900%AGPL-3.0-or-laterPHP ^8.3

Since Jul 21Compare

[ Source](https://github.com/u0-ani-nya/ani-nya_i18n)[ Packagist](https://packagist.org/packages/u0-ani-nya/ani-nya_i18n)[ RSS](/packages/u0-ani-nya-ani-nya-i18n/feed)WikiDiscussions Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

Ani-Nya i18n (Native Multilingual Discussion Translation for Flarum 2.0)
========================================================================

[](#ani-nya-i18n-native-multilingual-discussion-translation-for-flarum-20)

[![Flarum 2.0 Compatible](https://camo.githubusercontent.com/7f1775a38a65c4f3c4895fbc61844768cfda746aa618056e411b3cf167ae1687/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466c6172756d2d322e302532422d627269676874677265656e)](#)[![License: AGPL-3.0](https://camo.githubusercontent.com/c77148b2545a6460d987db4f36a4e1c7e4641c3d9f8ab7b25b0afbdfaddb2061/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4147504c2d2d332e302d626c75652e737667)](LICENSE)

Ani-Nya i18n is a **native** Flarum 2.0 extension that provides AI-powered multilingual discussion translation.

It automatically detects when a discussion or post language differs from the user's preferred forum locale, generates a translated version, and displays it together with the original content.

Unlike browser-based translation solutions, Ani-Nya i18n integrates with Flarum's API and Mithril rendering system, using database-backed translation caching to reduce API usage.

Features
--------

[](#features)

- **Auto-translate posts** — posts are translated
- **mutiple translation engines** — choose the one that fits your needs, Google, yandex, Baidu, Deepl, LLM (Openai form) is okay.
- **Multi-language support** — auto-detects target language from user's forum locale
- **Homepage title translation** — discussion list titles are translated
- **Shoutbox translation** — third-party shoutbox widget messages are translated
- **User profile page** — posts on user profiles are translated
- **Original text preserved** — translated content shown with original text below

Supported Engines
-----------------

[](#supported-engines)

EngineAPI Key RequiredFree TierNotes**OpenAI / DeepSeek**YesNoBest quality, supports custom prompts and base URL**DeepL**YesYes (Free API)High quality, auto-detects Free vs Pro from key suffix**Google Cloud Translate**YesYes (500K chars/mo)V2 API, reliable**Free Google Translate**NoYesNo key needed, rate limited (~100 req/min)**Yandex Translate**YesYes (1M chars/mo)Cloud API**Baidu Translate**YesYes (50K chars/mo)Requires AppID + Secret**LibreTranslate**OptionalYes (self-hosted)Open source, supports custom instancesI tested OAI Deepl Google Free-Google Yandex and Baidu Libre is not tested due to is costs expensive.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Flarum 2.0.0-beta+

Installation
------------

[](#installation)

```
composer require u0-ani-nya/ani-nya_i18n
```

Then enable the extension in the Flarum admin dashboard.

Configuration
-------------

[](#configuration)

1. Go to Admin → Extensions → Auto Translate
2. Enable auto-translation
3. Select your preferred translation engine
4. Fill in the API key / credentials for the selected engine
5. Save settings

Target language is **auto-detected** from each user's language preference (forum language dropdown).

Engine Setup Guides
-------------------

[](#engine-setup-guides)

### OpenAI / DeepSeek

[](#openai--deepseek)

- **API Key**: Your OpenAI or compatible API key
- **Model**: Default `gpt-4o-mini`, or use DeepSeek (`deepseek-chat`), etc.
- **Base URL**: Default `https://api.openai.com/v1`. Change for compatible providers (e.g., `https://api.deepseek.com` for DeepSeek)
- **Prompt**: Customize translation instructions

### DeepL

[](#deepl)

- **API Key**: Get from [DeepL](https://www.deepl.com/pro-api). Free API keys end with `:fx`
- Free and Pro endpoints are auto-detected from the key

### Google Cloud Translate

[](#google-cloud-translate)

- **API Key**: Create at [Google Cloud Console](https://console.cloud.google.com/) → APIs &amp; Services → Credentials → Create API Key
- Enable "Cloud Translation API" first
- Free tier: 500,000 characters/month

### Free Google Translate

[](#free-google-translate)

- **No configuration needed**
- Uses Google Translate internal API (free, no key required)
- Rate limited (~100 requests/min)
- Best for low-traffic forums or testing

### Yandex Translate

[](#yandex-translate)

- **API Key**: Get from [Yandex Cloud Console](https://console.yandex.cloud/) → API Keys
- Enable Yandex Translate service first
- Free tier: 1,000,000 characters/month

### Baidu Translate

[](#baidu-translate)

- **App ID** + **Secret**: Get from [Baidu Fanyi API](https://fanyi-api.baidu.com/) → Developer Console
- Free tier: 50,000 characters/month (standard)
- Note: Uses Baidu-specific language codes internally (e.g., `jp` for Japanese, `kor` for Korean)

### LibreTranslate

[](#libretranslate)

- **URL**: Default `https://libretranslate.com` (public instance)
- Change URL for self-hosted instances
- **API Key**: Optional for public instance, may be required for self-hosted

How It Works
------------

[](#how-it-works)

1. **Translation is triggered** when:

    - A new discussion is created (auto-translate)
    - A user views a discussion page
    - A user views a profile page with posts
    - Homepage is loaded (title translation)
2. **Translations are cached** in the `i18n_translations` database table

    - Repeated views don't consume API quota
    - Post edits trigger re-translation automatically
3. **Frontend rendering**:

    - Discussion pages: VDOM injection (Mithril native)
    - Homepage titles: DOM injection
    - User profiles: VDOM injection
    - Shoutbox: DOM injection with periodic polling

CLI Commands
------------

[](#cli-commands)

```
# Translate a specific discussion
php flarum i18n:translate {discussion_id} --lang={lang_code}

# Translate all recent discussions (last 100)
php flarum i18n:translate --lang={lang_code}
```

License
-------

[](#license)

This project uses a **dual license**:

- **Non-commercial use**: [AGPL-3.0](LICENSE) — Free for personal projects, education, and open source. Modifications must be open-sourced.
- **Commercial use**: Requires a paid license. Contact mark#mail.ani-nya.com (replace # for @ ) for details.

See [LICENSE](LICENSE) for full terms.

Donate
------

[](#donate)

If you find this extension useful, consider supporting its development:

- **BNB Chain**: `0xEef952A66bd9116236E9C23Ca6f12272FA53c7Ce`
- [爱发电](https://ifdian.net/a/u0_ani-nya)
- looking for my forum [f.ani-nya.com](https://f.ani-nya.com)（ACGN related）
- or donate to charity organizations

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3dfc945a1f8a49c8d909b453d530bef1f3702876bbc9ab584dbd5dffdc6f1a2?d=identicon)[u0](/maintainers/u0)

---

Tags

i18ntranslationopenaiflarumdeeplgoogle-translateflarum-extensiontranslation-cacheflarum-2discussion-translatorbaidu-translate

### Embed Badge

![Health badge](/badges/u0-ani-nya-ani-nya-i18n/health.svg)

```
[![Health](https://phpackages.com/badges/u0-ani-nya-ani-nya-i18n/health.svg)](https://phpackages.com/packages/u0-ani-nya-ani-nya-i18n)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

12128.3k](/packages/flarum-lang-russian)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

1938.7k](/packages/flarum-lang-french)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[boxblinkracer/phpunuhi

Easy tool to work with translation files for validation, exports, imports and more.

83260.1k26](/packages/boxblinkracer-phpunuhi)[om/potrans

Command line tool for translate Gettext with Google Translator API or DeepL API

10520.2k9](/packages/om-potrans)[smousss/laravel-globalize

Make Laravel projects translatable in a matter of seconds!

2169.2k](/packages/smousss-laravel-globalize)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
