src/js/fake-translator.js
function t( key, options ) {
    let str = '';
    let target = SOURCE_STRINGS;

    // crude string getter
    key.split( '.' ).forEach( part => {
        target = target ? target[ part ] : '';
        str = target;
    } );
    // crude interpolator
    options = options || {};
    str = str.replace( /__([^_]+)__/, ( match, p1 ) => options[ p1 ] );

    // Enable line below to switch to fake Arabic, very useful for testing RTL
    // var AR = 'العربية '; return str.split( '' ).map( function( char, i ) { return AR[ i % AR.length ];} ).join( '' );
    return str;
}
function t( key, options ) {
    let str = '';
    let target = SOURCE_STRINGS;

    // crude string getter
    key.split( '.' ).forEach( part => {
        target = target ? target[ part ] : '';
        str = target;
    } );
    // crude interpolator
    options = options || {};
    str = str.replace( /__([^_]+)__/, ( match, p1 ) => options[ p1 ] );

    // Enable line below to switch to fake Arabic, very useful for testing RTL
    // var AR = 'العربية '; return str.split( '' ).map( function( char, i ) { return AR[ i % AR.length ];} ).join( '' );
    return str;
}
function t ( key , options ) { let str = '' ; let target = SOURCE_STRINGS ; // crude string getter key . split ( '.' ) . forEach ( part => { target = target ? target [ part ] : '' ; str = target ; } ) ; // crude interpolator options = options || { } ; str = str . replace ( / __([^_]+)__ / , ( match , p1 ) => options [ p1 ] ) ; // Enable line below to switch to fake Arabic, very useful for testing RTL // var AR = 'العربية '; return str.split( '' ).map( function( char, i ) { return AR[ i % AR.length ];} ).join( '' ); return str ; }
Add keys from XSL stylesheets manually so i18next-parser will detect them.

t('constraint.invalid');
t('constraint.required');
 
Meant to be replaced by a real translator in the app that consumes enketo-core

@param  {String} key translation key
@param  {*} key translation options
@return {String} translation output
Add keys from XSL stylesheets manually so i18next - parser will detect them .