Skip to content

Commit 06b91a1

Browse files
committed
📝(documentation) adds customization for translations
Part of customization PoC
1 parent 3019ec1 commit 06b91a1

File tree

4 files changed

+82
-34
lines changed

4 files changed

+82
-34
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to
1111
## Added
1212

1313
- 🚩 add homepage feature flag #861
14-
14+
- ✨(frontend) add customization for translations #857
1515

1616
## [3.1.0] - 2025-04-07
1717

docs/customization.md

+79
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

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ These are the environmental variables you can set for the impress-backend contai
5353
| FRONTEND_FOOTER_VIEW_CACHE_TIMEOUT | Cache duration of the json footer | 86400 |
5454
| FRONTEND_URL_JSON_FOOTER | Url with a json to configure the footer | |
5555
| FRONTEND_THEME | frontend theme to use | |
56+
| FRONTEND_CSS_URL | URL to a custom CSS file for theming the application | |
57+
| FRONTEND_CUSTOM_TRANSLATIONS_URL | URL to a JSON file containing custom translations for the application | |
5658
| POSTHOG_KEY | posthog key for analytics | |
5759
| CRISP_WEBSITE_ID | crisp website id for support | |
5860
| DJANGO_CELERY_BROKER_URL | celery broker url | redis://redis:6379/0 |

docs/theming.md

-33
This file was deleted.

0 commit comments

Comments
 (0)