function replaceSpaces(text, mode){
    if (mode == 'en') {
        text = text.replace(" ", "_SP_");
        text = text.replace("\n", "_BR_");
    }
    else // mode == de
    {
        text = text.replace(/_SP_/g, " ");
        text = text.replace(/_BR_/g, "\n");
    }
    return text;
}
