I would like to capture the lang variable and then translate the page based on this variable.
global $jwp_lang;
$url = $_SERVER["REQUEST_URI"];
echo $url;
for example if the url contains http://localhost/about/?lang=fr I would like to capture this value.
You can easily capture the value of lang variable using php Super Global variable $_GET :
It is better to pass the URL parameters using add_query_var, and get the parameter using get_query_var.
Because, they can handdle the set, and get of multiple parameters, and is the recommended way of getting URL passed as parameters.