
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@oyvindher/react-translate
Advanced tools
Clone repository
$ git clone https://github.com/oyvindhermansen/react-translate.git
To install dependencies:
bun install
To build:
bun run build
This is a solution for creating easy translations for React SPA's. It provides a scalable solution to adding different languages to e.g a dashboard or some other type of SPA-application.
This is how it works:
import { TranslateProvider } from "@oyvindher/react-translate";
const translations = {
no: {
intro: "Velkommen",
},
en: {
intro: "Welcome",
},
};
const App: React.FC = () => {
return (
<TranslateProvider translations={translations} lang="no">
<MyApplication />
</TranslateProvider>
);
};
import { useTranslate } from "@oyvindher/react-translate";
const MyApplication: React.FC = () => {
const { t } = useTranslate();
return (
<div>
<h1>{t("intro")}</h1>
</div>
);
};
The translations can contain a variable if wrapped in {{ }}
.
So if the translation object looks like this:
const translations = {
no: {
intro: "Velkommen, {{username}}",
},
en: {
intro: "Welcome, {{username}}",
},
};
The translator function takes variables as a second argument, and will be mapped to the name of the variable.
import { useTranslate } from "@oyvindher/react-translate";
const MyApplication: React.FC = () => {
const { t } = useTranslate();
const user = "John Doe";
return (
<div>
<h1>{t("intro", { username: user })}</h1>
</div>
);
};
This project was created using bun init
in bun v1.2.4. Bun is a fast all-in-one JavaScript runtime.
FAQs
A simple React translation library
We found that @oyvindher/react-translate demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.