Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
logseq-l10n
Advanced tools
L10N framework for Logseq plugins.
import "@logseq/libs"
import { setup, t } from "logseq-l10n"
import zhCN from "./translations/zh-CN.json"
logseq
.ready(async () => {
// `urlTemplate` is a template for the URL used to fetch the
// translation files. "${locale}" will be replaced with user's
// current locale.
// `builtinTranslations` when provided, can accelerate the setup
// process if user's locale is already contained.
// `defaultLocale` when provided (default to "en"), can accelerate
// the setup process if user's locale matches the default one.
const l10nSetup = setup({
urlTemplate:
"https://raw.githubusercontent.com/sethyuan/logseq-plugin-doc/master/src/translations/${locale}.json",
builtinTranslations: { "zh-CN": zhCN },
})
// Here goes other plugin initialization code.
// You have to await setup to finish before calling other
// functions in `logseq-l10n`.
await l10nSetup
// Use `t` for text with translations.
console.log(t("Hello world!"))
// Text with arguments is also supported.
console.log(t("Hello ${name}!", { name: "world" }))
})
.catch(console.error)
// src/translations/zh-CN.json
// Key is the default text used, value is the respective translation.
{
"Hello world!": "你好世界!",
"Hello ${name}!": "你好${name}!"
}
For a referential plugin implementation, please see logseq-plugin-doc.
In the simplest case, you only need to give a urlTemplate
to setup
. Users then can contribute translations in the form of PR, and when you merge them, the translations will be available for use immediately for future fetches.
FAQs
L10N framework for Logseq plugins
We found that logseq-l10n demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.