new Goog(options)
Class for language translation using the Google Translate Gadget
Parameters:
| Name | Type | Description |
|---|---|---|
options |
module:nyc/lang/Translate~Translate.Options | Constructor options |
- Source:
Fires:
Extends
Methods
-
append(elements)
-
A method to append elements to the container
Parameters:
Name Type Description elementsjQuery | Element | Array.<Element> | string The element to append
- Inherited From:
- Overrides:
- Source:
Returns:
The container
- Type
- jQuery
-
find(selector)
-
A method to return elements in the container
Parameters:
Name Type Description selectorstring jQuery selector
- Inherited From:
- Overrides:
- Source:
Returns:
The element
- Type
- jQuery
-
getContainer()
-
A method to return a control container HTML element wrapped in a JQuery
- Inherited From:
- Overrides:
- Source:
Returns:
The the control container HTML element wrapped in a JQuery
- Type
- jQuery
-
init()
-
Callback to set up Google Translate
- Source:
-
lang()
-
Get the currently chosen language code
- Inherited From:
- Overrides:
- Source:
Returns:
The currently chosen language code
- Type
- string
-
<protected> langFromCookie()
-
Gets a cookie value
- Overrides:
- Source:
Returns:
cookie
- Type
- string
-
off(eventName, evtHdlr [, hdlrScope])
-
Remove a previously connected event handler
Parameters:
Name Type Argument Description eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
on(eventName, evtHdlr [, hdlrScope])
-
Connect a function to an event
Parameters:
Name Type Argument Description eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
one(eventName, evtHdlr [, hdlrScope])
-
Connect a function to an event for a single invocation
Parameters:
Name Type Argument Description eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
prepend(elements)
-
A method to prepend elements to the container
Parameters:
Name Type Description elementsjQuery | Element | Array.<Element> | string The element to append
- Inherited From:
- Overrides:
- Source:
Returns:
The container
- Type
- jQuery
-
showButton(target)
-
Show as button
Parameters:
Name Type Description targetJQuery | Element | string Target node
- Inherited From:
- Overrides:
- Source:
-
showMenu(target)
-
Show as menu
Parameters:
Name Type Description targetJQuery | Element | string Target node
- Inherited From:
- Overrides:
- Source:
-
translate(event)
-
Sets the chosen language and initiates Google Translation
Parameters:
Name Type Description eventjQuery.Event Event object
- Inherited From:
- Overrides:
- Source:
-
trigger(eventName [, data])
-
Trigger a named event with event data
Parameters:
Name Type Argument Description eventNamestring The name of the event to trigger
dataObject <optional>
The event data
- Inherited From:
- Overrides:
- Source:
Events
-
change
-
The language value has changed
Type: string
- Inherited From:
- Overrides:
- Source:
-
ready
-
The class has completed initialization
Type: boolean
- Inherited From:
- Overrides:
- Source: