Skip to content

Commit 81fd1ed

Browse files
committed
📝(documentation) adds customization for translations
Part of customization PoC
1 parent 2c0df8c commit 81fd1ed

File tree

4 files changed

+81
-33
lines changed

4 files changed

+81
-33
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to
88

99
## [Unreleased]
1010

11+
## Added
12+
13+
- ✨(frontend) add customization for translations #857
14+
1115
## [3.1.0] - 2025-04-07
1216

1317
## Added

docs/customization.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Application Customization 🛠️
2+
3+
This document outlines the various ways you can customize our application to suit your specific needs without modifying the core codebase.
4+
5+
## Available Customization Options
6+
7+
1. [Translations](#custom-translations)
8+
2. [CSS/Theme](#custom-css)
9+
10+
## Custom Translations
11+
12+
### How to Use
13+
14+
To provide custom translations, set the `FRONTEND_CUSTOM_TRANSLATIONS_URL` environment variable to the URL of your custom translations JSON file:
15+
16+
```javascript
17+
FRONTEND_CUSTOM_TRANSLATIONS_URL=http://example.com/custom-translations.json
18+
```
19+
20+
Once you've set this variable, our application will load your custom translations and apply them to the user interface.
21+
22+
### Benefits
23+
24+
- **Language control** 🌐: Customize terminology to match your organization's vocabulary.
25+
- **Context-specific language** 📝: Adapt text for your specific use case or industry.
26+
27+
### Example Use Case
28+
29+
Let's say you want to customize some key phrases in the application. Create a JSON file with your custom translations:
30+
31+
```json
32+
{
33+
"en": {
34+
"Docs": "Notes",
35+
"Create New Document": "+"
36+
},
37+
"de": {
38+
"Docs": "Notizen",
39+
"Create New Document": "+"
40+
}
41+
}
42+
```
43+
44+
Then set the `FRONTEND_CUSTOM_TRANSLATIONS_URL` environment variable to the URL of this JSON file. The application will load these translations and override the default ones where specified.
45+
46+
## Custom CSS
47+
48+
### How to Use
49+
50+
To customize the application's appearance, set the `FRONTEND_CSS_URL` environment variable to the URL of your custom CSS file:
51+
52+
```javascript
53+
FRONTEND_CSS_URL=http://example.com/custom-style.css
54+
```
55+
56+
Once you've set this variable, our application will load your custom CSS file and apply the styles to our frontend application.
57+
58+
### Benefits
59+
60+
- **Easy customization** 🔄: Customize the look and feel of our application without requiring any code changes.
61+
- **Flexibility** 🌈: Use any CSS styles to create a custom theme that meets your needs.
62+
- **Runtime theming** ⏱️: Change the theme of our application at runtime, without requiring a restart or recompilation.
63+
64+
### Example Use Case
65+
66+
Let's say you want to change the background color of our application to a custom color. Create a custom CSS file with the following contents:
67+
68+
```css
69+
body {
70+
background-color: #3498db;
71+
}
72+
```
73+
74+
Then, set the `FRONTEND_CSS_URL` environment variable to the URL of your custom CSS file. Once you've done this, our application will load your custom CSS file and apply the styles, changing the background color to the custom color you specified.
75+

docs/env.md

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ These are the environmental variables you can set for the impress-backend contai
4848
| COLLABORATION_SERVER_SECRET | collaboration api secret | |
4949
| COLLABORATION_WS_URL | collaboration websocket url | |
5050
| FRONTEND_THEME | frontend theme to use | |
51+
| FRONTEND_CSS_URL | URL to a custom CSS file for theming the application | |
52+
| FRONTEND_CUSTOM_TRANSLATIONS_URL | URL to a JSON file containing custom translations for the application | |
5153
| POSTHOG_KEY | posthog key for analytics | |
5254
| CRISP_WEBSITE_ID | crisp website id for support | |
5355
| DJANGO_CELERY_BROKER_URL | celery broker url | redis://redis:6379/0 |

docs/theming.md

-33
This file was deleted.

0 commit comments

Comments
 (0)