import { TolgeeKey } from '../../types'; import { writeAlsoFemaleTranslation } from '../translation'; export const writeBook = (tolgeeKey: TolgeeKey): string => { let luaRecord = ''; const isName = tolgeeKey.keyName.endsWith('_name'); const key = isName ? '_name' : '_page_' + tolgeeKey.keyName.split('_')[2]; luaRecord += `addon.data.book["${tolgeeKey.keyDescription}${key}"] = {\n`; luaRecord += writeAlsoFemaleTranslation(tolgeeKey.translations); luaRecord += `}\n`; return luaRecord; };