Skip to content

Commit f789d9d

Browse files
committed
fix: add language env
1 parent ce41ee2 commit f789d9d

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,17 @@ If you get unable to open database file run `chown -R $USER:$USER path` on the p
8080

8181
All are optional, JWT_SECRET is recommended to be set.
8282

83-
| Name | Default | Description |
84-
| ------------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
85-
| JWT_SECRET | when unset it will use the value from randomUUID() | A long and secret string used to sign the JSON Web Token |
86-
| ACCOUNT_REGISTRATION | false | Allow users to register accounts |
87-
| HTTP_ALLOWED | false | Allow HTTP connections, only set this to true locally |
88-
| ALLOW_UNAUTHENTICATED | false | Allow unauthenticated users to use the service, only set this to true locally |
89-
| AUTO_DELETE_EVERY_N_HOURS | 24 | Checks every n hours for files older then n hours and deletes them, set to 0 to disable |
90-
| WEBROOT | | The address to the root path setting this to "/convert" will serve the website on "example.com/convert/" |
91-
| FFMPEG_ARGS | | Arguments to pass to ffmpeg, e.g. `-preset veryfast` |
92-
| HIDE_HISTORY | false | Hide the history page |
83+
| Name | Default | Description |
84+
| ------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
85+
| JWT_SECRET | when unset it will use the value from randomUUID() | A long and secret string used to sign the JSON Web Token |
86+
| ACCOUNT_REGISTRATION | false | Allow users to register accounts |
87+
| HTTP_ALLOWED | false | Allow HTTP connections, only set this to true locally |
88+
| ALLOW_UNAUTHENTICATED | false | Allow unauthenticated users to use the service, only set this to true locally |
89+
| AUTO_DELETE_EVERY_N_HOURS | 24 | Checks every n hours for files older then n hours and deletes them, set to 0 to disable |
90+
| WEBROOT | | The address to the root path setting this to "/convert" will serve the website on "example.com/convert/" |
91+
| FFMPEG_ARGS | | Arguments to pass to ffmpeg, e.g. `-preset veryfast` |
92+
| HIDE_HISTORY | false | Hide the history page |
93+
| LANGUAGE | en | Language to format date strings in, specified as a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) |
9394

9495
### Docker images
9596

src/helpers/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ export const AUTO_DELETE_EVERY_N_HOURS = process.env.AUTO_DELETE_EVERY_N_HOURS
1313
export const HIDE_HISTORY = process.env.HIDE_HISTORY?.toLowerCase() === "true" || false;
1414

1515
export const WEBROOT = process.env.WEBROOT ?? "";
16+
17+
export const LANGUAGE = process.env.LANGUAGE?.toLowerCase() || "en";

src/pages/history.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { BaseHtml } from "../components/base";
44
import { Header } from "../components/header";
55
import db from "../db/db";
66
import { Filename, Jobs } from "../db/types";
7-
import { ALLOW_UNAUTHENTICATED, HIDE_HISTORY, WEBROOT } from "../helpers/env";
7+
import { ALLOW_UNAUTHENTICATED, HIDE_HISTORY, LANGUAGE, WEBROOT } from "../helpers/env";
88
import { userService } from "./user";
99

1010
export const history = new Elysia()
@@ -133,7 +133,7 @@ export const history = new Elysia()
133133
/>
134134
</svg>
135135
</td>
136-
<td safe>{new Date(job.date_created).toLocaleTimeString()}</td>
136+
<td safe>{new Date(job.date_created).toLocaleTimeString(LANGUAGE)}</td>
137137
<td>{job.num_files}</td>
138138
<td class="max-sm:hidden">{job.finished_files}</td>
139139
<td safe>{job.status}</td>

0 commit comments

Comments
 (0)