Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 595 Bytes

README.md

File metadata and controls

19 lines (17 loc) · 595 Bytes

Extraction

Sentences to translate are extracted using our AST Parser that parses JS/JSX files and match the following structures.

import i18n from 'libs/i18n'
const text = i18n.t('My string to translate') || t('My string to translate when using the HOC translate()')
const interpolation = t('{{ number }} is my number', { number: 42 })
const plural = t('one object', { plural: '{{ count }} objects', count })
const context = t('string with context', { context: 'ctx' })
const comp = (
	<Translate>
		<span>
			This <b>will be</b> <i>extracted</i>
		</span>
	</Translate>
)