export default class LocalisationActions {

    static getTranslation(stringId, language, tr_json) {
        let tr = tr_json[stringId];
        if (tr) {
            switch (language.toLowerCase()) {
                case 'en':
                    return tr.en;
                case 'fr':
                    return tr.fr;
                case 'de':
                    return tr.de;
                case 'it':
                    return tr.it;
                case 'nl':
                    return tr.nl;
                default:
                    throw new Error('No translation found for string: ' + stringId + ' in language: ' + language);
            }
        } else {
            throw new Error('No translation found for string: ' + stringId);
        }
    }
}