プロジェクトの名前を「マイ」に変更します
git-svn-id: file:///srv/svn/repo/mai/trunk@56 e410bdd4-646f-c54f-a7ce-fffcc4f439ae
This commit is contained in:
parent
3e6dea4a1d
commit
236003cc7b
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
/simplytranslate
|
/mai
|
||||||
*.gz
|
*.gz
|
||||||
|
@ -2,6 +2,6 @@ FROM golang:1.20-alpine
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
RUN go build -o simplytranslate
|
RUN go build -o mai
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
CMD [ "./simplytranslate" ]
|
CMD [ "./mai" ]
|
||||||
|
14
Makefile
14
Makefile
@ -1,13 +1,13 @@
|
|||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -v ./cmd/simplytranslate
|
go build -v ./cmd/mai
|
||||||
clean:
|
clean:
|
||||||
rm -f simplytranslate
|
rm -f mai
|
||||||
install:
|
install:
|
||||||
install -Dm0755 simplytranslate ${DESTDIR}${PREFIX}/bin/simplytranslate
|
install -Dm0755 mai ${DESTDIR}${PREFIX}/bin/mai
|
||||||
mkdir -p ${DESTDIR}${PREFIX}/share/simplytranslate
|
mkdir -p ${DESTDIR}${PREFIX}/share/mai
|
||||||
cp -R static views ${DESTDIR}${PREFIX}/share/simplytranslate
|
cp -R static views ${DESTDIR}${PREFIX}/share/mai
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f ${DESTDIR}${PREFIX}/bin/simplytranslate
|
rm -f ${DESTDIR}${PREFIX}/bin/mai
|
||||||
rm -rf ${DESTDIR}${PREFIX}/share/simplytranslate
|
rm -rf ${DESTDIR}${PREFIX}/share/mai
|
||||||
|
15
README.md
15
README.md
@ -1,17 +1,17 @@
|
|||||||
## SimplyTranslate
|
## Mai
|
||||||
A privacy friendly frontend to multiple translation engines.
|
A privacy friendly frontend to multiple translation engines.
|
||||||
|
|
||||||
### History
|
### History
|
||||||
1. SimplyTranslate was founded by [metalune and fattalion](https://codeberg.org/SimpleWeb/SimplyTranslate-Web). It was written in Python.
|
1. SimplyTranslate was founded by [metalune and fattalion](https://codeberg.org/SimpleWeb/SimplyTranslate-Web). It was written in Python.
|
||||||
2. Fattalion created a Go implementation.
|
2. Fattalion created a Go implementation.
|
||||||
3. Both metalune and fattalion retired, and they handed SimplyTranslate over to ManeraKai.
|
3. Both metalune and fattalion retired, and they handed SimplyTranslate over to ManeraKai.
|
||||||
4. [Izuru Yakumo The Violet Hermit](https://geidontei.chaotic.ninja/usr/yakumo_izuru) stole it
|
4. [Izuru Yakumo The Violet Hermit](https://geidontei.chaotic.ninja/usr/yakumo_izuru) stole it, and renamed it after [Mai](https://en.touhouwiki.net/wiki/Mai) from [Mystic Square](https://en.touhouwiki.net/wiki/Mystic_Square)
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
% git clone https://git.chaotic.ninja/yakumo.izuru/simplytranslate
|
% git clone https://git.chaotic.ninja/yakumo.izuru/mai
|
||||||
% cd simplytranslate
|
% cd mai
|
||||||
% make
|
% make
|
||||||
# make install
|
# make install
|
||||||
```
|
```
|
||||||
@ -27,11 +27,14 @@ location / {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Legal notice
|
### Legal notice
|
||||||
SimplyTranslate does not host any content. All content shown on any SimplyTranslate instances is from [Google Translate](https://translate.google.com) and [Reverso](https://www.reverso.net/).
|
Mai does not host any content. All content shown on any Mai/Mozhi/SimplyTranslate instances is from [Google Translate](https://translate.google.com) and [Reverso](https://www.reverso.net/).
|
||||||
|
|
||||||
SimplyTranslate is not affiliated with Google Translate nor Reverso that SimplyTranslate relays.
|
Mai is not affiliated with Google Translate nor Reverso, which this program relays.
|
||||||
|
|
||||||
Trademarks belong to their respective owners.
|
Trademarks belong to their respective owners.
|
||||||
Google Translate is a trademark of [Google LLC](https://www.google.com). Reverso is a trademark of Reverso.
|
Google Translate is a trademark of [Google LLC](https://www.google.com). Reverso is a trademark of Reverso.
|
||||||
|
|
||||||
The creators and maintainers of this repository assume no liability for the accuracy and timeliness of any information provided above. Trademark owner information was researched to the best of the author's knowledge at the time of curation and may be outdated or incorrect.
|
The creators and maintainers of this repository assume no liability for the accuracy and timeliness of any information provided above. Trademark owner information was researched to the best of the author's knowledge at the time of curation and may be outdated or incorrect.
|
||||||
|
|
||||||
|
### Other projects
|
||||||
|
* [Mozhi](https://codeberg.org/aryak/mozhi), also a fork of SimplyTranslate
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"git.chaotic.ninja/yakumo.izuru/simplytranslate/engines"
|
"marisa.chaotic.ninja/mai/engines"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/gofiber/template/html/v2"
|
"github.com/gofiber/template/html/v2"
|
||||||
)
|
)
|
20
cmd/mai/readconf.go
Normal file
20
cmd/mai/readconf.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Read the INI-style configuration file
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gopkg.in/ini.v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
func readConf(file string) error {
|
||||||
|
cfg, err := ini.Load(file)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
conf.listen = cfg.Section("mai").Key("listen").String()
|
||||||
|
conf.staticpath = cfg.Section("mai").Key("rootdir").String()
|
||||||
|
conf.tmplpath = cfg.Section("mai").Key("tmplpath").String()
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
// Read the INI-style configuration file
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gopkg.in/ini.v1"
|
|
||||||
)
|
|
||||||
|
|
||||||
func readConf(file string) error {
|
|
||||||
cfg, err := ini.Load(file)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
conf.listen = cfg.Section("simplytranslate").Key("listen").String()
|
|
||||||
conf.staticpath = cfg.Section("simplytranslate").Key("rootdir").String()
|
|
||||||
conf.tmplpath = cfg.Section("simplytranslate").Key("tmplpath").String()
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
version: "3.6"
|
version: "3.6"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
simplytranslate:
|
mai:
|
||||||
container_name: simplytranslate
|
container_name: mai
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
16
rc.d/FreeBSD
16
rc.d/FreeBSD
@ -1,26 +1,26 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $TheSupernovaDuo$
|
# $TheSupernovaDuo$
|
||||||
#
|
#
|
||||||
# PROVIDE: simplytranslate
|
# PROVIDE: mai
|
||||||
# REQUIRE: DAEMON NETWORKING syslog
|
# REQUIRE: DAEMON NETWORKING syslog
|
||||||
# KEYWORD: shutdown
|
# KEYWORD: shutdown
|
||||||
|
|
||||||
|
|
||||||
. /etc/rc.subr
|
. /etc/rc.subr
|
||||||
|
|
||||||
name="simplytranslate"
|
name="mai"
|
||||||
rcvar="simplytranslate_enable"
|
rcvar="mai_enable"
|
||||||
|
|
||||||
load_rc_config $name
|
load_rc_config $name
|
||||||
|
|
||||||
: ${simplytranslate_user:="www"}
|
: ${mai_user:="www"}
|
||||||
: ${simplytranslate_enable:="NO"}
|
: ${mai_enable:="NO"}
|
||||||
: ${simplytranslate_config="/usr/local/etc/simplytranslate/simplytranslate.ini"}
|
: ${mai_config="/usr/local/etc/mai/mai.ini"}
|
||||||
|
|
||||||
pidfile="/var/run/${name}.pid"
|
pidfile="/var/run/${name}.pid"
|
||||||
command="/usr/sbin/daemon"
|
command="/usr/sbin/daemon"
|
||||||
procname="/usr/local/bin/${name}"
|
procname="/usr/local/bin/${name}"
|
||||||
simplytranslate_args="-f ${simplytranslate_config}"
|
mai_args="-f ${mai_config}"
|
||||||
command_args="-S -m 3 -s info -l daemon -p ${pidfile} /usr/bin/env ${procname} ${simplytranslate_args}"
|
command_args="-S -m 3 -s info -l daemon -p ${pidfile} /usr/bin/env ${procname} ${mai_args}"
|
||||||
|
|
||||||
run_rc_command "$1"
|
run_rc_command "$1"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#!/bin/ksh
|
#!/bin/ksh
|
||||||
# $TheSupernovaDuo$
|
# $TheSupernovaDuo$
|
||||||
|
|
||||||
daemon="/usr/local/bin/simplytranslate"
|
daemon="/usr/local/bin/mai"
|
||||||
daemon_flags="-f /usr/local/etc/simplytranslate/simplytranslate.ini"
|
daemon_flags="-f /usr/local/etc/mai/mai.ini"
|
||||||
|
|
||||||
. /etc/rc.d/rc.subr
|
. /etc/rc.d/rc.subr
|
||||||
|
|
||||||
|
2
rc.d/immortal.yml
Normal file
2
rc.d/immortal.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cmd: /usr/local/bin/mai -f /usr/local/etc/mai/mai.ini
|
||||||
|
user: www
|
@ -1,3 +0,0 @@
|
|||||||
favicon.ico, favicon.svg, favicon128x128.png
|
|
||||||
Created by "joelchrono12" (https://joelchrono12.ml/)
|
|
||||||
Creative Commons Attribution 4.0 International License (CC BY 4.0)
|
|
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 50 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 26 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 21 KiB |
@ -1,7 +1,7 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>SimplyTranslate</title>
|
<title>Mai</title>
|
||||||
<link rel="shortcut icon" href="/static/favicon.ico">
|
<link rel="shortcut icon" href="/static/favicon.ico">
|
||||||
<meta name="description" content="Experience simple and private translations">
|
<meta name="description" content="Experience simple and private translations">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
@ -12,7 +12,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="center">
|
<header class="center">
|
||||||
<h1>SimplyTranslate</h1>
|
<h1>Mai</h1>
|
||||||
</header>
|
</header>
|
||||||
<form action="/?engine={{.Engine}}" method="POST" id="translation-form">
|
<form action="/?engine={{.Engine}}" method="POST" id="translation-form">
|
||||||
<div class="center">
|
<div class="center">
|
||||||
@ -126,8 +126,10 @@
|
|||||||
</form>
|
</form>
|
||||||
<br><br><br><br><br>
|
<br><br><br><br><br>
|
||||||
<footer class="center">
|
<footer class="center">
|
||||||
<a href="https://git.chaotic.ninja/yakumo.izuru/simplytranslate">Source code</a><br>
|
<p>
|
||||||
<p>a <em>Mirage AIB</em> project</p>
|
<a href="https://git.chaotic.ninja/yakumo.izuru/mai">Source code</a><br>
|
||||||
|
a <em>Mirage AIB</em> project | Favicon source is <a href="https://pixiv.net/en/artworks/97787072">ユキマイ</a>
|
||||||
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="/static/script.js"></script>
|
<script src="/static/script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user