import { LanguageService } from "https://deno.land/x/freshlate@0.4.1/freshlate/translation.ts";
The main translation/language class. This handles storage of languages, translation/replacement of dynamic substrings, and the ability to add new languages.
Properties
A key to fall back to if the key is not found in the given language. If the fallback key is not found, the fallback language will be checked. If the fallback key isn't found in the fallback language either, the value returned will be "NOT_FOUND"
A list of languages that have been hydrated/updated post class initialisation
Methods
Add a new language into the languages object
Returns an array of all supported languages
Returns the value for a specific language and key
Returns a new function for translating to a specific language replacing the t method
Merge a new set of translations and keys into the language object
Checks to see if a language is hydrated/updated
Checks if a language is supported
Sets a language as hydrated
Translates a key to a specific language, replacing substrings with necessary values as needed