Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

monaco i18n #433

Merged
merged 2 commits into from
Apr 29, 2024
Merged

monaco i18n #433

merged 2 commits into from
Apr 29, 2024

Conversation

ComfyFluffy
Copy link
Contributor

@ComfyFluffy ComfyFluffy commented Apr 29, 2024

通过@monaco-editor/loader从CDN导入monaco代码,在导入前配置及下载语言包。导入只会跑一次,导致语言初始化后不会更新。

const monacoEditor = shallowRef<monaco.editor.IStandaloneCodeEditor | null>(null)

useMonacoInitialization()
const monacoInstance = shallowRef<{
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个名字有点别扭,不好命名的话可以拆成两个 ref:monaco & monaco-editor,就比较清晰了

const { t, lang } = useI18n()

watchEffect(async (onClenaup) => {
loader.config({
Copy link
Collaborator

Choose a reason for hiding this comment

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

如企业微信沟通,我们加一下变更语言刷新页面的逻辑吧,确保 editor 正确地以当前语言展示

@qiniu-ci
Copy link

The PR environment is ready, please check the PR environment

[Attention]: This environment will be automatically cleaned up after a certain period of time., please make sure to test it in time. If you have any questions, please contact the builder team.

@nighca nighca merged commit 9f08051 into goplus:dev Apr 29, 2024
3 of 4 checks passed
@nighca nighca mentioned this pull request Apr 30, 2024
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.

3 participants