Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
The objective of this tool is to make easy to migrate an existing codebase to use i18n
The objective of this tool is to make easy to migrate an existing codebase to use i18n
Before this transform
import React from 'react';
const Simple = () => (
<span>My simple text</span>
);
After this transform
import React from 'react';
import { withTranslation } from 'react-i18next'
const Simple = ({ t }) => (
<span>{t('my_simple_text')}</span>
);
yarn start --src=myapp/src
export default {
translation: {
'ok': `ok`,
'cancelar': `cancelar`,
'continuar': `continuar`,
'salvar': `salvar`,
'endereco': `endereço:`,
'troca_de_senha': `troca de senha`,
'dados_pessoais': `dados pessoais`,
[key]: 'value',
}
}
import en from './en';
i18n.use(LanguageDetector).init({
resources: {
en,
},
fallbackLng: 'ptBR',
debug: false,
interpolation: {
escapeValue: false, // not needed for react!!
formatSeparator: ',',
},
react: {
wait: true,
},
});
npm i -g jscodeshift
jscodeshift -t src/i18nTransfomerCodemod.ts PATH_TO_FILES
Use ast.config.js to customize blacklist for jsx attribute name and call expression calle
module.exports = {
blackListJsxAttributeName: [
'type',
'id',
'name',
'children',
'labelKey',
'valueKey',
'labelValue',
'className',
'color',
'key',
'size',
'charSet',
'content',
],
blackListCallExpressionCalle: [
't',
'_interopRequireDefault',
'require',
'routeTo',
'format',
'importScripts',
'buildPath',
'createLoadable',
'import',
'setFieldValue',
],
};
FAQs
The objective of this tool is to make easy to migrate an existing codebase to use i18n
The npm package ast-i18n receives a total of 0 weekly downloads. As such, ast-i18n popularity was classified as not popular.
We found that ast-i18n demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.