localization middleware concept implementation