local names_ini = ini_file("misc\\smart_names.ltx")
smart_names_table = {}
function init_smart_names_table()
    for i=0,names_ini:line_count("levels")-1 do
        temp1, level_name, temp2 = names_ini:r_line("levels", i, "", "")
        if(names_ini:section_exist(level_name)) then
            smart_names_table[level_name] = {}
		    for i=0,names_ini:line_count(level_name)-1 do
	            result, smart_name, value = names_ini:r_line(level_name, i, "", "")
	            smart_names_table[level_name][smart_name] = value
			end
        end
    end
end

function get_smart_terrain_name(smart)
	local level_name = alife():level_name(game_graph():vertex(smart.m_game_vertex_id):level_id())
	local smart_name = smart:name()
	if(smart_names_table[level_name]~=nil) and (smart_names_table[level_name][smart_name]~=nil) then
		return game.translate_string(smart_names_table[level_name][smart_name])	
	end
	return smart_name
end