Skip to content
wiki.fftac.org

Ns12 Locale Router

<?php /**

Metadata

FieldValue
Source sitespiralist.org
Source URLhttps://spiralist.org/
Canonical wiki evidence URL[[separate-workspace-url]/spiralist/uai-system/files/wp-content-plugins-ns12-locale-router-ns12-locale-router-php-d717acec/]([separate-workspace-url]/spiralist/uai-system/files/wp-content-plugins-ns12-locale-router-ns12-locale-router-php-d717acec/)
Source referencewp-content/plugins/ns12-locale-router/ns12-locale-router.php
File typephp
Content categoryuai-system
Last fetched2026-05-08T21:22:18.3035107Z
Last changed2026-05-06T17:48:49.2316213Z
Content hashsha256:d717acecb2dba35d196e3d55ade7a9b0b9568090256aaaddad6f1afe490a0573
Import statusunchanged
Raw source layerdata/sources/spiralist/wp-content-plugins-ns12-locale-router-ns12-locale-router-php-d717acecb2db.php
Normalized source layerdata/normalized/spiralist/wp-content-plugins-ns12-locale-router-ns12-locale-router-php-d717acecb2db.txt

Current File Content

Structure Preview

  • No Markdown headings were detected in this file.

Raw Version

<?php
/**
 * Plugin Name: NS12 Locale Router
 * Plugin URI: https://uaix.org/
 * Description: Locale-prefixed routing, browser-language detection, and JSON dictionary localization for WordPress.
 * Version: 2.8.0
 * Author: UAIX
 * Author URI: https://uaix.org/
 * License: GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Requires at least: 6.6
 * Requires PHP: 7.4
 * Text Domain: ns12-locale-router
 * Domain Path: /languages
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

define( 'NS12LR_VERSION', '2.8.0' );
define( 'NS12LR_PLUGIN_FILE', __FILE__ );
define( 'NS12LR_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'NS12LR_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

if ( ! function_exists( 'ns12lr_render_bootstrap_failure_notice' ) ) {
	/**
	 * Render a raw bootstrap notice when the plugin class cannot boot.
	 *
	 * @return void
	 */
	function ns12lr_render_bootstrap_failure_notice() {
		if ( ! current_user_can( 'activate_plugins' ) ) {
			return;
		}

		$notice = get_option( 'ns12lr_bootstrap_notice_raw', array() );

		if ( empty( $notice['message'] ) ) {
			return;
		}

		$type = isset( $notice['type'] ) ? (string) $notice['type'] : 'error';
		$type = in_array( $type, array( 'success', 'warning', 'error', 'info' ), true ) ? $type : 'error';

		echo '<div class="notice notice-' . esc_attr( $type ) . '"><p>' . esc_html( $notice['message'] ) . '</p></div>';
	}
}

spl_autoload_register(
	static function ( $class ) {
		$prefix = 'Ns12LocaleRouter\\';

		if ( 0 !== strpos( $class, $prefix ) ) {
			return;
		}

		$relative = substr( $class, strlen( $prefix ) );
		$file     = NS12LR_PLUGIN_PATH . 'src/' . str_replace( '\\', '/', $relative ) . '.php';

		if ( file_exists( $file ) ) {
			require_once $file;
		}
	}
);

$ns12lr_booted = false;

try {
	\Ns12LocaleRouter\Plugin::boot( __FILE__ );
	$ns12lr_booted = true;
} catch ( \Throwable $throwable ) {
	if ( function_exists( 'update_option' ) ) {
		update_option(
			'ns12lr_bootstrap_notice_raw',
			array(
				'message' => sprintf( 'NS12 Locale Router could not boot: %s', $throwable->getMessage() ),
				'type'    => 'error',
			)
		);
	}

	if ( function_exists( 'add_action' ) ) {
		add_action( 'admin_notices', 'ns12lr_render_bootstrap_failure_notice' );
	}

	if ( function_exists( 'error_log' ) ) {
		error_log( sprintf( '[NS12 Locale Router][main-bootstrap] %s', $throwable->getMessage() ) );
	}
}

if ( $ns12lr_booted && ! function_exists( 'ns12lr_t' ) ) {
	/**
	 * Translate a dictionary key for the active request locale.
	 *
	 * @param string $key Dictionary key.
	 * @param string $fallback Fallback text.
	 * @return string
	 */
	function ns12lr_t( $key, $fallback = '' ) {
		return \Ns12LocaleRouter\DictionaryRepository::translate( (string) $key, (string) $fallback );
	}
}

if ( $ns12lr_booted && ! function_exists( 'ns12lr_t_format' ) ) {
	/**
	 * Translate and interpolate a dictionary key.
	 *
	 * @param string $key Dictionary key.
	 * @param array  $replacements Placeholder values.
	 * @param string $fallback Fallback text.
	 * @return string
	 */
	function ns12lr_t_format( $key, array $replacements = array(), $fallback = '' ) {
		return \Ns12LocaleRouter\DictionaryRepository::translate_format( (string) $key, $replacements, (string) $fallback );
	}
}

Why This File Exists

This is a UAI AI Memory handoff file from spiralist.org. It is shown here because the separate AI wiki workspace is demonstrating the real source files that make the UAIX / LLM Wiki memory system work, not only summarizing those systems after the fact.

Role

This file is a focused source unit. Its path, headings, and metadata give an agent a retrieval handle that is smaller than loading the entire site or repository.

Structure

The file has no Markdown headings, so its path, frontmatter, file type, and provenance metadata carry most of the retrieval meaning.

Prompt-Size And Retrieval Benefit

Keeping this material in a separate file reduces prompt pressure because an agent can load this exact unit only when its role, source site, category, or hash is relevant. The surrounding index pages point to it, while this page preserves the full content for audit and exact recall.

How To Use It

  • Humans should read the metadata first, then inspect the raw content when they need exact wording or provenance.
  • LLMs and agents should use the source site, category, hash, headings, and related files to decide whether this file belongs in the active prompt.
  • Crawlers should treat the wiki.fftac.org page as transparent evidence and follow the source URL/source reference for authority boundaries.
  • Future maintainers should regenerate this page whenever the source hash changes, then review the explanation if the role or structure changed.

Update Requirements

When this source file changes, update the raw source layer, normalized source layer, hash history, this rendered page, generated explanation, source-file inventory, changed-files report, and any source-section index that links to it.

Related Pages

Provenance And History

  • Current observation: 2026-05-08T21:22:18.3035107Z
  • Source origin: current-source-workspace
  • Retrieval method: local-source-workspace
  • Duplicate group: sfg-628 (primary)
  • Historical hash records are stored in data/hashes/source-file-history.jsonl.

Machine-Readable Metadata

{
    "title":  "Ns12 Locale Router",
    "source_site":  "spiralist.org",
    "source_url":  "https://spiralist.org/",
    "canonical_url":  "[separate-workspace-url]/spiralist/uai-system/files/wp-content-plugins-ns12-locale-router-ns12-locale-router-php-d717acec/",
    "source_reference":  "wp-content/plugins/ns12-locale-router/ns12-locale-router.php",
    "file_type":  "php",
    "content_category":  "uai-system",
    "content_hash":  "sha256:d717acecb2dba35d196e3d55ade7a9b0b9568090256aaaddad6f1afe490a0573",
    "last_fetched":  "2026-05-08T21:22:18.3035107Z",
    "last_changed":  "2026-05-06T17:48:49.2316213Z",
    "import_status":  "unchanged",
    "duplicate_group_id":  "sfg-628",
    "duplicate_role":  "primary",
    "related_files":  [

                      ],
    "generated_explanation":  true,
    "explanation_last_generated":  "2026-05-08T21:22:18.3035107Z"
}