feat: employ l10n to tinymist-cli and vscode extension (#1505)

* feat: runtime translation

* feat: poc of rust translation

* feat: clean up implementation

* feat: initialize correctly

* dev: remove dirty log

* dev: rename l10nMsg

* fix: desc

* feat: update assets building

* feat: update assets building

* build: update cargo.lock

* fix: warnings

* fix: warnings

* dev: expose api

* fix: compile error

* fix: compile errors in scripts
This commit is contained in:
Myriad-Dreamin 2025-03-15 10:38:07 +08:00 committed by GitHub
parent dc9013e253
commit 4cbe35a286
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 615 additions and 62 deletions

View file

@ -31,18 +31,33 @@ impl SemanticRequest for CodeLensRequest {
data: None,
};
res.push(doc_lens("Profile", vec!["profile".into()]));
res.push(doc_lens("Preview", vec!["preview".into()]));
res.push(doc_lens(
&tinymist_l10n::t!("tinymist-query.code-action.profile", "Profile"),
vec!["profile".into()],
));
res.push(doc_lens(
&tinymist_l10n::t!("tinymist-query.code-action.preview", "Preview"),
vec!["preview".into()],
));
let is_html = ctx.world.library.features.is_enabled(typst::Feature::Html);
if is_html {
res.push(doc_lens("Export HTML", vec!["export-html".into()]));
res.push(doc_lens(
&tinymist_l10n::t!("tinymist-query.code-action.exportHtml", "Export HTML"),
vec!["export-html".into()],
));
} else {
res.push(doc_lens("Export PDF", vec!["export-pdf".into()]));
res.push(doc_lens(
&tinymist_l10n::t!("tinymist-query.code-action.exportPdf", "Export PDF"),
vec!["export-pdf".into()],
));
}
res.push(doc_lens("More ..", vec!["more".into()]));
res.push(doc_lens(
&tinymist_l10n::t!("tinymist-query.code-action.more", "More .."),
vec!["more".into()],
));
Some(res)
}