Skip to content

Add multilanguage support#58

Open
RensOliemans wants to merge 26 commits intoargenos:masterfrom
RensOliemans:multilanguage
Open

Add multilanguage support#58
RensOliemans wants to merge 26 commits intoargenos:masterfrom
RensOliemans:multilanguage

Conversation

@RensOliemans
Copy link

@RensOliemans RensOliemans commented Nov 4, 2021

Implements #19

Copy link
Author

@RensOliemans RensOliemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit of explaining

import t from "../lang/helper";


interface IDateCompletion {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this only had a label: string I removed it, that made the code a bit more readable (the interface contained only a string, now it's just a string), but if it was necessary then I can of course revert it

}

private getTimeSuggestions(inputStr: string, lang: string): string[] {
if (inputStr.match(new RegExp(`^${t("time", lang)}`))) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the way that I dealt with the suggestions: the regex contains translatable parts. So time for English, tijd voor Dutch, etc. Then everything about translations (both the actual suggestions, and the regex for determining them) was done the same way

"es5",
"scripthost",
"es2015"
"es2019"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary for Array.flatMap. Not sure if this breaks anything, if it does I can revert it since a flatMap can easily be transformed into es2015 compatible code

@argenos argenos deleted the branch argenos:master November 17, 2021 13:47
@argenos argenos closed this Nov 17, 2021
@argenos argenos reopened this Nov 17, 2021
@argenos argenos changed the base branch from refactor/cm6-migration to develop November 17, 2021 17:14
@argenos
Copy link
Owner

argenos commented Nov 17, 2021

Sorry about that! GitHub freaked out when I deleted my branch earlier today! It should be good now!

@RensOliemans
Copy link
Author

OK no problem, I merged develop back into my branch. One issue which I had is that the new Obsidian version (v0.13.0) isn't on npm, that's why you added
"obsidian": "git+https://github.com/obsidianmd/obsidian-api.git#5687a75ecfdb78b6a832127cf6f9229e27e196a0",
in package.json. Unfortunately, neither npm nor yarn allows that version for specification for me.

yarn:

error Can't add "obsidian": invalid package version undefined.

npm:

npm ERR! Invalid Version:

How did you get this working for you? The only relevant thing changed is setInstructions in EditorSuggest, but I can't seem to install the correct version

@argenos
Copy link
Owner

argenos commented Nov 18, 2021

Sorry, we switched to yarn on this release! I'll add to the changelog now

@RensOliemans RensOliemans changed the base branch from develop to master January 20, 2022 13:05
@RensOliemans RensOliemans marked this pull request as ready for review January 20, 2022 13:08
@RensOliemans
Copy link
Author

@argenos I merged master back into this branch and set it as ready for review, are you willing to review it?

@hyungtaecf
Copy link

What is the current status of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants