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.
ra-language-farsi
Advanced tools
Farsi translations for React-Admin, the frontend framework for building admin applications on top of REST/GraphQL services.
Farsi translations for React-Admin, the frontend framework for building admin applications on top of REST/GraphQL services.
npm install --save ra-language-farsi
yarn add ra-language-farsi
import farsiMessages from 'ra-language-farsi';
import polyglotI18nProvider from 'ra-i18n-polyglot';
const messages = {
'fa': farsiMessages,
};
const i18nProvider = polyglotI18nProvider(locale => messages[locale], 'fa');
<Admin i18nProvider={i18nProvider}>
...
</Admin>
Material UI is already supprting RTL, so we can add its support to React Admin using these 2 steps:
dir
property to rtl
in your root elements (like body).Using HTML (public/index.html):
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root" dir="rtl"></div>
</body>
Using CSS style:
body {
direction: rtl;
}
Or Pure JS:
document.getElementsByTagName("body")[0].setAttribute('dir', 'rtl');
direction
to rtl
. Also defining an RTL theme might be not enough to flip all React Admin components. So we use jss-rtl plugin to make sure everything works properly.import { createTheme } from '@material-ui/core/styles';
import {create} from 'jss';
import rtl from 'jss-rtl';
import {StylesProvider, jssPreset} from '@material-ui/core/styles';
// Configure JSS
const jss = create({plugins: [...jssPreset().plugins, rtl()]});
const theme = createTheme({
direction: 'rtl',
});
const App = () => (
<StylesProvider jss={jss}>
<Admin theme={theme}>
// ...
</Admin>
</StylesProvider>
);
This translation is licensed under the BSD Licence, and sponsored by Hamid FzM.
FAQs
Farsi translations for React-Admin, the frontend framework for building admin applications on top of REST/GraphQL services.
We found that ra-language-farsi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.