mirror of
https://github.com/flameshikari/outline-ru.git
synced 2026-06-13 04:05:10 +03:00
add patch, add nightly build, reorganize the repo
Build / Build [amd64] (push) Has been cancelled
Build / Build [arm64] (push) Has been cancelled
Build / Publish (push) Has been cancelled
Build / Build [amd64] (push) Has been cancelled
Build / Build [arm64] (push) Has been cancelled
Build / Publish (push) Has been cancelled
This commit is contained in:
@@ -1,2 +1,15 @@
|
||||
__mocks__
|
||||
.git
|
||||
.github
|
||||
.vscode
|
||||
.circleci
|
||||
.env*
|
||||
.eslint*
|
||||
.log
|
||||
Makefile
|
||||
Procfile
|
||||
app.json
|
||||
crowdin.yml
|
||||
build
|
||||
docker-compose.yml
|
||||
node_modules
|
||||
@@ -7,8 +7,9 @@ on:
|
||||
- dev
|
||||
paths:
|
||||
- .github/workflows/*
|
||||
- shared/**
|
||||
- src/**
|
||||
- outline/**
|
||||
- tools/translation.json
|
||||
- tools/return_ru.patch
|
||||
- Dockerfile
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -75,7 +76,6 @@ jobs:
|
||||
outputs: type=image,"name=${{ github.repository }},ghcr.io/${{ github.repository }}",push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
- name: Export Digests
|
||||
if: ${{ github.ref == 'refs/heads/master' }}
|
||||
run: |
|
||||
mkdir -p ${{ runner.temp }}/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
@@ -83,7 +83,6 @@ jobs:
|
||||
|
||||
- name: Upload Digests
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ github.ref == 'refs/heads/master' }}
|
||||
with:
|
||||
name: digests-linux-${{ matrix.arch }}
|
||||
path: ${{ runner.temp }}/digests/*
|
||||
@@ -94,7 +93,6 @@ jobs:
|
||||
name: Publish
|
||||
runs-on: ubuntu-24.04
|
||||
needs: build
|
||||
if: ${{ github.ref == 'refs/heads/master' }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
@@ -131,8 +129,9 @@ jobs:
|
||||
${{ github.repository }}
|
||||
ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=raw,value=${{ env.version }}
|
||||
type=raw,value=nightly,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
||||
type=raw,value=${{ env.version }},enable=${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: Create Manifest & Push
|
||||
working-directory: ${{ runner.temp }}/digests
|
||||
@@ -144,6 +143,7 @@ jobs:
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: ${{ github.ref == 'refs/heads/master' }}
|
||||
with:
|
||||
name: ${{ env.version }}
|
||||
tag_name: ${{ env.version }}
|
||||
|
||||
+2
-1
@@ -1 +1,2 @@
|
||||
scripts/translation.json
|
||||
tools/*.json
|
||||
!tools/translation.json
|
||||
|
||||
+9
-5
@@ -5,12 +5,17 @@ ARG APP_PATH
|
||||
WORKDIR $APP_PATH
|
||||
|
||||
FROM base AS build
|
||||
COPY ./src/package.json ./src/yarn.lock ./
|
||||
COPY ./src/patches ./patches
|
||||
RUN apt-get update && \
|
||||
apt-get install -y patch && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
COPY ./outline/package.json ./outline/yarn.lock ./
|
||||
COPY ./outline/patches ./patches
|
||||
RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \
|
||||
yarn cache clean
|
||||
COPY src .
|
||||
COPY shared ./shared
|
||||
COPY ./outline .
|
||||
COPY ./tools/translation.json ./shared/i18n/locales/ru_RU/translation.json
|
||||
COPY ./tools/return_ru.patch .
|
||||
RUN patch -p1 < return_ru.patch
|
||||
ARG CDN_URL
|
||||
RUN yarn build
|
||||
RUN rm -rf node_modules
|
||||
@@ -18,7 +23,6 @@ RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 &
|
||||
yarn cache clean
|
||||
ENV PORT=3000
|
||||
|
||||
|
||||
FROM base AS release
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=build $APP_PATH/build ./build
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
|
||||
> перед установкой **ОБЯЗАТЕЛЬНО** прочтите [про бэкапы перед обновлением](https://docs.getoutline.com/s/hosting/doc/backups-KZtPOADCHG)
|
||||
|
||||
Следуйте [официальной инструкции](https://docs.getoutline.com/s/hosting/doc/docker-7pfeLP5a8t), только в качестве `image` укажите `flameshikari/outline-ru:latest` (желательно зафиксировать версию, заменив `latest` на один из [доступных тегов](https://github.com/flameshikari/outline-ru/tags)), а также задайте переменную `DEFAULT_LANGUAGE=ru_RU` в [docker.env](https://github.com/outline/outline/blob/main/.env.sample). Пример:
|
||||
> если вы используете переменную `DEFAULT_LANGUAGE`, то можете задать ей значение `ru_RU`
|
||||
|
||||
Следуйте [официальной инструкции](https://docs.getoutline.com/s/hosting/doc/docker-7pfeLP5a8t), только в качестве `image` укажите `flameshikari/outline-ru:latest` (желательно зафиксировать версию, заменив `latest` на один из [доступных тегов](https://github.com/flameshikari/outline-ru/tags)). Например:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CWD="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
|
||||
|
||||
cat $CWD/src/shared/utils/date.ts | \
|
||||
sed '/^ pl,/a\ \ ru,' | \
|
||||
sed '/^ pl_PL: pl,/a\ \ ru_RU: ru,' \
|
||||
> $CWD/shared/utils/date.ts
|
||||
|
||||
cat $CWD/src/shared/i18n/index.ts | \
|
||||
sed '/^export const languageOptions: LanguageOption\[\] = \[/a\ \ {\n label: "Русский (Russian)",\n value: "ru_RU",\n },' \
|
||||
> $CWD/shared/i18n/index.ts
|
||||
@@ -8,9 +8,12 @@ def workdir(path):
|
||||
abspath = os.path.abspath(basepath + '/' + path)
|
||||
return abspath
|
||||
|
||||
en_json_path = workdir('../src/shared/i18n/locales/en_US/translation.json')
|
||||
ru_json_path = workdir('../shared/i18n/locales/ru_RU/translation.json')
|
||||
out_json_path = workdir('./translation.json')
|
||||
|
||||
en_json_path = workdir('../outline/shared/i18n/locales/en_US/translation.json')
|
||||
ru_json_path = workdir('./translation.json')
|
||||
|
||||
out_json_name = 'translation_merged.json'
|
||||
out_json_path = workdir(f'./{out_json_name}')
|
||||
|
||||
translated_lines = {}
|
||||
untranslated_lines = {}
|
||||
@@ -49,4 +52,4 @@ if (untranslated_lines):
|
||||
with open(out_json_path, 'w') as target:
|
||||
obj = json.dumps(out_json, indent=2, ensure_ascii=False)
|
||||
target.write(obj + '\n')
|
||||
print('Переведенные и непереведенные строки смержены в translation.json')
|
||||
print(f'Переведенные и непереведенные строки смержены в {out_json_name}')
|
||||
@@ -0,0 +1,35 @@
|
||||
diff --git a/shared/i18n/index.ts b/shared/i18n/index.ts
|
||||
index e315ef413..b580ec795 100644
|
||||
--- a/shared/i18n/index.ts
|
||||
+++ b/shared/i18n/index.ts
|
||||
@@ -72,6 +72,10 @@ export const languageOptions: LanguageOption[] = [
|
||||
label: "فارسی (Persian)",
|
||||
value: "fa_IR",
|
||||
},
|
||||
+ {
|
||||
+ label: "Русский (Russian)",
|
||||
+ value: "ru_RU",
|
||||
+ },
|
||||
{
|
||||
label: "Svenska (Swedish)",
|
||||
value: "sv_SE",
|
||||
diff --git a/shared/utils/date.ts b/shared/utils/date.ts
|
||||
index 397b2c7a4..a45d418ae 100644
|
||||
--- a/shared/utils/date.ts
|
||||
+++ b/shared/utils/date.ts
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
ptBR,
|
||||
pt,
|
||||
pl,
|
||||
+ ru,
|
||||
sv,
|
||||
tr,
|
||||
vi,
|
||||
@@ -175,6 +176,7 @@ const locales = {
|
||||
pt_BR: ptBR,
|
||||
pt_PT: pt,
|
||||
pl_PL: pl,
|
||||
+ ru_RU: ru,
|
||||
sv_SE: sv,
|
||||
tr_TR: tr,
|
||||
uk_UA: uk,
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user