diff --git a/.gitignore b/.gitignore index 54eaeb7..8a8de90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/simplytranslate +/mai *.gz diff --git a/Dockerfile b/Dockerfile index b218848..9525191 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ FROM golang:1.20-alpine COPY . . RUN go mod download -RUN go build -o simplytranslate +RUN go build -o mai EXPOSE 5000 -CMD [ "./simplytranslate" ] +CMD [ "./mai" ] diff --git a/Makefile b/Makefile index d28257a..6151c95 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ PREFIX ?= /usr/local build: - go build -v ./cmd/simplytranslate + go build -v ./cmd/mai clean: - rm -f simplytranslate + rm -f mai install: - install -Dm0755 simplytranslate ${DESTDIR}${PREFIX}/bin/simplytranslate - mkdir -p ${DESTDIR}${PREFIX}/share/simplytranslate - cp -R static views ${DESTDIR}${PREFIX}/share/simplytranslate + install -Dm0755 mai ${DESTDIR}${PREFIX}/bin/mai + mkdir -p ${DESTDIR}${PREFIX}/share/mai + cp -R static views ${DESTDIR}${PREFIX}/share/mai uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/simplytranslate - rm -rf ${DESTDIR}${PREFIX}/share/simplytranslate + rm -f ${DESTDIR}${PREFIX}/bin/mai + rm -rf ${DESTDIR}${PREFIX}/share/mai diff --git a/README.md b/README.md index 03beb81..f2b44a7 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -## SimplyTranslate +## Mai A privacy friendly frontend to multiple translation engines. ### History 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. 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 ```shell -% git clone https://git.chaotic.ninja/yakumo.izuru/simplytranslate -% cd simplytranslate +% git clone https://git.chaotic.ninja/yakumo.izuru/mai +% cd mai % make # make install ``` @@ -27,11 +27,14 @@ location / { ``` ### 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. 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. + +### Other projects +* [Mozhi](https://codeberg.org/aryak/mozhi), also a fork of SimplyTranslate diff --git a/cmd/simplytranslate/flag.go b/cmd/mai/flag.go similarity index 100% rename from cmd/simplytranslate/flag.go rename to cmd/mai/flag.go diff --git a/cmd/simplytranslate/main.go b/cmd/mai/main.go similarity index 99% rename from cmd/simplytranslate/main.go rename to cmd/mai/main.go index d206c29..700d01f 100644 --- a/cmd/simplytranslate/main.go +++ b/cmd/mai/main.go @@ -7,7 +7,7 @@ import ( "time" "runtime" - "git.chaotic.ninja/yakumo.izuru/simplytranslate/engines" + "marisa.chaotic.ninja/mai/engines" "github.com/gofiber/fiber/v2" "github.com/gofiber/template/html/v2" ) diff --git a/cmd/mai/readconf.go b/cmd/mai/readconf.go new file mode 100644 index 0000000..1dc79c5 --- /dev/null +++ b/cmd/mai/readconf.go @@ -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 +} + diff --git a/cmd/simplytranslate/readconf.go b/cmd/simplytranslate/readconf.go deleted file mode 100644 index 45e50a8..0000000 --- a/cmd/simplytranslate/readconf.go +++ /dev/null @@ -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 -} - diff --git a/docker-compose.yml b/docker-compose.yml index b406c70..50ac234 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ version: "3.6" services: - simplytranslate: - container_name: simplytranslate + mai: + container_name: mai build: context: . dockerfile: Dockerfile diff --git a/rc.d/FreeBSD b/rc.d/FreeBSD index 6ffc511..93d2119 100644 --- a/rc.d/FreeBSD +++ b/rc.d/FreeBSD @@ -1,26 +1,26 @@ #!/bin/sh # $TheSupernovaDuo$ # -# PROVIDE: simplytranslate +# PROVIDE: mai # REQUIRE: DAEMON NETWORKING syslog # KEYWORD: shutdown . /etc/rc.subr -name="simplytranslate" -rcvar="simplytranslate_enable" +name="mai" +rcvar="mai_enable" load_rc_config $name -: ${simplytranslate_user:="www"} -: ${simplytranslate_enable:="NO"} -: ${simplytranslate_config="/usr/local/etc/simplytranslate/simplytranslate.ini"} +: ${mai_user:="www"} +: ${mai_enable:="NO"} +: ${mai_config="/usr/local/etc/mai/mai.ini"} pidfile="/var/run/${name}.pid" command="/usr/sbin/daemon" procname="/usr/local/bin/${name}" -simplytranslate_args="-f ${simplytranslate_config}" -command_args="-S -m 3 -s info -l daemon -p ${pidfile} /usr/bin/env ${procname} ${simplytranslate_args}" +mai_args="-f ${mai_config}" +command_args="-S -m 3 -s info -l daemon -p ${pidfile} /usr/bin/env ${procname} ${mai_args}" run_rc_command "$1" diff --git a/rc.d/OpenBSD b/rc.d/OpenBSD index 03aa7c7..e36e8fe 100644 --- a/rc.d/OpenBSD +++ b/rc.d/OpenBSD @@ -1,8 +1,8 @@ #!/bin/ksh # $TheSupernovaDuo$ -daemon="/usr/local/bin/simplytranslate" -daemon_flags="-f /usr/local/etc/simplytranslate/simplytranslate.ini" +daemon="/usr/local/bin/mai" +daemon_flags="-f /usr/local/etc/mai/mai.ini" . /etc/rc.d/rc.subr diff --git a/rc.d/immortal.yml b/rc.d/immortal.yml new file mode 100644 index 0000000..c4de33d --- /dev/null +++ b/rc.d/immortal.yml @@ -0,0 +1,2 @@ +cmd: /usr/local/bin/mai -f /usr/local/etc/mai/mai.ini +user: www diff --git a/static/LICENSE b/static/LICENSE deleted file mode 100644 index d4bcb5a..0000000 --- a/static/LICENSE +++ /dev/null @@ -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) diff --git a/static/favicon.ico b/static/favicon.ico index 74c58f4..7677295 100644 Binary files a/static/favicon.ico and b/static/favicon.ico differ diff --git a/static/favicon.svg b/static/favicon.svg deleted file mode 100644 index 184b290..0000000 --- a/static/favicon.svg +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/favicon128x128.png b/static/favicon128x128.png index f2d9b75..de812b4 100644 Binary files a/static/favicon128x128.png and b/static/favicon128x128.png differ diff --git a/views/index.html b/views/index.html index e4e9d21..f0357a1 100644 --- a/views/index.html +++ b/views/index.html @@ -1,7 +1,7 @@ - SimplyTranslate + Mai @@ -12,7 +12,7 @@
-

SimplyTranslate

+

Mai

@@ -126,8 +126,10 @@