ikinci temizlik tamamlandı
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
||||
<link rel="stylesheet" href="../../style.css" />
|
||||
<script src="../../../lib/webviewer.min.js"></script>
|
||||
<script src="../../old-browser-checker.js"></script>
|
||||
<script src="../../global.js"></script>
|
||||
<title>JavaScript PDF Viewer Language Demo</title>
|
||||
<script src="../../modernizr.custom.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="title sample">Language Demo for PDF Viewer</div>
|
||||
</header>
|
||||
<aside>
|
||||
<h1>Controls</h1>
|
||||
<h2>Languages</h2>
|
||||
<form id="form">
|
||||
<input type="radio" name="form" id="en" checked />
|
||||
<label for="en">English</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="fr" />
|
||||
<label for="fr">French</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="zh_cn" />
|
||||
<label for="zh_cn">Chinese Simplified</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="zh_tw" />
|
||||
<label for="zh_tw">Chinese Traditional</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="de" />
|
||||
<label for="de">German</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="es" />
|
||||
<label for="es">Spanish</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="ja" />
|
||||
<label for="ja">Japanese</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="ko" />
|
||||
<label for="ko">Korean</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="nl" />
|
||||
<label for="nl">Dutch</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="pt_br" />
|
||||
<label for="pt_br">Portuguese</label>
|
||||
<br />
|
||||
<input type="radio" name="form" id="ru" />
|
||||
<label for="ru">Russian</label>
|
||||
</form>
|
||||
<hr />
|
||||
<h1>Instructions</h1>
|
||||
<p>Use the buttons to change languages. You will be able to see the button tooltips (in desktop) being updated into different languages.</p>
|
||||
</aside>
|
||||
<div id="viewer"></div>
|
||||
<script src="../../menu-button.js"></script>
|
||||
|
||||
<!--ga-tag-->
|
||||
|
||||
<script>
|
||||
Modernizr.addTest('async', function() {
|
||||
try {
|
||||
var result;
|
||||
eval('let a = () => {result = "success"}; let b = async () => {await a()}; b()');
|
||||
return result === 'success';
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// test for async and fall back to code compiled to ES5 if they are not supported
|
||||
['internationalization.js'].forEach(function(js) {
|
||||
var script = Modernizr.async ? js : js.replace('.js', '.ES5.js');
|
||||
var scriptTag = document.createElement('script');
|
||||
scriptTag.src = script;
|
||||
scriptTag.type = 'text/javascript';
|
||||
document.getElementsByTagName('head')[0].appendChild(scriptTag);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+5931
File diff suppressed because it is too large
Load Diff
+32
@@ -0,0 +1,32 @@
|
||||
// @link WebViewerInstance: https://www.pdftron.com/api/web/WebViewerInstance.html
|
||||
// @link UI.setLanguage: https://www.pdftron.com/api/web/UI.html#setLanguage__anchor
|
||||
|
||||
WebViewer(
|
||||
{
|
||||
path: '../../../lib',
|
||||
additionalTranslations: {
|
||||
language: 'en',
|
||||
translations: { 'option.toolbarGroup.toolbarGroup-View': 'Edited View Label' },
|
||||
},
|
||||
|
||||
initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf',
|
||||
},
|
||||
document.getElementById('viewer')
|
||||
).then(instance => {
|
||||
samplesSetup(instance);
|
||||
document.getElementById('form').onchange = e => {
|
||||
// Set language
|
||||
instance.UI.setLanguage(e.target.id);
|
||||
};
|
||||
|
||||
// To Create a new button into the settings menu and set the translation
|
||||
instance.UI.settingsMenuOverlay.add(
|
||||
{
|
||||
type: 'actionButton',
|
||||
className: 'row',
|
||||
dataElement: 'languageButton',
|
||||
label: 'Language',
|
||||
},
|
||||
'downloadButton'
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user