<commit_before>var RecaptchaOptions = {
	tabindex: 9,
	theme:    'clean'
};

$(function()
{
	var locale_re = new RegExp('^(.*(?:\\?|&))__locale=([a-zA-Z0-9_.-]+)(.*)$'),
		csrf_token = $('meta[name=csrf-token]').attr('content');

	$.ajaxSetup({
		headers: { 'X-CSRFToken': csrf_token }
	});
	$('input,select,textarea').not('[type=submit]').jqBootstrapValidation({
		preventSubmit: true
	});
	$('.chosen-select').chosen();
	$('#__locale').change(function()
	{
		var lang = $(this).val(),
			sstr = window.location.search,
			m;

		if($('#user').val())
			return false;
		if(sstr)
		{
			if(m = locale_re.exec(sstr))
				window.location.search = m[1] + '__locale=' + lang + m[3];
			else
				window.location.search += '&__locale=' + lang;
		}
		else
			window.location.search = '?__locale=' + lang;
		return false;
	});
});
<commit_msg> * [access] Fixed small bug with locale selector.<commit_after>var RecaptchaOptions = {
	tabindex: 9,
	theme:    'clean'
};

$(function()
{
	var locale_re = new RegExp('^(.*(?:\\?|&))__locale=([a-zA-Z0-9_.-]+)(.*)$'),
		csrf_token = $('meta[name=csrf-token]').attr('content');

	$.ajaxSetup({
		headers: { 'X-CSRFToken': csrf_token }
	});
	$('input,select,textarea').not('[type=submit],#__locale').jqBootstrapValidation({
		preventSubmit: true
	});
	$('.chosen-select').chosen();
	$('#__locale').change(function()
	{
		var lang = $(this).val(),
			sstr = window.location.search,
			m;

		if($('#user').val())
			return false;
		if(sstr)
		{
			if(m = locale_re.exec(sstr))
				window.location.search = m[1] + '__locale=' + lang + m[3];
			else
				window.location.search += '&__locale=' + lang;
		}
		else
			window.location.search = '?__locale=' + lang;
		return false;
	});
});

{'fraction_non_alphanumeric': 0.23920653442240372, 'fraction_numerical': 0.005834305717619603, 'mean_word_length': 3.9566473988439306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '252475', 'n_tokens_mistral': 730, 'n_tokens_neox': 664, 'n_words': 105}