sTEFANs Subversion Web Contol (SWC)
Inc
[ class tree: Swc ] [ index: Swc ] [ all elements ]

Procedural File: translation.inc.php

Source Location: /swc/inc/translation.inc.php

Page Details

This file provides functions to translate several string or URLs.

This file provides functions to translate several string or URLs. The translations themself could be in according files to ease the access and provide a well done structure.

Since:  v1.0.0
Filesource:  Source Code for this file
Version:  v1.0.0
License:  GNU Lesser General Public License
Copyright:  Copyright ©2006 by sTEFANs
Author:  Stefan Schraml
Functions
GetBrowserLanguages  [line 85]

array &GetBrowserLanguages( )

Determines the languages accepted by the browser.

Determines the languages accepted by the browser.


API Tags:
Return:  Array of languages accepted by the browser order by relevance or an empty array if the browser does not determine accepted languages.

Information Tags:
Since:  v1.0.0

[ Top ]
GetLocalizedTimestamp  [line 46]

string GetLocalizedTimestamp( $timestamp, [boolean $short = false]  )

Formats a given timestamp into a localized format.

Formats a given timestamp into a localized format.

Parameters:
boolean   $short:  Whether or not (default) the timestamp should be returned in short or long format.
   $timestamp: 

API Tags:
Return:  Formatted timestamp string.

Information Tags:
Since:  v1.0.0

[ Top ]
LoadTranslationResource  [line 139]

string LoadTranslationResource( )

Loads the best fitting translation table resource.

Loads the best fitting translation table resource. The best fitting translation table is the table that

  1. meets the country and language code exactly
  2. meets the country code only
  3. is the default language
in this order.
Translation tables are looked up in folder STD_RESOURCE_PATH defined in inc/var.inc.php. The name of the file should be in format country-language.php or country, both in ISO 2 letter code as used by browsers.
US English for instance is coded en-us, default English is coded en. Translation tables for a language without a country code should be provided.
The filename is case insensitive. The file name of the default translation table is defined in inc/var.inc.php by STD_TRANSLATION_TABLE.


API Tags:
Return:  Code of the loaded language

Information Tags:
Since:  v1.0.0

[ Top ]
T  [line 63]

void T( )

Translates the given ID to the language set in the browser or to english as default language. Parameters:This function needs the ID for the string to translate as first argument. further arguments are passed to sprintf to format the string with values. If no parameter is applied, an error text (not translated) is returned.

Translates the given ID to the language set in the browser or to english as default language.

Parameters:This function needs the ID for the string to translate as first argument. Any further arguments are passed to sprintf to format the string with values.
If no parameter is applied, an error text (not translated) is returned.


Information Tags:
Since:  v1.0.0

[ Top ]


Documentation generated on Fri, 03 Nov 2006 18:45:05 +0100 by phpDocumentor 1.3.0RC6
for sTEFANs POWERED BY eBC.bz