eZ.CAPI Class
eZ JavaScript REST Client. See https://github.com/ezsystems/ez-js-rest-client
Constructor
eZ.CAPI
()
Item Index
Methods
Attributes
Methods
_findPosixLocaleByPrefix
-
prefix
-
localesMap
-
e.g.
Returns the POSIX Locale matching the prefix
Parameters:
-
prefix
Stringe.g. 'fr'
-
localesMap
Objectthe locales map for the property
-
e.g.
String'fr_fr'
_getExistingPropertyLanguages
-
property
-
e.g.
Returns an array containing the existing Locale in which the property exists.
Parameters:
-
property
Object -
e.g.
Array['fre-FR', 'eng-GB']
_getLocalesMap
-
fullLocalesMap
-
property
Creates a locales map for the languages in which the property exists.
Parameters:
-
fullLocalesMap
Object -
property
Object
Returns:
an Object containing the locale indexed by normalized POSIX locales
translateProperty
-
fullLocalesMap
-
property
Find the correct property translation according to browser's languages configuration. It basically iterates over the browser's languages to find a matching translation, if none matches, it takes the first one.
Parameters:
-
fullLocalesMap
Objectthe Locales map between POSIX Locales (e.g.) fr_FR and Locales used in eZ Platform (e.g. fre-FR)
-
property
Objectthe property to translate as a hash indexed by eZ Locale for example:
{'eng-GB': 'potatoes', 'fre-FR': 'pomme de terre'}