0.1.0 • Published 5 years ago
i18next-markdown-postprocessor v0.1.0
i18next-markdown-postprocessor
Write markdown in your i18next translation strings
Usage
import i18next from "i18next";
import MarkdownPostprocessor from "i18next-markdown-postprocessor";
i18next.use(MarkdownPostprocessor).init();per key set the postProcess option to 'markdownPostprocessor'
import i18next from 'i18next';
import React from 'react';
function MyComponent(props) {
return (
<div>
{i18next.t(`myKey`, {
postProcess: `markdownPostprocessor`
})}
</div>
);
}if you want to use it across all your translated strings add it to i18next's init options instead:
i18next
.use(MarkdownPostprocessor)
.init({
postProcess: [ `markdownPostprocessor` ]
});
// now you don't need to specify "postProcess: 'markdownPostprocessor'" when calling i18next.tLicense
ISC
0.1.0
5 years ago