import { TolgeeKey } from '../../types';
import { normalize, writeMaleTranslation } from '../translation';

export const writeSpeech = (tolgeeKey: TolgeeKey): string => {
	let luaRecord = '';
	const en = tolgeeKey.translations.en.text.split(': ')[1].trim();
	luaRecord += `addon.data.speech["${normalize(tolgeeKey.keyDescription)}_${normalize(en)}"] = {\n`;
	luaRecord += writeMaleTranslation(tolgeeKey.translations);
	luaRecord += `}\n`;
	return luaRecord;
};