consolidating the single post language switcher into the function