Skip to content

Commit 8520222

Browse files
Merge pull request #2365 from syncfusion-content/1012852-localizationReact
1012852: Localization in React PDF Viewer
2 parents ac8d8f6 + 8a1f3ab commit 8520222

5 files changed

Lines changed: 978 additions & 849 deletions

File tree

Document-Processing-toc.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,14 @@
11801180
<li><a href="/document-processing/pdf/pdf-viewer/react/download">Download</a></li>
11811181
<li><a href="/document-processing/pdf/pdf-viewer/react/events">Events</a></li>
11821182
<li><a href="/document-processing/pdf/pdf-viewer/react/text-selection">Text Selection</a></li>
1183-
<li><a href="/document-processing/pdf/pdf-viewer/react/globalization">Globalization</a></li>
1184-
<li><a href="/document-processing/pdf/pdf-viewer/react/accessibility">Accessibility</a></li>
1183+
<li>Localization and Globalization
1184+
<ul>
1185+
<li><a href="/document-processing/pdf/pdf-viewer/react/Localization/default-language">Default Language</a></li>
1186+
<li><a href="/document-processing/pdf/pdf-viewer/react/Localization/new-language">Change Language</a></li>
1187+
<li><a href="/document-processing/pdf/pdf-viewer/react/Localization/rtl-language-support">RTL and Localization</a></li>
1188+
</ul>
1189+
</li>
1190+
<li><a href="/document-processing/pdf/pdf-viewer/react/accessibility">Accessibility Features</a></li>
11851191
<li><a href="/document-processing/pdf/pdf-viewer/react/theming-and-styling">Theming and Styling</a></li>
11861192
<li><a href="/document-processing/pdf/pdf-viewer/react/context-menu/context-menu">Context Menu</a>
11871193
<ul>
Lines changed: 321 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,321 @@
1+
---
2+
layout: post
3+
title: Localization in React PDF Viewer | Syncfusion
4+
description: Learn here all about the default language culture and localization in Syncfusion React PDF Viewer component.
5+
platform: document-processing
6+
control: PDF Viewer
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Localization in the React PDF Viewer
12+
13+
The PDF Viewer supports localization of UI text, tooltips, and messages using culture-specific string collections so the interface matches users' language and regional settings.
14+
15+
![Default Locale](../../javascript-es6/images/locale-us.gif)
16+
17+
N> Change the viewer locale by setting the `locale` property on the React component or by loading translations with `L10n.load` from `@syncfusion/ej2-base`.
18+
19+
## Default language (en-US)
20+
21+
By default, the PDF Viewer uses the `en-US` culture and requires no additional configuration.
22+
23+
{% tabs %}
24+
{% highlight js tabtitle="Standalone" %}
25+
{% raw %}
26+
import * as ReactDOM from 'react-dom';
27+
import * as React from 'react';
28+
import './index.css';
29+
import {
30+
PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView,
31+
ThumbnailView, Print, TextSelection, TextSearch, Annotation, FormDesigner, FormFields, Inject
32+
} from '@syncfusion/ej2-react-pdfviewer';
33+
34+
// Inject required modules
35+
PdfViewerComponent.Inject(Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView,
36+
ThumbnailView, Print, TextSelection, TextSearch, Annotation, FormDesigner, FormFields);
37+
38+
export function App() {
39+
return (
40+
<div className='control-section'>
41+
{/* Render the PDF Viewer with default en-US locale */}
42+
<PdfViewerComponent
43+
id="pdfViewer"
44+
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
45+
resourceUrl="https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"
46+
locale="en-US"
47+
/>
48+
</div>
49+
);
50+
}
51+
52+
const root = ReactDOM.createRoot(document.getElementById('sample'));
53+
root.render(<App />);
54+
{% endraw %}
55+
{% endhighlight %}
56+
{% endtabs %}
57+
58+
[View Sample on GitHub](https://github.com/SyncfusionExamples/react-pdf-viewer-examples)
59+
60+
## Localization keys reference
61+
62+
The PDF Viewer supports localization using culture-specific string collections. By default, the component uses the "en-US" culture.
63+
64+
The following table lists the default text values used by the PDF Viewer in the "en-US" culture:
65+
66+
|Keywords|Values|
67+
|---|---|
68+
|PdfViewer|PDF Viewer|
69+
|Cancel|Cancel|
70+
|Download file|Download file|
71+
|Download|Download|
72+
|Enter Password|This document is password protected. Please enter a password.|
73+
|File Corrupted|File corrupted|
74+
|File Corrupted Content|The file is corrupted and cannot be opened.|
75+
|Fit Page|Fit page|
76+
|Fit Width|Fit width|
77+
|Automatic|Automatic|
78+
|Go To First Page|Show first page|
79+
|Invalid Password|Incorrect password. Please try again.|
80+
|Next Page|Show next page|
81+
|OK|OK|
82+
|Open|Open file|
83+
|Page Number|Current page number|
84+
|Previous Page|Show previous page|
85+
|Go To Last Page|Show last page|
86+
|Zoom|Zoom|
87+
|Zoom In|Zoom in|
88+
|Zoom Out|Zoom out|
89+
|Page Thumbnails|Page thumbnails|
90+
|Bookmarks|Bookmarks|
91+
|Print|Print file|
92+
|Password Protected|Password required|
93+
|Copy|Copy|
94+
|Text Selection|Text selection tool|
95+
|Panning|Pan mode|
96+
|Text Search|Find text|
97+
|Find in document|Find in document|
98+
|Match case|Match case|
99+
|Apply|Apply|
100+
|GoToPage|Go to page|
101+
|No Matches|Viewer has finished searching the document. No more matches were found|
102+
|No Text Found|No Text Found|
103+
|Undo|Undo|
104+
|Redo|Redo|
105+
|Annotation|Add or Edit annotations|
106+
|Highlight|Highlight Text|
107+
|Underline|Underline Text|
108+
|Strikethrough|Strikethrough Text|
109+
|Delete|Delete annotation|
110+
|Opacity|Opacity|
111+
|Color edit|Change Color|
112+
|Opacity edit|Change Opacity|
113+
|Highlight context|Highlight|
114+
|Underline context|Underline|
115+
|Strikethrough context|Strike through|
116+
|Server error|Web-service is not listening. PDF Viewer depends on web-service for all it's features. Please start the web service to continue.|
117+
|Open text|Open|
118+
|First text|First Page|
119+
|Previous text|Previous Page|
120+
|Next text|Next Page|
121+
|Last text|Last Page|
122+
|Zoom in text|Zoom In|
123+
|Zoom out text|Zoom Out|
124+
|Selection text|Selection|
125+
|Pan text|Pan|
126+
|Print text|Print|
127+
|Search text|Search|
128+
|Annotation Edit text|Edit Annotation|
129+
|Line Thickness|Line Thickness|
130+
|Line Properties|Line Properties|
131+
|Start Arrow|Start Arrow |
132+
|End Arrow|End Arrow|
133+
|Line Style|Line Style|
134+
|Fill Color|Fill Color|
135+
|Line Color|Line Color|
136+
|None|None|
137+
|Open Arrow|Open Arrow|
138+
|Closed Arrow|Closed Arrow|
139+
|Round Arrow|Round Arrow|
140+
|Square Arrow|Square Arrow|
141+
|Diamond Arrow|Diamond Arrow|
142+
|Cut|Cut|
143+
|Paste|Paste|
144+
|Delete Context|Delete Context|
145+
|Properties|Properties|
146+
|Add Stamp|Add Stamp|
147+
|Add Shapes|Add Shapes|
148+
|Stroke edit|Stroke Edit|
149+
|Change thickness|Change Thickness|
150+
|Add line|Add Line|
151+
|Add arrow|Add Arrow|
152+
|Add rectangle|Add Rectangle|
153+
|Add circle|Add Circle|
154+
|Add polygon|Add Polygon|
155+
|Add Comments|Add Comments|
156+
|Comments| Comments|
157+
|No Comments Yet|No Comments Yet|
158+
|Accepted| Accepted|
159+
|Completed| Completed|
160+
|Cancelled| Cancelled|
161+
|Rejected| Rejected|
162+
|Leader Length|Leader Length|
163+
|Scale Ratio|Scale Ratio|
164+
|Calibrate| Calibrate|
165+
|Calibrate Distance|Calibrate Distance|
166+
|Calibrate Perimeter|Calibrate Perimeter|
167+
|Calibrate Area|Calibrate Area|
168+
|Calibrate Radius|Calibrate Radius|
169+
|Calibrate Volume|Calibrate Volume|
170+
|Depth|Depth|
171+
|Closed|Closed|
172+
|Round|Round|
173+
|Square|Square|
174+
|Diamond|Diamond|
175+
|Edit|Edit|
176+
|Comment|Comment|
177+
|Comment Panel|Comment Panel|
178+
|Set Status|Set Status|
179+
|Post|Post|
180+
|Page|Page|
181+
|Add a comment|Add a comment|
182+
|Add a reply|Add a reply|
183+
|Import Annotations|Import Annotations|
184+
|Export Annotations|Export Annotations|
185+
|Add|Add|
186+
|Clear|Clear|
187+
|Bold|Bold|
188+
|Italic|Italic|
189+
|Strikethroughs|Strikethroughs|
190+
|Underlines|Underlines|
191+
|Superscript|Superscript|
192+
|Subscript|Subscript|
193+
|Align left|Align Left|
194+
|Align right|Align Right|
195+
|Center|Center|
196+
|Justify|Justify|
197+
|Font color|Font Color|
198+
|Text Align|Text Align|
199+
|Text Properties|Text Properties|
200+
|Draw Signature|Draw Signature|
201+
|Create| Create|
202+
|Font family|Font Family|
203+
|Font size|Font Size|
204+
|Free Text|Free Text|
205+
|Import Failed|Import Failed|
206+
|File not found|File Not Found|
207+
|Export Failed|Export Failed|
208+
|Dynamic|Dynamic|
209+
|Standard Business|Standard Business|
210+
|Sign Here|Sign Here|
211+
|Custom Stamp|Custom Stamp|
212+
|InitialFieldDialogHeaderText|Initial Field Dialog Header Text|
213+
|HandwrittenInitialDialogHeaderText|Handwritten Initial Dialog Header Text|
214+
|SignatureFieldDialogHeaderText|Signature Field Dialog Header Text|
215+
|HandwrittenSignatureDialogHeaderText|Handwritten Signature Dialog Header Text|
216+
|Draw-hand Signature|Draw-hand Signature|
217+
|Type Signature|Type Signature|
218+
|Upload Signature|Upload Signature|
219+
|Browse Signature Image|Browse Signature Image|
220+
|Save Signature|Save Signature|
221+
|Save Initial|Save Initial|
222+
|highlight|highlight|
223+
|underline|underline|
224+
|strikethrough|strikethrough|
225+
|FormDesigner|Form Designer|
226+
|SubmitForm|Submit Form|
227+
|Search text|Search Text|
228+
|Draw Ink|Draw Ink|
229+
|Revised|Revised|
230+
|Reviewed|Reviewed|
231+
|Received|Received|
232+
|Confidential|Confidential|
233+
|Approved|Approved|
234+
|Not Approved|Not Approved|
235+
|Witness|Witness|
236+
|Initial Here|Initial Here|
237+
|Draft|Draft|
238+
|Final|Final|
239+
|For Public Release|For Public Release|
240+
|Not For Public Release|Not For Public Release|
241+
|For Comment|For Comment|
242+
|Void|Void|
243+
|Preliminary Results|Preliminary Results|
244+
|Information Only|Information Only|
245+
|Enter Signature as Name|Enter Signature as Name|
246+
|Textbox|Textbox|
247+
|Password|Password|
248+
|Check Box|Check Box|
249+
|Radio Button|Radio Button|
250+
|Dropdown|Dropdown|
251+
|List Box|List Box|
252+
|Signature|Signature|
253+
|Delete FormField|Delete FormField|
254+
|FormDesigner Edit text|Form Designer Edit Text|
255+
|in|in|
256+
|m|m|
257+
|ft_in|ft_in|
258+
|ft|ft|
259+
|p|p|
260+
|cm|cm|
261+
|mm|mm|
262+
|pt|pt|
263+
|cu|cu|
264+
|sq|sq|
265+
|General|General|
266+
|Appearance|Appearance|
267+
|Options|Options|
268+
|Textbox Properties|Textbox Properties|
269+
|Name|Name|
270+
|Tooltip|Tooltip|
271+
|Value|Value|
272+
|Form Field Visibility|Form Field Visibility|
273+
|Read Only|Read Only|
274+
|Required|Required|
275+
|Checked|Checked|
276+
|Show Printing|Show Printing|
277+
|Formatting|Formatting|
278+
|Fill|Fill|
279+
|Border|Border|
280+
|Border Color|Border Color|
281+
|Thickness|Thickness|
282+
|Max Length|Max Length|
283+
|List Item|List Item|
284+
|Export Value|Export Value|
285+
|Dropdown Item List|Dropdown Item List|
286+
|List Box Item List|List Box Item List|
287+
|Delete Item|Delete Item|
288+
|Up|Up|
289+
|Down|Down|
290+
|Multiline|Multiline|
291+
|Initial|Initial|
292+
|Export XFDF|Export XFDF|
293+
|Import XFDF|Import XFDF|
294+
|Organize Pages|Organize Pages|
295+
|Insert Right|Insert Right|
296+
|Insert Left|Insert Left|
297+
|Total|Total|
298+
|Pages|Pages|
299+
|Rotate Right|Rotate Right|
300+
|Rotate Left|Rotate Left|
301+
|Delete Page|Delete Page|
302+
|Delete Pages|Delete Pages|
303+
|Copy Page|Copy Page|
304+
|Copy Pages|Copy Pages|
305+
|Save|Save|
306+
|Save As|Save As|
307+
|Select All|Select All|
308+
|Import Document|Import Document|
309+
|Match any word|Match any word|
310+
|Client error|Client-side error is found. Please check the custom headers provided in the AjaxRequestSettings property and web action methods in the ServerActionSettings property|
311+
|Cors policy error|Unable to retrieve the document due to an invalid URL or access restrictions. Please check the document URL and try again|
312+
|No More Matches|Viewer has finished searching the document. No more matches were found|
313+
|No Search Matches|No matches found|
314+
|No More Search Matches|No more matches found|
315+
|Exact Matches|EXACT MATCHES|
316+
|Total Matches|TOTAL MATCHES|
317+
318+
## See Also
319+
320+
- [New Language](./new-language)
321+
- [RTL Language Support](./rtl-language-support)

0 commit comments

Comments
 (0)