--[=[
    Translates a line into pseudo text while maintaining params
    @param line string -- The line to translate
    @return string -- The translated line
]=]

function PseudoLocalize.pseudoLocalize(line)
	local charMap = PseudoLocalize.PSEUDO_CHARACTER_MAP
	local out = ""
	local isParam = false

	for start, stop in utf8.graphemes(line) do
		local char = line:sub(start, stop)
		if char == "{" or char == "[" or char == "<" then
			isParam = true
			out = out .. char
		elseif char == "}" or char == "]" or char == ">" then
			isParam = false
			out = out .. char
		elseif not isParam and charMap[char] then
			out = out .. charMap[char]
		else
			out = out .. char
		end
	end

	return out
end
