Set up json for tradional chinese and english. #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Locales have two dictionaries, one for english, one for traditional chinese.
The naming system(for the dictionaries) used will be based on https://github.com/mgmeyers/obsidian-kanban/blob/05e43e09100f8c8efd7a4cd5ccb391b850e65f28/src/lang/helpers.ts#L53
locale.ts is our module based off jquery. Allows for future middle ware. Inside the IIFE parameters as well as provide an area to intercept changes required by Android/IOS (not implemented)
The onLoad fn housed inside of the Plugin Instance has the bootup code. Should the module fail to load, the translate default function will default to english (tested) and a error will console out via try catch.
moment.locale is used to detect the desired language. i18.changeLanguage() with empty parameters will also run auto detection , and with paramters will change the language. But having settings isn't your style. Myers used window.localStorage for his knobs. (i have no opinion on this matter.)
zhTW dictionary typed with partial so the dictionary need not be synced in lockstep with en. Updating can happen at leisure, and staggered.
Example of adding a new translated word.