Update utility function isMobile by localise the variables.