PHP Classes

File: docs/md/I18Next-Translator.md

Recommend this page to a friend!
  Classes of Francesco Danti   ATK4 i18next PHP   docs/md/I18Next-Translator.md   Download  
File: docs/md/I18Next-Translator.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: ATK4 i18next PHP
Translate application texts like il8next-PHP
Author: By
Last change:
Date: 5 years ago
Size: 2,745 bytes
 

Contents

Class file image Download

I18Next\Translator

Properties

$locales

private \I18Next\Locale[] $locales = []

  • Visibility: private

$language

private string $language

  • Visibility: private

$fallback

private string $fallback

  • Visibility: private

$translations_path

private string $translations_path

  • Visibility: private

$loader_format

private string $loader_format = json

  • Visibility: private

$namespace_priority

private string[] $namespace_priority = []

  • Visibility: private

$use_filename_as_namespace

private bool $use_filename_as_namespace = false

  • Visibility: private

Methods

setTranslationsPath

mixed I18Next\Translator::setTranslationsPath(string path)

Set the root path of locales folder.

  • Visibility: public

Arguments

  • path string

setNamespacePriority

mixed I18Next\Translator::setNamespacePriority(mixed namespace_priority)

Set namespace priority.

  • Visibility: public

Arguments

  • namespace_priority mixed

useFilenameAsNamespace

mixed I18Next\Translator::useFilenameAsNamespace(bool|null enabled)

Set if filenames will be used as namespaces.

  • Visibility: public

Arguments

  • enabled bool|null

setLanguagePrimary

mixed I18Next\Translator::setLanguagePrimary(string language_code)

Set Primary Language.

  • Visibility: public

Arguments

  • language_code string

addLanguage

mixed I18Next\Translator::addLanguage(string code)

Add Extra languages.

  • Visibility: public

Arguments

  • code string

setLanguageFallback

mixed I18Next\Translator::setLanguageFallback(string fallback_code)

Set fallback language.

  • Visibility: public

Arguments

  • fallback_code string

_

string I18Next\TranslatorInterface::_(string key, array|null parameters, string|null context, string|null locale)

Translates the given message.

Arguments

  • key string
  • parameters array|null - <p>Array of parameters used to translate message</p>
  • context string|null - <p>The context of the request</p>
  • locale string|null - <p>The locale or null to use the default</p>

getLocale

mixed I18Next\Translator::getLocale(string locale)

  • Visibility: private

Arguments

  • locale string