Skip to content

Commit 9aae332

Browse files
tarampampamCopilot
andauthored
Add win98 template (with localization) (#355)
* ✨ feat: Add win98 template with localization Adds a new "win98" template, emulating a Windows 98 error page, and includes localization support for various UI elements like "My Computer", "My Documents", and "Start" button. Also updates the CLI documentation to include the new template. * Update templates/win98.html Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * 🐛 fix(win98): Correct AM/PM determination in clock The original logic used `hours` which was already in 24-hour format, leading to incorrect AM/PM display after noon; switched to `hours24` to fix this issue. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7c1be9e commit 9aae332

File tree

4 files changed

+597
-3
lines changed

4 files changed

+597
-3
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,22 @@ The following templates are built-in and available for use without any additiona
251251
</a>
252252
</td>
253253
</tr>
254+
<tr>
255+
<td align="center">
256+
<code>win98</code><br/><br/>
257+
<picture>
258+
<img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Ferror-pages.goatcounter.com%2Fcounter%2F%2Fuse-template%2Fwin98.json&query=%24.count&label=used%20times" alt="used times">
259+
</picture>
260+
</td>
261+
<td>
262+
<a href="https://tarampampam.github.io/error-pages/win98/404.html">
263+
<picture>
264+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/bdebb475-0524-43ac-8cc6-4b194228e6e1">
265+
<img align="center" src="https://github.com/user-attachments/assets/dc503e2d-dde1-4606-994c-3b448e2acd94">
266+
</picture>
267+
</a>
268+
</td>
269+
</tr>
254270
</tbody>
255271
</table>
256272

@@ -819,7 +835,7 @@ Transfer/sec: 1.94GB
819835
</details>
820836

821837
<!--GENERATED:CLI_DOCS-->
822-
<!-- Documentation inside this block generated by github.com/urfave/cli; DO NOT EDIT -->
838+
<!-- Documentation inside this block generated by github.com/urfave/cli-docs/v3; DO NOT EDIT -->
823839
## CLI interface
824840

825841
Usage:
@@ -857,7 +873,7 @@ The following flags are supported:
857873
| `--json-format="…"` | Override the default error page response in JSON format (Go templates are supported; the error page will use this template if the client requests JSON content type) | | `RESPONSE_JSON_FORMAT` |
858874
| `--xml-format="…"` | Override the default error page response in XML format (Go templates are supported; the error page will use this template if the client requests XML content type) | | `RESPONSE_XML_FORMAT` |
859875
| `--plaintext-format="…"` | Override the default error page response in plain text format (Go templates are supported; the error page will use this template if the client requests plain text content type or does not specify any) | | `RESPONSE_PLAINTEXT_FORMAT` |
860-
| `--template-name="…"` (`-t`) | Name of the template to use for rendering error pages (built-in templates: app-down, cats, connection, ghost, hacker-terminal, l7, lost-in-space, noise, orient, shuffle) | `app-down` | `TEMPLATE_NAME` |
876+
| `--template-name="…"` (`-t`) | Name of the template to use for rendering error pages (built-in templates: app-down, cats, connection, ghost, hacker-terminal, l7, lost-in-space, noise, orient, shuffle, win98) | `app-down` | `TEMPLATE_NAME` |
861877
| `--disable-l10n` | Disable localization of error pages (if the template supports localization) | `false` | `DISABLE_L10N` |
862878
| `--default-error-page="…"` | The code of the default (index page, when a code is not specified) error page to render | `404` | `DEFAULT_ERROR_PAGE` |
863879
| `--send-same-http-code` | The HTTP response should have the same status code as the requested error page (by default, every response with an error page will have a status code of 200) | `false` | `SEND_SAME_HTTP_CODE` |

l10n/l10n.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,45 @@ Object.defineProperty(window, 'l10n', {
955955
['pl', 'Sprawdź adres URL i spróbuj ponownie'],
956956
['ko', 'URL을 다시 한번 확인해 주세요'],
957957
])],
958+
[tkn('My Computer'), new Map([
959+
['fr', 'Poste de travail'],
960+
['ru', 'Мой компьютер'],
961+
['uk', 'Мій комп’ютер'],
962+
['pt', 'Meu computador'],
963+
['nl', 'Deze computer'],
964+
['de', 'Arbeitsplatz'],
965+
['es', 'Mi PC'],
966+
['zh', '我的电脑'],
967+
['id', 'Komputer Saya'],
968+
['pl', 'Mój komputer'],
969+
['ko', '내 컴퓨터'],
970+
])],
971+
[tkn('My Documents'), new Map([
972+
['fr', 'Mes documents'],
973+
['ru', 'Мои документы'],
974+
['uk', 'Мої документи'],
975+
['pt', 'Meus documentos'],
976+
['nl', 'Mijn documenten'],
977+
['de', 'Eigene Dateien'],
978+
['es', 'Mis documentos'],
979+
['zh', '我的文档'],
980+
['id', 'Dokumen Saya'],
981+
['pl', 'Moje dokumenty'],
982+
['ko', '내 문서'],
983+
])],
984+
[tkn('Start'), new Map([
985+
['fr', 'Démarrer'],
986+
['ru', 'Пуск'],
987+
['uk', 'Пуск'],
988+
['pt', 'Iniciar'],
989+
['nl', 'Start'],
990+
['de', 'Start'],
991+
['es', 'Inicio'],
992+
['zh', '开始'],
993+
['id', 'Mulai'],
994+
['pl', 'Start'],
995+
['ko', '시작'],
996+
])],
958997
]));
959998

960999
// detect browser locale (take only 2 first symbols)

l10n/playground.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
'Request ID', 'Timestamp', 'client-side error', 'server-side error', 'Your Client', 'Network', 'Web Server',
106106
'What happened?', 'What can i do?', 'Please try again in a few minutes', 'Working', 'Unknown',
107107
'Please try to change the request method, headers, payload, or URL', 'Please check your authorization data',
108-
'Please double-check the URL and try again',
108+
'Please double-check the URL and try again', 'My Computer', 'My Documents', 'Start',
109109
].forEach((token) => {
110110
const $li = document.createElement('li');
111111

0 commit comments

Comments
 (0)