2022-03-28 11:04:23 +00:00
|
|
|
# 🔤 Localization
|
2022-03-23 19:31:34 +00:00
|
|
|
|
2024-07-03 14:12:13 +00:00
|
|
|
This directory contains the file [l10n.js](l10n.js) for localizing error pages. Once the error page is loaded,
|
|
|
|
this script runs and translates the page content to the user's locale.
|
2022-03-23 19:31:34 +00:00
|
|
|
|
2024-07-03 14:12:13 +00:00
|
|
|
> [!NOTE]
|
|
|
|
> In version `2.*`, the working logic was simpler: error pages loaded this script using
|
|
|
|
> [jsdelivr.com](https://www.jsdelivr.com/) as a CDN for
|
|
|
|
> [versioned content from the GitHub repository](https://www.jsdelivr.com/features#gh), and it translated
|
|
|
|
> tag content with the special HTML attribute `data-l10n`.
|
2022-03-23 19:31:34 +00:00
|
|
|
|
2024-07-03 14:12:13 +00:00
|
|
|
By default, the error page markup contains strings in English (`en` locale). To localize the error pages to
|
|
|
|
different locales, please follow these steps:
|
2022-03-23 19:31:34 +00:00
|
|
|
|
2024-07-03 14:12:13 +00:00
|
|
|
1. Find your locale name on [this page](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (column `Set 1` or `ISO 639-1:2002`)
|
|
|
|
2. Fork this repository
|
|
|
|
3. Edit the file [l10n.js](l10n.js) in the `data` map (append new localized strings) using the locale name from step 1
|
|
|
|
4. Please add your locale to the [playground.html](playground.html) file to test the localization
|
|
|
|
5. Make a PR with your changes
|
2022-03-28 11:04:23 +00:00
|
|
|
|
|
|
|
## 👍 Translators
|
|
|
|
|
|
|
|
- 🇫🇷 French by [@jvin042](https://github.com/jvin042)
|
2022-05-07 10:09:23 +00:00
|
|
|
- 🇵🇹 Portuguese by [@fabtrompet](https://github.com/fabtrompet)
|
|
|
|
- 🇳🇱 Dutch by [@SchoNie](https://github.com/SchoNie)
|
2022-06-04 12:06:39 +00:00
|
|
|
- 🇩🇪 German by [@mschoeffmann](https://github.com/mschoeffmann)
|
2022-07-25 07:13:18 +00:00
|
|
|
- 🇪🇸 Spanish by [@Runig006](https://github.com/Runig006)
|
2022-11-01 21:23:29 +00:00
|
|
|
- 🇨🇳 Chinese by [@CDN18](https://github.com/CDN18)
|
2023-09-01 06:25:17 +00:00
|
|
|
- 🇮🇩 Indonesian by [@getwisp](https://github.com/getwisp)
|
2023-09-28 06:51:55 +00:00
|
|
|
- 🇵🇱 Polish by [@wielorzeczownik](https://github.com/wielorzeczownik)
|