Set up json for tradional chinese and english.#100
Open
mariomui wants to merge 1 commit intopjeby:masterfrom
Open
Set up json for tradional chinese and english.#100mariomui wants to merge 1 commit intopjeby:masterfrom
mariomui wants to merge 1 commit intopjeby:masterfrom
Conversation
Add error checking if i18 module is null. Remove debug logs.
cawolfdev
reviewed
Feb 20, 2024
| } | ||
| menu.addItem( | ||
| item("crossed-star" , "Exclude #"+tagName+" from search", () => search.openGlobalSearch(query+" -tag:" + tagName)) | ||
| item("crossed-star" , `${this.it[EXCLUDE]} #${tagName} ${this.it[FROM_SEARCH]}`, () => search.openGlobalSearch(query+" -tag:" + tagName)) |
There was a problem hiding this comment.
In short, this violates the very basics of translation.
One must NEVER concatenate strings for any reason.
Word order varies by language. Words need to conjugation to agree with substituted elements (gender agreement, case agreement (declination), sound-agreement (different words used depending if e/i or o/u are in the object, etc).
This fails for languages that:
- Place Verb Last (JP) -
#tag from-search exclude - Require conjugation of tag (FI)
exclude #tag":n" from-search - Place Complement First -
from-search exclude #tag - That split the components -
search #tag-target-from exclude - That require reduplication -
#tag-from-search #tag-target exclude
Etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.