Skip to content

Commit b9b16aa

Browse files
committed
📝(documentation) adds customization for translations
Part of customization PoC
1 parent b3ec520 commit b9b16aa

File tree

4 files changed

+85
-33
lines changed

4 files changed

+85
-33
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
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

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

docs/env.md

Lines changed: 2 additions & 0 deletions
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

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)