Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kayw-geek/background-translation-i18n
Based on the YII2 module to translate JSON formatted translation files on the web
https://github.com/kayw-geek/background-translation-i18n
i18n translate translate-json vue yii2 yii2-extension yii2-modules
Last synced: 4 months ago
JSON representation
Based on the YII2 module to translate JSON formatted translation files on the web
- Host: GitHub
- URL: https://github.com/kayw-geek/background-translation-i18n
- Owner: kayw-geek
- Created: 2020-09-08T02:51:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T14:10:52.000Z (over 4 years ago)
- Last Synced: 2024-09-30T23:49:35.643Z (4 months ago)
- Topics: i18n, translate, translate-json, vue, yii2, yii2-extension, yii2-modules
- Language: PHP
- Homepage:
- Size: 48.8 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Yii2 - Background Translation I18n
[![Open Source Love](https://badges.frapsoft.com/os/v3/open-source.svg?v=103)](https://github.com/weikaiiii/background-translation-i18n)[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)[![GitHub stars](https://img.shields.io/github/stars/Kay-Wei/background-translation-i18n.svg?style=social&label=Star&maxAge=2592000)](https://github.com/weikaiiii/background-translation-i18n)[![saythanks](https://img.shields.io/badge/say-thanks-ff69b4.svg)](https://saythanks.io/to/kennethreitz)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FKay-Wei%2Fbackground-translation-i18n.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FKay-Wei%2Fbackground-translation-i18n?ref=badge_shield):alien: Based on the YII2 module to translate JSON formatted translation files on the web
## Introduction:sweat_drops:
This project is suitable for client-side international translation. It supports importing JSON files to web pages, and operation and maintenance or translators export the translated JSON files after translation on the web
## Installation:green_heart:
Via [Composer](http://getcomposer.org/download/)
```
composer require weikaiiii/background-translation-i18n
```### Migration:purple_heart:
Run the following command in Terminal for database migration:
```
yii migrate/up --migrationPath=@vendor/weikaiiii/background-translation-i18n/migrations
```### Config:heartbeat:
Turning on the translate Module:
Simple example:
```
'modules' => [
'translate' => [
'class'=>'weikaiiii\backgroundTranslationI18n\Module'
],
],
```A more complex example including database table with multilingual support is below:
```
'modules' => [
'translate'=>[
'class'=>'weikaiiii\backgroundTranslationI18n\Module',
'allowedIPs'=>['127.0.0.1'], // IP addresses from which the translation interface is accessible.
'source_lang'=>'en-US', //Translate according to source language encoding.]
],
```## Usage:no_mouth:
### Point
Every time a JSON file is uploaded, it will be judged based on the existing data and will not cause data duplication.### Json File Format Example
```
{
"library":{
"hello":"Hello from library"
},
"documents":{
"hello":"Hello from documents"
}
}
```
### URLsURLs for the translating tool:
```
/translate/translate-json/export // Export the translated JSON file.
/translate/translate-json/index?language_id={xx-XX} // Translate specific language pages.
/translate/translate-json/list // Language code list page.
/translate/translate-json/create // Import JSON source language files.
```## Screenshots:chicken:
### List of languages
![1599540101194](https://s1.ax1x.com/2020/09/08/wMc1hD.md.png)
### Translate on the admin interface
![1599540236622](https://s1.ax1x.com/2020/09/08/wMcNnI.md.png)
## Statement:love_letter:
The project view part and language list part are borrowed from the "lajax/yii2-translate-manager" project. Thanks lajax for the great work.
- YII2 Translate Manager : https://github.com/lajax/yii2-translate-manager
## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FKay-Wei%2Fbackground-translation-i18n.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FKay-Wei%2Fbackground-translation-i18n?ref=badge_large)