l10n

package
v1.8.1-0...-100120b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 1 Imported by: 0

README ยถ

๐Ÿ”ค Localization

This directory contains the file 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.

[!NOTE] In version 2.*, the working logic was simpler: error pages loaded this script using jsdelivr.com as a CDN for versioned content from the GitHub repository, and it translated tag content with the special HTML attribute data-l10n.

By default, the error page markup contains strings in English (en locale). To localize the error pages to different locales, please follow these steps:

  1. Find your locale name on this page (column Set 1 or ISO 639-1:2002)
  2. Fork this repository
  3. Edit the file 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 file to test the localization
  5. Make a PR with your changes

๐Ÿ‘ Translators

Documentation ยถ

Index ยถ

Constants ยถ

This section is empty.

Variables ยถ

This section is empty.

Functions ยถ

func L10n ยถ

func L10n() string

L10n returns the content of the JS file with a script for automatic error page localization.

Types ยถ

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL