Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@bothrs/translations
Advanced tools
A hook which loads the translations from an external source and initializes i18next.
A hook which loads the translations from an external source and initializes i18next.
yarn add @bothrs/translations
import { useTranslations } from '@bothrs/translations'
useTranslations
return a boolean which indicates if the translations are loaded. This can be used to hide the splashscreen.
const translationsLoaded = useInitI18Next({
expirationTime: 60 * 1000,
startupLanguage: 'nl',
fallbackLng: 'nl',
loadPath: api + 'translations',
dataFormatter: data => {
return data.translations
},
})
Name | Explanation |
---|---|
expirationTime | Time between translation refreshes in ms |
startupLanguage | startup language |
fallbackLng | fallback language |
loadPath | The endpoint from where the translations will be loaded |
dataFormatter | A function which allows you to format the data fetched so it matches the FormattedTranslation type |
For now, airtable is the only supported data-source of @bothrs/translations
.
The base should have the folowing columns
column name | mandatory | explanation |
---|---|---|
key | true | the key that will be used in the i18next t method |
en / nl / fr / ... | true | the iso code of the supported languages |
category | false | We recommend to use a category column to group related records in airtable |
FAQs
A hook which loads the translations from an external source and initializes i18next.
The npm package @bothrs/translations receives a total of 37 weekly downloads. As such, @bothrs/translations popularity was classified as not popular.
We found that @bothrs/translations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.