Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Lang

This class is used to manage translations

Namespace: Hawk
Package: Core
Located at Lang.php

Methods summary

public static
# keys( string $plugin, string $language = LANGUAGE, string $reload = false )

Get the translations of a language file

Get the translations of a language file

Parameters

$plugin
The plugin to load
$language
The language to get the translations in
$reload
If set to true, force to reload the translations
public static
# saveOriginCache( )

Save the cache file containing the origin paths

Save the cache file containing the origin paths

public static boolean
# exists( string $langKey )

Check if a language key exists

Check if a language key exists

Parameters

$langKey
The key to check existence

Returns

boolean
True if the language key exists, else false
public static string
# get( string $langKey, array $param = array(), mixed $number = 0, string $language = LANGUAGE )

Get the translation of a language key in the given language

Get the translation of a language key in the given language

Parameters

$langKey
The key to get the translation
$param
On associative array containing the variables value in the translation
$number
A number describing the singular or plural version of the translation
$language
The language to get the translation. By default the current language

Returns

string
The translation
public static
# addKeysToJavascript( string $keys )

Add language keys to Javascript. To add several keys, you can call one time this function, each parameters being a language key that wille be added to JavaScript

Add language keys to Javascript. To add several keys, you can call one time this function, each parameters being a language key that wille be added to JavaScript

Deprecated

since version 0.7.0, use Controller::addKeysToJavascript instead

Parameters

$keys
$keys The keys to add
public static
# getUserTranslations( string $plugin, string $language )

Get the translations data the user customized on the interface

Get the translations data the user customized on the interface

Parameters

$plugin
The plugin name
$language
The language tag
public static
# saveUserTranslations( string $plugin, string $language, array $data )

Save translated data the user customized on the interface

Save translated data the user customized on the interface

Parameters

$plugin
The plugin name
$language
The language tag
$data
The translations to save

Constants summary

string DEFAULT_LANGUAGE
# 'en'
string ORIGIN_CACHE_FILE
# 'lang-file-paths.php'
string CACHE_DIR
# 'lang/'
string TRANSLATIONS_DIR
# 'admin/translations/'
Hawk - PHP documentation API documentation generated by ApiGen