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 crossTool Cross-tool (crosshair) labels for OHLC (Open, High, Low, Close) values and volume. Localization_crossTool open string high string low string close string volume string drawings All localization strings for the drawings feature including sidebar, dropdown menus,
context menus, and individual drawing tool names. Localization_drawings recentDrawings string noRecentDrawings string hideDrawings string unhideDrawings string clearDrawings string types DrawingNames line any rectangle any horizontal_line any horizontal_ray any vertical_line any extended_line any ellipse any pitchfork any ray any curve any arc any info_line any brush any path any date_price_range any date_range any price_range any highlighter any icon any gann_box any gann_square any fibonacci_ark any fibonacci_circles any fibonacci_rays any gann_fan any trend_channel any fibonacci_retracements any text any callout any price_label any vertical_arrow_up any vertical_arrow_down any arrow any elliott_wave any elliott_correction_wave any fibonacci_projection any fibonacci_channel any fibonacci_time_zones any regression_trend any fibonacci_spiral any cycle_brackets any fibonacci_time_extension any fibonacci_time_ratios any range_volume_by_price any anchored_volume_by_price any risk_reward_long any risk_reward_short any trend any extended any multichannel any base_isolation_tool any magnifying_tool_rectangle any magnifying_tool_time_range any magnifying_tool_time_range_wheel any default any dropdown DrawingsDictionary_dropdown calendar DrawingsDictionary_calendar colorPicker DrawingsDictionary_colorPicker confirmationPopup DrawingsDictionary_confirmationPopup popup DrawingsDictionary_popup textNote DrawingsDictionary_textNote regressionTrend DrawingsDictionary_regressionTrend fibonacciSpiral DrawingsDictionary_fibonacciSpiral volumeByPrice DrawingsDictionary_volumeByPrice contextMenu DrawingsDictionary_contextMenu riskReward DrawingsDictionary_riskReward legend Legend labels for OHLC values, volume, comparison mode, and chart type selector. Localization_legend open string high string low string close string fullOHLCNames LegendDictionary_fullOHLCNames priceChange string volume string compare string a11y_zoomIn string a11y_zoomOut string a11y_resetChartView string a11y_legendSwitcher string a11y_chartType string chartType LegendDictionary_chartType timeZone Timezone selector strings including UTC, exchange timezone, and accessibility labels. Localization_timeZone utc string exchange string input_placeholder string input_no_data string a11y_timezoneMenu string a11y_timezoneList string studies All study/indicator related strings including names, parameters, settings,
and right-click menu options for all available studies. StudiesDictionary rightClickMenu any td_sequential any adx any wave_trend any adxr any acceleration_deceleration any accumulation_swing_index any accumulation_distribution any aroon_indicator any aroon_oscillator any average_true_range any awesome_oscillator any bollinger_bands any bollinger_bands_percent any cci any csi any center_of_gravity_oscillator any chaikin_oscillator any chaikin_volatility any chande_momentum_oscillator any kama any dema any dmi any day_open_close any demarker any detrended_price_osc any dynamic_momentum_index any ema any ema_envelope any elder_ray any fast_stochastic any fibonacci_bb any force_index any forecast_oscillator any full_stochastic any gator_oscillator any hl_volatility any hma any ichimoku any inertia any intraday_momentum_index any kairi_relative_index any keltner_channels any linear_regression_channel any linear_regression_curve any linear_regression_slope any macd any market_facilitation_index any mass_index any median_price any momentum any money_flow_index any negative_volume_index any on_balance_volume any parabolic_sar any percent_change any percent_of_resistance any percentage_price_oscillator any pivot_points any price_channel any price_oscillator any price_and_volume_trend any roc any relative_strength_index any relative_vigor_index any relative_vigor_index_sma any relative_volatility_index any sma any sma_envelope any smma any smma_envelope any starc_bands any schaff_trend_cycle any slow_stochastic any smoothed_rate_of_change any spearman any standard_deviation any standard_deviation_channel any standard_error_bands any std_dev_volatility any swing_index any tema any tma any trix any time_series_forecast any true_strength_index any typical_price any ultimate_oscillator any vertical_horizontal_filter any volume_weighted_average_price any wma any wma_envelope any weighted_close any wilders_smoothing any williams_ad any williams_alligator any williams_fractal any williams_percent_range any wtwc any zigzag any supertrend any historical_volatility any ema_clouds any stochastic_rsi any acceleration_bands any elder_force_index any donchian_channel any ttm_squeeze any chaikin_money_flow any implied_volatility any volume_average any aggregationPeriod Aggregation period selector strings including period names, custom period input,
and validation messages. Localization_aggregationPeriod periods PeriodsDictionary tick string | { long: string; short: string; } range string | { long: string; short: string; } second string | { long: string; short: string; } minute string | { long: string; short: string; } hour string | { long: string; short: string; } day string | { long: string; short: string; } week string | { long: string; short: string; } month string | { long: string; short: string; } year string | { long: string; short: string; } volume string | { long: string; short: string; } customPeriodsMap CustomPeriodsMap CustomPeriodsMap interface defines how to parse custom timeframes. types 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 y any t any r any s any m any h any d any w any mo any v any numberWords string[] pluralPostfix (count: number) => string custom string customInputPlaceHolder string a11y_customInputConfirmButton string a11y_aggregationPeriodDescription string a11y_deleteAggregationPeriod string validation_nonexistentCustomPeriod string yAxis Y-axis configuration strings including scale type labels (regular, percent, logarithmic),
axis alignment options, and fit settings. YAxisDictionary auto string lockPrice string fit FitDictionary studies string orders string positions string axisType AxisTypeDictionary regular string percent string logarithmic string axisAlign AxisAlignDictionary title string settingsRight string settingsLeft string right string left string labelsAndLines string labels LabelsDictionary lastPrice string studies string bidAsk string highLow string prevDayClose string prePostMarket string scale ScaleDictionary inverse string lock string descriptions string countDownToBarClose string fullChartSettings string buttons ButtonsDictionary a11y_percent string a11y_logarithmic string a11y_regular string a11y_scaleType string a11y_sideAlign string events Economic events labels for earnings, dividends, stock splits, conference calls, and news. Localization_events earnings EventsDictionary_earnings dividends EventsDictionary_dividends splits EventsDictionary_splits conference-calls EventsDictionary_conference-calls codeEditor Code editor UI strings for creating custom studies including button labels,
status messages, and error messages. Localization_codeEditor pending string addToChartBtn string updateBtn string duplicateBtn string docsBtn string fiveStudiesMax string saved string close string saving string errors CodeEditorDictionary_errors studiesPopup Studies configuration popup strings including available studies list, filters,
study settings, inputs, plots, and style options. Localization_studiesPopup editStudies string availableStudies string filter string studiesMax string addedStudies string deleteAll string emptyResult string restoreToDefault string inputs string plots string overlaying string settings string close string holdToDelete string learnMoreLink string studyLineTypeList StudiesPopupDictionary_studyLineTypeList studyParamAggregationType StudiesPopupDictionary_studyParamAggregationType studyParamAverageType StudiesPopupDictionary_studyParamAverageType studyParamBasisType StudiesPopupDictionary_studyParamBasisType studyParamPriceType StudiesPopupDictionary_studyParamPriceType studyParamMoveToScale StudiesPopupDictionary_studyParamMoveToScale markerStyle StudiesPopupDictionary_markerStyle markerLineStyle StudiesPopupDictionary_markerLineStyle overlayingCheckboxDisabled string a11y_openScript string a11y_editScript string a11y_deleteScript string a11y_close string newScript string a11y_labelForEditAndDelScript string a11y_labelForEditScript string a11y_availableStudes string a11y_availableStudiesList string a11y_addedStudiesList string a11y_plotVisibility string a11y_plotLineThickness string a11y_plotLineColor string a11y_plotLineType string a11y_overlayStudy string a11y_dragHandleInstructions string trading Trading-related strings for order entry, order types, protection orders (TP/SL),
and executed orders display. Localization_trading orderEntry TradingDictionary_orderEntry executedOrders TradingDictionary_executedOrders orderTypes TradingDictionary_orderTypes protectionOrders TradingDictionary_protectionOrders chartSnapshot Chart snapshot feature strings for downloading, copying, and sharing chart images
via social media platforms. Localization_chartSnapshot downloadImage string copyImage string copyLink string tweet string telegram string shareTwitterText string shareTelegramText string notifications Notification messages displayed to users for various actions like copying images,
magnet mode toggle, drawing mode changes, etc. Localization_notifications notificationImageCopy string notificationLinkCopy string notificationFallback string notificationSidebarMagnetOn string notificationSidebarMagnetOff string notificationSidebarDrawingOn string notificationSidebarDrawingOff string notificationSidebarDelete string notificationDataTypeChanged string notificationInstrumentNoData string notificationResetChart string notificationDrawingCopied string notificationDrawingPasted string notificationDrawingCut string notificationSyncedDrawingsSameChartOnly string layout Chart layout management strings for creating, editing, and deleting custom layouts,
including validation messages. Localization_layout newLayout string a11y_layoutTemplateDescription string a11y_deleteLayoutTemplate string a11y_editLayoutTemplate string a11y_customInputConfirmButton string validation_nameAlreadyExists string validation_cannotFindLayoutToUpdate string sidebar Sidebar strings including header text, accessibility labels, and button tooltips
for magnet mode, drawing mode, and drawing visibility controls. Localization_sidebar a11y_toolbar string header string a11y_favoriteList string a11y_drawingsList string a11y_footerList string a11y_collapseSidebar string a11y_expandSidebar string a11y_sidebarButtonDescription string buttons SidebarDictionary_buttons indicatorTemplates Indicator template management strings for saving, editing, and deleting custom
indicator configurations. Localization_indicatorTemplates saveIndicatorTemplate string a11y_indicatorTemplateDescription string a11y_deleteIndicatorTemplate string a11y_editIndicatorTemplate string a11y_customInputConfirmButton string validation_nameAlreadyExists string validation_cannotFindTemplateToUpdate string themes Theme selector strings including theme names (dark, light, cloudDancer, oud, still, solar). Localization_themes title string types ThemesDictionary_types toolbar Top toolbar strings including button tooltips, dropdown labels, accessibility labels,
and market state indicators. Localization_toolbar a11y_toolbar string a11y_buttons ToolbarDictionary_a11y_buttons a11y_synchronize ToolbarDictionary_a11y_synchronize a11y_studies ToolbarDictionary_a11y_studies compareChart ToolbarDictionary_compareChart chartType ToolbarDictionary_chartType multichart ToolbarDictionary_multichart instrumentSelector ToolbarDictionary_instrumentSelector tooltip ToolbarDictionary_tooltip marketState ToolbarDictionary_marketState settingsPopup Settings popup strings for all configuration tabs including general settings,
appearance, scale, data, events, and trading options. Localization_settingsPopup a11y_radioButton string priceTypes SettingsPopupDictionary_priceTypes chartSettings string resetChart string tabs SettingsPopupDictionary_tabs appearance SettingsPopupDictionary_appearance paddings SettingsPopupDictionary_paddings restoreDefaultsBtn string resetToDefaultsBtn string closeBtn string components Common component strings used across multiple features including popup close buttons,
color picker, line style picker, and numeric stepper. Localization_components chart ComponentsDictionary_chart lineStylePicker ComponentsDictionary_lineStylePicker popup ComponentsDictionary_popup simpleNumericStepper ComponentsDictionary_simpleNumericStepper numericStepper ComponentsDictionary_numericStepper aggregationTimeframe ComponentsDictionary_aggregationTimeframe axisTypeButtons ComponentsDictionary_axisTypeButtons yAxisScalesLabels ComponentsDictionary_yAxisScalesLabels colorPicker ComponentsDictionary_colorPicker symbolSuggest ComponentsDictionary_symbolSuggest chartLayers Chart layers management strings for locking, unlocking, hiding, and organizing
drawing layers and groups. Localization_chartLayers a11y_lockLayerItem string a11y_unlockLayerItem string a11y_hideLayerItem string a11y_unhideLayerItem string headerTitle string closeButton string createGroupButton string deleteButton string newGroupName string drawingGroups Drawing groups management strings for creating, editing, and deleting custom
drawing groups with group selector labels. Localization_drawingGroups defaultGroup string addNewGroup string addNewGroupPlaceholder string a11y_deleteGroup string a11y_editGroup string a11y_drawingGroupsMenu string a11y_drawingGroupsAnchor string timeframePresets Timeframe presets strings for quick time range selection (1D, 1W, 1M, 1Y, etc.)
and custom timeframe input. Localization_timeframePresets a11y_presets_list string a11y_toggle_custom_preset string a11y_toggle_edit string a11y_preset string a11y_remove_preset string timeframeLabelTypes TimeframePresetsDictionary_timeframeLabelTypes systemMessages System messages displayed when no data is available, instrument is not available,
or no instrument is selected. Localization_systemMessages noDataAvailable string instrumentIsNotAvailable string instrumentIsNotSelected string dynamicObjects Dynamic objects (drawings and studies) layer management strings for bringing forward,
sending backward, and moving between layers. Localization_dynamicObjects bringToFront string sendToBack string bringForward string sendBackward string moveTo string navigationMap Navigation map component strings including accessibility labels for left/right
navigation arrows and slider controls. Localization_navigationMap a11y_navMapLeft string a11y_navMapRight string a11y_navMapLeftArrow string a11y_navMapRightArrow string formatter Number and date formatting strings for displaying values in different formats
and locales. Localization_formatter decimalSeparator string thousandsSeparator string returnToNow Return to now button strings for navigating back to the most recent time. Localization_returnToNow a11y_returnToNow string
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