Skip to content

Commit

Permalink
🚧 use i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
GodD6366 committed Jun 17, 2024
1 parent 5876af0 commit 4ddba79
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- cron: '20 0 * * *'
push:
branches:
- dev
- main
- feature/**
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions docs/widgets/services/moviebot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Moviebot
description: Moviebot Widget Configuration
---

Learn more about [Moviebot](https://moviebot.fun/).

```yaml
widget:
type: moviebot
url: http:https://moviebot.host.or.ip:port
key: api_keymoviebot
```
4 changes: 3 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions public/locales/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@
"moviebot": {
"subscribe": "订阅中",
"sites": "站点",
"errorSites": "异常 {{errorSites}} 个",
"normalSites": "可用 {{normalSites}} 个",
"todayUp": "今日上传",
"todayDl": "今日下载"
},
Expand Down
8 changes: 7 additions & 1 deletion src/widgets/moviebot/component.jsx
Original file line number Diff line number Diff line change
@@ -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", {
Expand Down Expand Up @@ -34,7 +37,10 @@ export default function Component({ service }) {
return (
<Container service={service}>
<Block label="moviebot.subscribe" value={subingTVList.length + subingMovieList.length} />
<Block label="moviebot.sites" value={errorSites ? `异常 ${errorSites} 个` : `可用 ${normalSites} 个`} />
<Block
label="moviebot.sites"
value={errorSites ? t("moviebot.errorSites", { errorSites }) : t("moviebot.normalSites", { normalSites })}
/>

<Block
label="moviebot.todayUp"
Expand Down

0 comments on commit 4ddba79

Please sign in to comment.