I18n JS Toolkit
- I18n JS library
- ESLint plugin for automatic generation of files with translations
- Babel plugin for removing unnecessary locales in prod builds
- Ready-made Github Actions to synchronize translations between the service and your JS code
npm i localang-i18n-js
Use the JS library with any framework
Don't think about creating translation files and filling them out. Just write i18n('Your text')
in any JS/TS file within your project and leave the rest to the JS library: it will create a new file with translations, then these texts will end up in Localang, automatically translated and updated to your codebase
import { i18n } from './index.i18n'; // auto-generated file
import { useName } from './useName';
import { useUnreadMessages } from './useUnreadMessages';
export default () => {
const name = useName();
const unreadMessages = useUnreadMessages();
return (
<div>
<p>
{i18n('Hi, {name}', { name })}
</p>
<p>
{i18n('You have {count} unread messages', {
count: unreadMessages,
})}
</p>
</div>
);
};