The localization dependency is a main entry point to provide human-readable strings to the DXcharts React app.
Localization Configuration
The Localization interface structure:
Localization
Cross-tool (crosshair) labels for OHLC (Open, High, Low, Close) values and volume.
CrossToolDictionary
All localization strings for the drawings feature including sidebar, dropdown menus,
context menus, and individual drawing tool names.
DrawingsDictionary
magnifying_tool_rectangle
any
magnifying_tool_time_range
any
magnifying_tool_time_range_wheel
any
{ hideBtn: string; clearBtn: string; showBtn: string; }
{ dayAbb: { monday: string; tuesday: string; wednesday: string; thursday: string; friday: string; saturday: string; sunday: string; }; months: { january: string; february: string; march: string; april: string; ... 7 more ...; december: string; }; }
{ titles: { title: string; sides: string; basicAndStudies: string; common: string; }; }
{ title: string; confirmationMessage: string; cancel: string; confirm: string; }
{ title: DrawingNames; sections: { default: string; coordinates: { title: string; priceLabel: string; timeLabel: string; dateLabel: string; timeCheckbox: string; priceCheckbox: string; }; ... 9 more ...; showArrow: { ...; }; }; actions: { ...; }; }
{ deviation: { title: string; up: string; down: string; useUpperDeviation: string; useLowerDeviation: string; source: string; }; sections: { base: string; up: string; down: string; }; style: { extendLines: string; pearsonR: string; }; deviationSources: { ...; }; }
{ counterclockwiseCheckbox: string; spiralLength: string; }
{ bars: { title: string; rows: string; valueArea: string; }; poc: string; volumes: { up: string; down: string; }; }
{ lock: string; unlock: string; hide: string; show: string; }
{ long: string; short: string; sidebarButton: string; createOrderBtn: string; inputs: { accountSize: string; lotSize: string; risk: string; riskModeAmount: string; riskModePercentage: string; takeProfitPrice: string; ... 4 more ...; fixedRatioHelp: { ...; }; }; validation: { ...; }; style: { ...; }; labelsSection: {...
Legend labels for OHLC values, volume, comparison mode, and chart type selector.
LegendDictionary
{ open: string; high: string; low: string; close: string; }
{ area: string; line: string; }
Timezone selector strings including UTC, exchange timezone, and accessibility labels.
TimeZoneDictionary
All study/indicator related strings including names, parameters, settings,
and right-click menu options for all available studies.
StudiesDictionary
acceleration_deceleration
any
accumulation_distribution
any
center_of_gravity_oscillator
any
chande_momentum_oscillator
any
linear_regression_channel
any
market_facilitation_index
any
percentage_price_oscillator
any
relative_volatility_index
any
standard_deviation_channel
any
vertical_horizontal_filter
any
volume_weighted_average_price
any
Aggregation period selector strings including period names, custom period input,
and validation messages.
AggregationPeriodDictionary
string | { long: string; short: string; }
string | { long: string; short: string; }
string | { long: string; short: string; }
string | { long: string; short: string; }
string | { long: string; short: string; }
string | { long: string; short: string; }
string | { long: string; short: string; }
string | { long: string; short: string; }
string | { long: string; short: string; }
string | { long: string; short: string; }
To add new type, please provide object with key as type and value as array of valid strings for this type.
Example:
{
types: {
y: ['y', 'Y', 'year'] // would parse strings like '1 year' or '1Y' or 'year' into 'y' type
}
}
AggregationPeriodDurationTypeMap
(count: number) => string
a11y_customInputConfirmButton
string
a11y_aggregationPeriodDescription
string
a11y_deleteAggregationPeriod
string
validation_nonexistentCustomPeriod
string
Y-axis configuration strings including scale type labels (regular, percent, logarithmic),
axis alignment options, and fit settings.
YAxisDictionary
Economic events labels for earnings, dividends, stock splits, conference calls, and news.
EventsDictionary
{ type: string; basicEps: string; dilutedEps: string; periodEnding: string; date: string; }
{ type: string; gross: string; date: string; }
{ type: string; date: string; }
{ type: string; title: string; date: string; }
Code editor UI strings for creating custom studies including button labels,
status messages, and error messages.
CodeEditorDictionary
Studies configuration popup strings including available studies list, filters,
study settings, inputs, plots, and style options.
StudiesPopupDictionary
{ difference: string; points: string; trendPoints: string; linear: string; emaCloudLine: string; pivotPoints: string; histogram: string; aboveCandleText: string; belowCandleText: string; aboveCandleTriangle: string; ... 4 more ...; universalMarker: string; }
studyParamAggregationType
{ default: string; day: string; week: string; month: string; }
{ simple: string; wilders: string; weighted: string; exponential: string; }
{ annual: string; monthly: string; weekly: string; daily: string; }
{ open: string; high: string; low: string; close: string; median: string; typical: string; ohlcAvg: string; volume: string; impVolatility: string; vwap: string; openInterest: string; }
{ pinToScale: string; pinnedToScale: string; pinnedToRightScale: string; pinnedToLeftScale: string; scaleOnRight: string; scaleOnLeft: string; }
{ dropdownLabel: string; NO: string; DOT: string; DASH: string; EXTENDED_DASH: string; HORIZONTAL: string; SQUARE: string; TRIANGLE_UP: string; TRIANGLE_DOWN: string; DIAMOND: string; CROSS: string; ... 4 more ...; HISTOGRAM: string; }
{ dropdownLabel: string; NO: string; SOLID: string; DOTTED: string; SHORTDASHED: string; DOTDASHED: string; LONGDASHED: string; PIECEWISE: string; }
overlayingCheckboxDisabled
string
a11y_labelForEditAndDelScript
string
a11y_availableStudiesList
string
a11y_dragHandleInstructions
string
Trading-related strings for order entry, order types, protection orders (TP/SL),
and executed orders display.
TradingDictionary
{ buyMarketBtn: string; sellMarketBtn: string; buyStopBtn: string; sellStopBtn: string; buyLimitBtn: string; sellLimitBtn: string; buyBtn: string; sellBtn: string; }
{ bubbles: string; labels: string; buttons: { a11y_orderMode: string; }; }
{ regular: { stop: string; limit: string; market: string; }; protection: { stopLoss: string; takeProfit: string; }; }
{ addButtons: { stopLoss: string; takeProfit: string; }; }
Chart snapshot feature strings for downloading, copying, and sharing chart images
via social media platforms.
ChartSnapshotDictionary
Notification messages displayed to users for various actions like copying images,
magnet mode toggle, drawing mode changes, etc.
ChartNotificationsDictionary
notificationSidebarMagnetOn
string
notificationSidebarMagnetOff
string
notificationSidebarDrawingOn
string
notificationSidebarDrawingOff
string
notificationSidebarDelete
string
notificationDataTypeChanged
string
notificationInstrumentNoData
string
notificationDrawingCopied
string
notificationDrawingPasted
string
notificationSyncedDrawingsSameChartOnly
string
Chart layout management strings for creating, editing, and deleting custom layouts,
including validation messages.
LayoutDictionary
a11y_layoutTemplateDescription
string
a11y_deleteLayoutTemplate
string
a11y_customInputConfirmButton
string
validation_nameAlreadyExists
string
validation_cannotFindLayoutToUpdate
string
Sidebar strings including header text, accessibility labels, and button tooltips
for magnet mode, drawing mode, and drawing visibility controls.
SidebarDictionary
a11y_sidebarButtonDescription
string
{ magnetMode: string; drawingMode: string; hideDrawings: string; syncDrawings: string; showDrawings: string; deleteDrawings: string; }
Indicator template management strings for saving, editing, and deleting custom
indicator configurations.
IndicatorTemplatesDictionary
a11y_indicatorTemplateDescription
string
a11y_deleteIndicatorTemplate
string
a11y_editIndicatorTemplate
string
a11y_customInputConfirmButton
string
validation_nameAlreadyExists
string
validation_cannotFindTemplateToUpdate
string
Theme selector strings including theme names (dark, light, cloudDancer, oud, still, solar).
ThemesDictionary
{ dark: string; light: string; cloudDancer: string; oud: string; still: string; solar: string; }
Top toolbar strings including button tooltips, dropdown labels, accessibility labels,
and market state indicators.
ToolbarDictionary
{ a11y_period_dropdown: string; a11y_chart_type_dropdown: string; a11y_drawings_dropdown: string; a11y_studies_popup_button: string; a11y_compare_charts_popover: string; a11y_magnifying_tool_zoom_out_button: string; ... 12 more ...; a11y_market_state: string; }
{ a11y_synchronize_instrument: string; a11y_synchronize_chart_type: string; a11y_synchronize_timeframe: string; a11y_synchronize_appearance: string; a11y_synchronize_studies: string; a11y_synchronize_crosshair: string; a11y_synchronize_drawings: string; }
{ a11y_plot_selectbox_description: string; }
{ suggestHint: string; state: { pending: string; failure: string; }; placeholder: string; }
{ baseline: string; area: string; line: string; bar: string; hollowCandles: string; candle: string; heikinAshi: string; histogram: string; scatter: string; trend: string; equivolume: string; }
{ layout: string; synchronize: string; sync_instrument: string; sync_chart_type: string; sync_timeframe: string; sync_appearance: string; sync_studies: string; sync_crosshair: string; sync_drawings: string; sync_drawings_tooltip: string; }
{ placeholder: string; state: { noData: string; pending: string; }; }
{ period: string; chart_type: string; studies_popup_button: string; compare_charts_popover: string; multichart_popover: string; chart_settings_button: string; export_button: string; layout: string; ... 5 more ...; drawings: string; }
{ timeLeft: { title: string; seconds: string; minutes: string; hours: string; days: string; }; tradingHours: { title: string; startDay: string; endDay: string; }; }
Settings popup strings for all configuration tabs including general settings,
appearance, scale, data, events, and trading options.
SettingsPopupDictionary
{ label: string; mark: string; bid: string; ask: string; last: string; }
{ general: { title: string; highLow: string; verticalGrid: string; horizontalGrid: string; grid: { horizontal: string; vertical: string; }; candleWick: string; watermark: string; sessionBreaks: string; ... 7 more ...; snapCrosshairTo: { ...; }; }; ... 6 more ...; paddings: { ...; }; }
{ title: string; generalSettings: { title: string; showCrosshair: string; showGrid: string; showHighLow: string; showWatermark: string; sessionBreaks: string; candleWick: string; candleBorder: string; ... 7 more ...; snapCrosshairTo: { ...; }; }; colorSettings: { ...; }; }
{ title: string; enablePaddings: string; top: string; bottom: string; right: string; bars: string; }
Common component strings used across multiple features including popup close buttons,
color picker, line style picker, and numeric stepper.
ComponentsDictionary
{ a11y_chart_area: string; }
{ a11y_component_description: string; }
{ errorTooltipRange: string; errorTooltipGreaterThan: string; errorTooltipLessThan: string; errorTooltipValidNumber: string; }
{ titles: { period: string; timeframe: string; }; saveBtn: string; }
{ logarithmic: string; percent: string; }
{ leftOrder: string[]; rightOrder: string[]; }
{ displayTypes: { ETF: string; INDEX: string; STOCK: string; FUTURE: string; FOREX: string; CRYPTO: string; PRODUCT: string; }; }
Chart layers management strings for locking, unlocking, hiding, and organizing
drawing layers and groups.
ChartLayersDictionary
Drawing groups management strings for creating, editing, and deleting custom
drawing groups with group selector labels.
DrawingGroupsDictionary
Timeframe presets strings for quick time range selection (1D, 1W, 1M, 1Y, etc.)
and custom timeframe input.
TimeframePresetsDictionary
a11y_toggle_custom_preset
string
{ H: string; D: string; W: string; M: string; Y: string; ALL: string; YTD: string; }
System messages displayed when no data is available, instrument is not available,
or no instrument is selected.
SystemMessagesDictionary
Dynamic objects (drawings and studies) layer management strings for bringing forward,
sending backward, and moving between layers.
DynamicObjectsDictionary
Navigation map component strings including accessibility labels for left/right
navigation arrows and slider controls.
NavigationMapDictionary
Number and date formatting strings for displaying values in different formats
and locales.
FormatterDictionary
Return to now button strings for navigating back to the most recent time.
ReturnToNowDictionary
Custom localization
We highly recommend using TypeScript, because IDE will help with suggestions and it will be a lot easier to escape missing locale strings.
To provide your own localization object you should do the following:
Default localization strings
Import DEFAULT_LOCALIZATION from @dx-private/dxchart5-react/dist/config/localization/localization and spread it as the base object. Override only the sections you need to translate — this gives you the full default English string tree without copying it by hand.
import { DEFAULT_LOCALIZATION } from '@dx-private/dxchart5-react/dist/config/localization/localization';
const userLocalization = {
...DEFAULT_LOCALIZATION,
drawings: {
...DEFAULT_LOCALIZATION.drawings,
header: 'Desenhos',
},
};
Pass the result via dependencies.localization on ChartReactApp, or the localization option on createWidget.
Renaming built-in indicators
Built-in study display names come from localization.studies (import studiesDictionary from @dx-private/dxchart5-react/dist/config/localization/studies as the default). Override the title (and optionally shortTitle) for the study keys you want to rename, then pass that dictionary in two places:
dependencies.localization — so the studies menu, properties dialog, and legend use your labels.
DEFAULT_STUDIES_LIST(yourStudiesDictionary) when creating dxStudiesProvider — so the built-in study list registered at startup uses the same names.
import { studiesDictionary } from '@dx-private/dxchart5-react/dist/config/localization/studies';
import { DEFAULT_STUDIES_LIST } from '@dx-private/dxchart5-react/dist/config/studies-list';
import { fromRawStudiesSettings } from '@dx-private/dxchart5-react/dist/chart/model/studies.model';
import { createDxStudiesProvider } from '@dx-private/dxchart5-react/dist/providers/studies/dx-studies-provider';
import { DEFAULT_LOCALIZATION } from '@dx-private/dxchart5-react/dist/config/localization/localization';
const myStudiesDictionary = {
...studiesDictionary,
macd: {
...studiesDictionary.macd,
title: 'My MACD',
},
};
const dxStudiesProvider = createDxStudiesProvider(
DEFAULT_STUDIES_LIST(myStudiesDictionary).map(fromRawStudiesSettings),
);
const localization = {
...DEFAULT_LOCALIZATION,
studies: myStudiesDictionary,
};
For JavaScript custom studies, set metainfo.title when calling addCustomStudy() — no localization dictionary entry is required.
Reading and updating localization at runtime
After the chart API is ready, use getLocalization() and updateLocalization() on the chart React API (via onAPICreated):
const onAPICreated = (api) => {
const current = api.getLocalization();
api.updateLocalization({
toolbar: { undo: 'Desfazer' },
});
};
Further reading