<commit_before><?php

/**
 * This file contains the database work for languages.
 *
 * @package   ElkArte Forum
 * @copyright ElkArte Forum contributors
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause (see accompanying LICENSE.txt file)
 *
 * @version 2.0 dev
 *
 */

use ElkArte\Util;
use ElkArte\XmlArray;

/**
 * Removes the given language from all members..
 *
 * @param int $lang_id
 * @package Languages
 */
function removeLanguageFromMember($lang_id)
{
	$db = database();

	$db->query('', '
		UPDATE {db_prefix}members
		SET 
			lngfile = {string:empty_string}
		WHERE lngfile = {string:current_language}',
		array(
			'empty_string' => '',
			'current_language' => $lang_id,
		)
	);
}

/**
 * How many languages?
 *
 * - Callback for the list in action_edit().
 *
 * @package Languages
 */
function list_getNumLanguages()
{
	return count(getLanguages());
}

/**
 * Fetch the actual language information.
 *
 * What it does:
 *
 * - Callback for $listOptions['get_items']['function'] in action_edit.
 * - Determines which languages are available by looking for the "index.{language}.php" file.
 * - Also figures out how many users are using a particular language.
 *
 * @package Languages<commit_msg>Another unused function removeLanguageFromMember<commit_after><?php

/**
 * This file contains the database work for languages.
 *
 * @package   ElkArte Forum
 * @copyright ElkArte Forum contributors
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause (see accompanying LICENSE.txt file)
 *
 * @version 2.0 dev
 *
 */

use ElkArte\Util;
use ElkArte\XmlArray;

/**
 * How many languages?
 *
 * - Callback for the list in action_edit().
 *
 * @package Languages
 */
function list_getNumLanguages()
{
	return count(getLanguages());
}

/**
 * Fetch the actual language information.
 *
 * What it does:
 *
 * - Callback for $listOptions['get_items']['function'] in action_edit.
 * - Determines which languages are available by looking for the "index.{language}.php" file.
 * - Also figures out how many users are using a particular language.
 *
 * @package Languages
{'fraction_non_alphanumeric': 0.12476099426386233, 'fraction_numerical': 0.0028680688336520078, 'mean_word_length': 3.811494252873563, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '1660764', 'n_tokens_mistral': 667, 'n_tokens_neox': 650, 'n_words': 195}