Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@opensea/next-translate
Advanced tools
@opensea/next-translate
provides a useTranslate
hook that returns a translation function that wraps next-translate's t
function to support in-code defaults for plural translation variants and a slightly improved interface for translations without variables.
npm install
import { useTranslate } from '@opensea/next-translate';
const Example = () => {
const t = useTranslate('ns1');
const [count, setCount] = useState(0);
// Second param is default value and third param variables (optional)
const noVariables = t('example.noVariables', 'No variables');
// Default values for "zero", "one", and "other" translations variants can be specified in code
const plurals = t(
'example.plurals',
{
zero: 'No items',
one: '1 item',
other: '{{count}} items'
},
{ count }
);
// Default value for "zero" can be omitted and default value for "other" will be used
const optionalZero = t(
'example.optionalZero',
{ one: '1 item', other: '{{count}} items' },
{ count }
);
// ...
};
npm run test
FAQs
Package for custom useTranslate hook
The npm package @opensea/next-translate receives a total of 90 weekly downloads. As such, @opensea/next-translate popularity was classified as not popular.
We found that @opensea/next-translate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.