Skip to content

Commit

Permalink
Merge pull request #71 from rajnandan1/i18n-en
Browse files Browse the repository at this point in the history
I18n en
  • Loading branch information
rajnandan1 authored Apr 26, 2024
2 parents 2885cd6 + c0084a5 commit 283c38c
Show file tree
Hide file tree
Showing 24 changed files with 1,163 additions and 346 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ It uses files to store the data. Other adapters are coming soon
- Support for custom domains
- Embed Monitor as an iframe or widget
- Light + Dark Theme
- Internationalization support

**Incident Management:**
- Create Incidents using Github Issues - Rich Text
Expand Down
5 changes: 5 additions & 0 deletions config/site.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ footerHTML: |
Kener
</a>
an open source status page system built with Svelte and TailwindCSS.
i18n:
defaultLocale: "en"
locales:
en: "English"
hi: "Hindi"

20 changes: 20 additions & 0 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,26 @@ nav:
url: "/home"
```

## i18n

You can add translations to your site. By default it is set to `en`. Available translations are present in `locales/` folders in the root directory. You can add more translations by adding a new file in the `locales` folder.

### How to enable a translation

```yaml
i18n:
defaultLocale: en
locales:
en: English
hi: Hindi
```

- defaultLocale: The default locale to be used. This will be the language used when a user visits the site for the first time. It is important to note that the default locale json file should be present in the locales folder.
- locales: A list of locales that you want to enable. The key is the locale code and the value is the name of the language. The locale code should be the same as the json file name in the locales folder. `en` means `en.json` should be present in the locales folder.
- Adding more than one locales will enable a dropdown in the navbar to select the language.
- Selected languages are stored in cookies and will be used when the user visits the site again.
- There is no auto detection of the language. The user has to manually select the language.

## categories

You can define categories for your monitors. Each category can have a description. The monitors can be grouped by categories.
Expand Down
57 changes: 57 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"root": {
"ongoing_incidents": "Ongoing Incidents",
"availability_per_component": "Availability per Component",
"other_monitors": "Other Monitors",
"no_monitors": "No monitors found",
"read_doc_monitor": "Read the documentation to add your first monitor",
"here": "here",
"category": "Category",
"incident": "Incident",
"incidents": "Incidents",
"no_recent_incident": "No recent incident",
"recent_incidents": "Recent Incidents",
"active_incidents": "Active Incidents",
"no_active_incident": "No Active Incident",
"last_x_hours": "Last %hours hours"
},
"statuses": {
"UP": "UP",
"DOWN": "DOWN",
"DEGRADED": "DEGRADED"
},
"incident": {
"identified": "Identified",
"resolved": "Resolved",
"maintenance": "Maintenance"
},
"monitor": {
"share": "Share",
"badge": "Badge",
"embed": "Embed",
"mode": "Mode",
"status": "Status",
"copied": "Copied",
"uptime": "Uptime",
"theme": "Theme",
"theme_light": "Light",
"theme_dark": "Dark",
"today": "Today",
"90_day": "90 Day",
"share_desc": "Share this monitor using a link with others",
"badge_desc": "Get SVG badge for this monitor",
"embed_desc": "Embed this monitor using <script> or <iframe> in your app.",
"cp_link": "Copy Link",
"cpd_link": "Link Copied",
"cp_code": "Copy Code",
"cpd_code": "Code Copied",
"status_x_minute": "%status for %minute minute",
"status_x_minutes": "%status for %minutes minutes",
"status_x_hour_y_minute": "%status for %hours h and %minutes m",
"status_no_data": "No Data",
"status_ok": "Status OK",
"am": "am",
"pm": "pm"
},
"numbers": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
}
57 changes: 57 additions & 0 deletions locales/hi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"incident": {
"identified": "डेंटिफ़िएड",
"maintenance": "मेंटेनेंस",
"resolved": "रेसोल्वेड"
},
"monitor": {
"90_day": "९० दिन",
"am": "ऍम",
"badge": "बैज",
"badge_desc": "इस मॉनिटर के लिए SVG बैज प्राप्त करें",
"copied": "कोपीएड",
"cp_code": "कॉपी कोड",
"cp_link": "लिंक कॉपी करें",
"cpd_code": "कोड कॉपी किया गया",
"cpd_link": "लिंक कॉपी किया गया",
"embed": "एम्बेड",
"embed_desc": "इस मॉनीटर को एम्बेड करें<script> या<iframe> अपने ऐप में.",
"mode": "मोड",
"pm": "पं",
"share": "शेयर",
"share_desc": "लिंक का उपयोग करके इस मॉनिटर को अन्य लोगों के साथ शेयर करें",
"status": "स्टेटस",
"status_no_data": "कोई डेटा नहीं",
"status_ok": "स्थिति ठीक है",
"status_x_hour_y_minute": "%hours घंटा %minutes मिनट के लिए %status",
"status_x_minute": "%minute मिनट के लिए %status",
"status_x_minutes": "%minutes मिनट के लिए %status",
"theme": "थीम",
"theme_dark": "डार्क",
"theme_light": "लाइट",
"today": "आज",
"uptime": "अपटाइम"
},
"numbers": ["", "", "", "", "", "", "", "", "", ""],
"root": {
"active_incidents": "सक्रिय घटनाएं",
"availability_per_component": "प्रति कॉम्पोनेन्ट उपलब्धता",
"category": "श्रेणी",
"here": "यहाँ",
"incident": "हादसा",
"incidents": "घटनाएं",
"last_x_hours": "अंतिम %hours घंटे",
"no_active_incident": "कोई सक्रिय घटना नहीं",
"no_monitors": "कोई मॉनिटर नहीं मिला",
"no_recent_incident": "कोई हालिया घटना नहीं",
"ongoing_incidents": "चल रही घटनाएँ",
"other_monitors": "अन्य मॉनिटर",
"read_doc_monitor": "अपना पहला मॉनिटर जोड़ने के लिए डॉक्यूमेंटेशन पढ़ें",
"recent_incidents": "हाल की घटनाएँ"
},
"statuses": {
"DEGRADED": "डेग्रेडेड",
"DOWN": "डाउन",
"UP": "उप"
}
}
Loading

0 comments on commit 283c38c

Please sign in to comment.