Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and publish Docker image

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: read
packages: write

jobs:
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set image name
run: echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: Build Docker image
run: docker build -t $IMAGE_NAME:latest .

- name: Push Docker image
run: docker push $IMAGE_NAME:latest
10 changes: 6 additions & 4 deletions frontend/src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createI18n } from 'vue-i18n'

type LocaleCode = 'en' | 'zh'
type LocaleCode = 'en' | 'zh' | 'ru'

type LocaleMessages = Record<string, any>

Expand All @@ -9,11 +9,12 @@ const DEFAULT_LOCALE: LocaleCode = 'en'

const localeLoaders: Record<LocaleCode, () => Promise<{ default: LocaleMessages }>> = {
en: () => import('./locales/en'),
zh: () => import('./locales/zh')
zh: () => import('./locales/zh'),
ru: () => import('./locales/ru')
}

function isLocaleCode(value: string): value is LocaleCode {
return value === 'en' || value === 'zh'
return value === 'en' || value === 'zh' || value === 'ru'
}

function getDefaultLocale(): LocaleCode {
Expand Down Expand Up @@ -85,7 +86,8 @@ export function getLocale(): LocaleCode {

export const availableLocales = [
{ code: 'en', name: 'English', flag: '🇺🇸' },
{ code: 'zh', name: '中文', flag: '🇨🇳' }
{ code: 'zh', name: '中文', flag: '🇨🇳' },
{ code: 'ru', name: 'Русский', flag: '🇷🇺' }
] as const

export default i18n
Loading
Loading