AUI
Documentation
Components
Upgrade guides
Support
Getting started
FAQ
Version 8.4
9.3.2
Latest
9.2.1
9.1.7
9.0.5
8.8.0
8.7.2
8.6.1
8.5.2
8.4.5
8.3.10
8.2.4
8.1.6
8.0.7
7.9.11
7.8.3
7.7.6
7.6.3
7.5.3
7.4.0
7.3.4
7.2.1
7.1.1
7.0.1
6.1.3
6.0.9
5.9.24
Older versions
Changelog
General UI components
Avatars
Badges
Banners
Buttons
Dropdowns
Dialog 2
Expanders
Flags
Inline dialogs
Icons
Labels
Lozenges
Messages
Progress indicators
Progress trackers
RESTful tables
Spinners
Sortable tables
Tables
Tabs
Toolbar 2
Tooltips
Triggers
Forms and form components
Forms
Form labels
Form notification
Form validation
Date pickers
Single selects
Select2
Toggle buttons
Page and content structure
Typography
Page layout
Page headers
Page panels
Content groups
Navigation patterns
In-product help patterns
Application header
Sidebar
System notification
AUI resources
Helper functions
Hidden and assistive CSS
Internationalisation
Keyboard shortcuts
Soy
Template
deprecated
Internationalisation
Ask a question
Function
Description
Available since
Example
format
Provides an easy way to substitute parameters into a string.
1.0.0
AJS.format("This is a {0} test of {1}", "simple", "message format") AJS.format("Have a {0} day", "good"); /* Have a good day */ AJS.format("Have a '{0}' day", "good"); /* Have a '{0}' day */ AJS.format("Have a ''{0}'' {1}", "good", "Monday"); /* Have a 'good' Monday */
I18n
I18n keys.
5.4.0
// Gets the i18n value AJS.I18n.getText('aui.toggle.on') // Returns the key AJS.I18n.getText('aui.key.that.does.not.exist') // Raw translation strings are stored in `AJS.I18n.keys`. // Translation text should always be retrieved through `AJS.I18n.getText`. AJS.I18n.keys['aui.test'] = 'Le test'; AJS.I18n.getText('aui.test'); // If there are keys that have {0} params in them, AJS formatting can apply // Note: don't modify existing entries in AJS.I18N.keys directly, this is // done for demonstration purposes AJS.I18n.keys['aui.test'] = 'this is a {0} test'; console.log( AJS.I18n.getText('aui.test', 'formatting') );