From 4ddba793e27382e6b72f530c0a14bf2460dea743 Mon Sep 17 00:00:00 2001 From: GodD6366 Date: Mon, 17 Jun 2024 11:51:12 +0800 Subject: [PATCH] :construction: use i18n --- .github/workflows/docker-publish.yml | 8 ++++---- docs/widgets/services/moviebot.md | 13 +++++++++++++ public/locales/en/common.json | 4 +++- public/locales/zh-CN/common.json | 2 ++ src/widgets/moviebot/component.jsx | 8 +++++++- 5 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 docs/widgets/services/moviebot.md diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8fc7c9631ae..f876f0f995e 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -10,7 +10,7 @@ on: - cron: '20 0 * * *' push: branches: - - dev + - main - feature/** # Publish semver tags as releases. tags: [ 'v*.*.*' ] @@ -50,8 +50,8 @@ jobs: build: name: Docker Build & Push - # if: github.repository == 'gethomepage/homepage' - runs-on: ubuntu-22.04 + if: github.repository == 'gethomepage/homepage' + runs-on: self-hosted needs: - pre-commit permissions: @@ -128,7 +128,7 @@ jobs: REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }} # https://github.com/docker/setup-qemu-action#about # platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max diff --git a/docs/widgets/services/moviebot.md b/docs/widgets/services/moviebot.md new file mode 100644 index 00000000000..9f9cb2c9b03 --- /dev/null +++ b/docs/widgets/services/moviebot.md @@ -0,0 +1,13 @@ +--- +title: Moviebot +description: Moviebot Widget Configuration +--- + +Learn more about [Moviebot](https://moviebot.fun/). + +```yaml +widget: + type: moviebot + url: http://moviebot.host.or.ip:port + key: api_keymoviebot +``` diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 1cc758273b8..32650c0b3eb 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -606,9 +606,11 @@ "moviebot": { "subscribe": "SUB", "sites": "SITE", + "errorSites": "{{errorSites}} ERROR", + "normalSites": "{{normalSites}} AVAILABLE", "todayUp": "UPLOADED", "todayDl": "DOWNLOAD" - }, + }, "octoprint": { "printer_state": "Status", "temp_tool": "Tool temp", diff --git a/public/locales/zh-CN/common.json b/public/locales/zh-CN/common.json index 95d9fa400e9..a4ce8620eda 100644 --- a/public/locales/zh-CN/common.json +++ b/public/locales/zh-CN/common.json @@ -464,6 +464,8 @@ "moviebot": { "subscribe": "订阅中", "sites": "站点", + "errorSites": "异常 {{errorSites}} 个", + "normalSites": "可用 {{normalSites}} 个", "todayUp": "今日上传", "todayDl": "今日下载" }, diff --git a/src/widgets/moviebot/component.jsx b/src/widgets/moviebot/component.jsx index e3f87f33e5e..0ef16897399 100644 --- a/src/widgets/moviebot/component.jsx +++ b/src/widgets/moviebot/component.jsx @@ -1,8 +1,11 @@ +import { useTranslation } from "next-i18next"; + import Block from "components/services/widget/block"; import Container from "components/services/widget/container"; import useWidgetAPI from "utils/proxy/use-widget-api"; export default function Component({ service }) { + const { t } = useTranslation(); const { widget } = service; const { data: listTVResult } = useWidgetAPI(widget, "SubscribeList", { @@ -34,7 +37,10 @@ export default function Component({ service }) { return ( - +