SproutCMS

This is the code documentation for the SproutCMS project

class LocaleInfo

Class to handle locale-dependent data such as addresses and currency

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2026-09-16
**/
class NewClassName extends LocaleInfo {
    
    /**
    * Validate address fields
    **/
    public function validateAddress (Validator $valid, bool $required) {
        // Method code goes here
    }
    
    /**
    * Formats numbers, like the interal {@see number_format} function
    **/
    public function numberFormat (int|float $number, int $precision) {
        // Method code goes here
    }
    
    /**
    * Formats currency values, similar to the interal {@see number_format} function
    **/
    public function moneyFormat (int|float $number, int $precision) {
        // Method code goes here
    }
    
    /**
    * Formats dates in a long format
    **/
    public function longdate (int $timestamp) {
        // Method code goes here
    }
    
    /**
    * Formats dates in a short format
    **/
    public function shortdate (int $timestamp) {
        // Method code goes here
    }
    
    /**
    * Formats times
    **/
    public function time (int $timestamp) {
        // Method code goes here
    }
    
    /**
    * Gets a list of states
    **/
    public function getStateList () {
        // Method code goes here
    }
    
    /**
    * The name of the currency, e.g. 'Dollar' for $
    **/
    public function getCurrencyName () {
        // Method code goes here
    }
    
    /**
    * Generates a single address field for the current locale
    **/
    public function outputAddressField (string $field, string $prefix, bool $required) {
        // Method code goes here
    }
    
    /**
    * Returns a string which is a formatted version of the address specified using the provided data.
    * The string contains newlines which will need converting to BRs for HTML output
    **/
    public function outputAddressText (array|object $data) {
        // Method code goes here
    }
    
    /**
    * Get the name of a given state by looking it up in the states list
    **/
    public function getStateName (string $val) {
        // Method code goes here
    }
    
    /**
    * Generates the address fields for the current locale
    **/
    public function outputAddressFields (string $prefix, bool $required) {
        // Method code goes here
    }
    
    /**
    * Extracts only the enterable values from the state list
    * 
    * This should be used for validation.
    **/
    public function stateValues () {
        // Method code goes here
    }
    
    /**
    * Automatically chooses a locale and returns it
    **/
    public function auto () {
        // Method code goes here
    }
    
    /**
    * Returns the LocaleInfo class for the specified country code.
    * If no LocaleInfo can be found, a generic version is used.
    **/
    public function get (string $code) {
        // Method code goes here
    }
    
    /**
    * Organises the state list so that it doesn't have numeric keys.
    * 
    * The state names become the form field values if state list is a numeric array.
    * This makes it easy to configure a new locate with states/provinces/etc which don't have standard abbreviations.
    * 
    * E.g. ['State 1', 'State 2'] would become: ['State 1' =&gt; 'State 1', 'State 2' =&gt; 'State 2']
    **/
    public function nonNumericStates () {
        // Method code goes here
    }
    
    /**
    * Return the raw parameters of this locale
    **/
    public function getParameters () {
        // Method code goes here
    }
    
}
?>