-
Notifications
You must be signed in to change notification settings - Fork 0
Utils
a collection of useful snippets
This module prepares the input into an array of words and character to be processed by Doctors Cot and Tardis Console.
This module contains the whole handling for graphical output as svg. It creates a filestream, prepares the "canvas" and serves with tidy functions to implement easy drawing instructions within the different modules.
This module handles multiple languages for the user interface of the translation helper.
Any language can be registered by adding a property to UILanguage.supported
named the language code and an array of the language name and a flag as svg.
Language chunks are set within UILanguage.say
according to registered languages. After importing this module to the gallifreyan scribe modules this property can be extended with specific chunks.
Selected languages can be set and get using localStorage with english as default fallback.
Output of the concerning chunk happens with calling UILanguage.write("chunkname")
. This method retrieves the selected or default language on its own. A warning alert will pop up if any chunk is undefined. If a chunk is not set in the desired language for any reason the english chunk will be selected by default.
UILanguage.init()
will initiate the overall user interface and overwrite with the selected language chunks after rendering the page. Due to the modular handling of the JS-files a conventional integration of the script within the header and writing everything during rendering throws an error. This method also initiates the display of supported languages and sets up the eventHandler for selection.