| 
| static  | loadLang (string $path, string $languageCode) | 
|   | 
Definition at line 47 of file Language.php.
 
◆ __construct()
      
        
          | pocketmine\lang\Language::__construct  | 
          ( | 
          string |           $lang,  | 
        
        
           | 
           | 
          ?string |           $path = null,  | 
        
        
           | 
           | 
          string |           $fallback = self::FALLBACK_LANGUAGE ) | 
        
      
 
- Exceptions
 - 
  
    | LanguageNotFoundException |  | 
  
   
Definition at line 106 of file Language.php.
 
 
◆ get()
      
        
          | pocketmine\lang\Language::get  | 
          ( | 
          string |           $id | ) | 
           | 
        
      
 
 
◆ getAll()
      
        
          | pocketmine\lang\Language::getAll  | 
          ( | 
           | ) | 
           | 
        
      
 
- Returns
 - string[] @phpstan-return array<string, string> 
 
Definition at line 184 of file Language.php.
 
 
◆ getLang()
      
        
          | pocketmine\lang\Language::getLang  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ getLanguageList()
  
  
      
        
          | static pocketmine\lang\Language::getLanguageList  | 
          ( | 
          string |           $path = "" | ) | 
           | 
         
       
   | 
  
static   | 
  
 
- Returns
 - string[] @phpstan-return array<string, string>
 
- Exceptions
 - 
  
    | LanguageNotFoundException |  | 
  
   
Definition at line 57 of file Language.php.
 
 
◆ getName()
      
        
          | pocketmine\lang\Language::getName  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ internalGet()
  
  
      
        
          | pocketmine\lang\Language::internalGet  | 
          ( | 
          string |           $id | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
◆ loadLang()
  
  
      
        
          | static pocketmine\lang\Language::loadLang  | 
          ( | 
          string |           $path,  | 
         
        
           | 
           | 
          string |           $languageCode ) | 
         
       
   | 
  
staticprotected   | 
  
 
- Returns
 - string[] @phpstan-return array<string, string> 
 
Definition at line 129 of file Language.php.
 
 
◆ parseTranslation()
  
  
      
        
          | pocketmine\lang\Language::parseTranslation  | 
          ( | 
          string |           $text,  | 
         
        
           | 
           | 
          ?string |           $onlyPrefix = null ) | 
         
       
   | 
  
protected   | 
  
 
Replaces translation keys embedded inside a string with their raw values. Embedded translation keys must be prefixed by a "%" character.
This is used to allow the "text" field of a Translatable to contain formatting (e.g. colour codes) and multiple embedded translation keys.
Normal translations whose "text" is just a single translation key don't need to use this method, and can be processed via get() directly.
- Parameters
 - 
  
    | string | null | $onlyPrefix | If non-null, only translation keys with this prefix will be replaced. This is used to allow a client to do its own translating of vanilla strings.  | 
  
   
Definition at line 201 of file Language.php.
 
 
◆ translate()
◆ translateString()
      
        
          | pocketmine\lang\Language::translateString  | 
          ( | 
          string |           $str,  | 
        
        
           | 
           | 
          array |           $params = [],  | 
        
        
           | 
           | 
          ?string |           $onlyPrefix = null ) | 
        
      
 
- Parameters
 - 
  
    | (float|int|string|Translatable)[] | $params  | 
  
   
Definition at line 144 of file Language.php.
 
 
◆ $fallbackLang
  
  
      
        
          | array pocketmine\lang\Language::$fallbackLang = [] | 
         
       
   | 
  
protected   | 
  
 
 
◆ $lang
  
  
      
        
          | array pocketmine\lang\Language::$lang = [] | 
         
       
   | 
  
protected   | 
  
 
 
◆ $langName
  
  
      
        
          | string pocketmine\lang\Language::$langName | 
         
       
   | 
  
protected   | 
  
 
 
◆ FALLBACK_LANGUAGE
      
        
          | const pocketmine\lang\Language::FALLBACK_LANGUAGE = "eng" | 
        
      
 
 
The documentation for this class was generated from the following file: