How to use preact-i18n - 5 common examples

To help you get started, we’ve selected a few preact-i18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github synacor / preact-i18n / test / index.js View on Github external
it('should work as a function when given two arguments', () => {
		let TestClass = () =&gt; <div>;
		let IntlTestClass = intl(TestClass, options);
		expect().to.equal(
			
				
			
		);
	});
</div>
github synacor / preact-i18n / test / index.js View on Github external
it('should be a function', () => {
			let Wrapped = intl(options)(sinon.spy());
			expect(Wrapped.getWrappedComponent).to.be.a('function');
		});
github synacor / preact-i18n / test / index.js View on Github external
it('should accept a CSV of keys', () =&gt; {
			const Child = sinon.stub().returns(<div>);
			const Wrapped = withText('foo,bar,baz')(Child);

			rndr(
				
					
				
			);

			expect(Child).to.have.been.calledOnce.and.calledWithMatch({ foo: '1', bar: '2', baz: '3' });
		});
</div>
github datenanfragen / website / src / Utility / i18n.js View on Github external
export function t_r(id, language = '', fields = {}, plural = null, fallback = '') {
    return translate(id, language, I18N_DEFINITION_REQUESTS, fields, plural, fallback);
}
github datenanfragen / website / src / Utility / i18n.js View on Github external
export default function t(id, scope = '', fields = {}, plural = null, fallback = '') {
    return translate(id, scope, I18N_DEFINITION, fields, plural, fallback);
}

preact-i18n

Preact internationalization, done simply.

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis