메소드 | 설명 | |
---|---|---|
__construct ( SimpleSAML_Configuration $configuration, string | null $defaultDictionary = null ) | Constructor | |
getAttributeTranslation ( string $name ) : string | Translate the name of an attribute. | |
getLanguage ( ) : |
Return the internal language object used by this translator. | |
getPreferredTranslation ( array $translations ) : string | Retrieve the preferred translation of a given text. | |
getTag ( string $tag ) : array | This method retrieves a tag as an array with language => string mappings. | |
includeInlineTranslation ( string $tag, array | string $translation ) | Include a translation inline instead of putting translations in dictionaries. This function is recommended to be used ONLU from variable data, or when the translation is already provided by an external source, as a database or in metadata. | |
includeLanguageFile ( string $file, SimpleSAML_Configuration | null $otherConfig = null ) | Include a language file from the dictionaries directory. | |
noop ( string $tag ) : string | Mark a string for translation without translating it. | |
t ( string | array $tag, array $replacements = [], boolean $fallbackdefault = true, $oldreplacements = [], $striptags = false ) : string | Translate a tag into the current language, with a fallback to english. | |
translatePluralGettext ( $original, $plural, $value ) | ||
translateSingularGettext ( $original ) |
메소드 | 설명 | |
---|---|---|
getDictionary ( string $name ) : array | This method retrieves a dictionary with the name given. | |
getStringNotTranslated ( string $tag, boolean $fallbacktag ) : string | Return the string that should be used when no translation was found. | |
readDictionaryFile ( string $filename ) : array | Read a dictionary file. | |
readDictionaryJSON ( string $filename ) : array | Read a dictionary file in JSON format. | |
readDictionaryPHP ( string $filename ) : array | Read a dictionary file in PHP format. |
public __construct ( SimpleSAML_Configuration $configuration, string | null $defaultDictionary = null ) | ||
$configuration | SimpleSAML_Configuration | Configuration object |
$defaultDictionary | string | null | The default dictionary where tags will come from. |
public getAttributeTranslation ( string $name ) : string | ||
$name | string | The attribute name. |
리턴 | string | The translated attribute name, or the original attribute name if no translation was found. |
public getLanguage ( ) : |
||
리턴 |
public getPreferredTranslation ( array $translations ) : string | ||
$translations | array | The translations, as an associative array with language => text mappings. |
리턴 | string | The preferred translation. |
public includeLanguageFile ( string $file, SimpleSAML_Configuration | null $otherConfig = null ) | ||
$file | string | File name of dictionary to include |
$otherConfig | SimpleSAML_Configuration | null | Optionally provide a different configuration object than the one provided in the constructor to be used to find the directory of the dictionary. This allows to combine dictionaries inside the SimpleSAMLphp main code distribution together with external dictionaries. Defaults to null. |
public t ( string | array $tag, array $replacements = [], boolean $fallbackdefault = true, $oldreplacements = [], $striptags = false ) : string | ||
$tag | string | array | A tag name for the translation which should be looked up, or an array with (language => text) mappings. The array version will go away in 2.0 |
$replacements | array | An associative array of keys that should be replaced with values in the translated string. |
$fallbackdefault | boolean | Default translation to use as a fallback if no valid translation was found. |
리턴 | string | The translated tag, or a placeholder value if the tag wasn't found. |
public static translatePluralGettext ( $original, $plural, $value ) |