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.
babelfish-plus
Advanced tools
Babelfish react helpers. Can be used for rendering props as react widgets. All babelfish power accessible from helper. Returns array of translated strings and functions:
t(message: string, params: ?Map<string, string|object|func>): Array<string|object|func>|string
t('Translated') // 'Translated'
t('Translated #{str}', {str: 'test'}) // 'Translated test'
t('Translated #{str} #{func} #{obj} #{arr}', {
t: 'test',
func: p => p,
obj: {a: 1},
arr: [1, 2, 3]
}) // ['Translated test', func, {a: 1}, [1, 2, 3]]
import translator from 'babelfish-plus'
const options = {
locale: 'ru',
phrases: {
user: {
birthday: 'День рождения: #{date}'
}
}
}
const t = translator(options)
t('user.birthday', {date: '01.01.1970'}) // 'День рождения: 01.01.1970'
t('user.birthday', {date: p => new Date(p)}) // ['День рождения: ', Func]
t('not.existing.path') // 'not.existing.path'
import React, {PropTypes} from 'react'
import translator from 'babelfish-plus'
import T from 'babelfish-plus/react/T'
const {func, string} = PropTypes
class Date extends React.Component {
static propTypes = {
date: string.isRequired
}
render() {
return (
<span className="date">{this.props.date}</span>
)
}
}
class UserBirthday extends React.Component {
static propTypes = {
date: string.isRequired
}
render() {
return (
<div>
<T>User info</T>
<T date={<Date value={this.props.date} />}>user.birthday</T>
</div>
)
}
}
class App extends React.Component {
static propTypes = {
t: func.isRequired,
birthday: string.isRequired
}
static childContextTypes = {
t: func
}
getChildContext() {
return {
t: this.props.t
}
}
render() {
return (
<UserBirthday date={this.props.birthday} />
)
}
}
const options = {
locale: 'ru',
phrases: {
'User info': 'О пользователе',
user: {
birthday: 'День рождения: #{date}'
}
}
}
const t = translator(options)
React.render(<App t={t} birthday="01.01.1970" />, document.geteElementById('root'))
FAQs
Babelfish based i10n
We found that babelfish-plus 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.
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.