diff --git a/Localization/.gitignore b/Localization/.gitignore new file mode 100644 index 0000000..1eae0cf --- /dev/null +++ b/Localization/.gitignore @@ -0,0 +1,2 @@ +dist/ +node_modules/ diff --git a/Localization/README.md b/Localization/README.md new file mode 100644 index 0000000..46e0b02 --- /dev/null +++ b/Localization/README.md @@ -0,0 +1,75 @@ +# Essential JS 2 QuickStart + +This project is a skeleton application used to create [Essential JS 2](https://www.syncfusion.com/products/essential-js2) web application. + +>This application uses the latest version of the [webpack-cli](https://webpack.js.org/api/cli/#commands). It requires node `v14.15.0` or higher. + +## Getting Started + +To get started you need to clone the `ej2-quickstart` repository and navigate to `ej2-quickstart` location. + +``` +git clone https://github.com/syncfusion/ej2-quickstart.git quickstart +cd quickstart +``` + +## Installing + +We can get all the Essential JS 2 components in a single npm package [`ej2`](https://www.npmjs.com/package/@syncfusion/ej2). + +We already configure the required packages in the `package.json` file. + +You can run the below command to install all dependent packages related to this seed project. + +``` +npm install +``` + +## Testing + +This application is preconfigured with End-to-End testing and the test case is written in Jasmine. + +We run the test scripts with [Protractor](http://www.protractortest.org/#/) end-to-end test runner. The test case file can be found in the `e2e` folder. + +Protractor can interact with our web application and verify the test scripts. + +We have to install WebDriver and also need to ensure it is updated. Open a separate terminal and run the below npm script. + +``` +npm run update-webdriver +``` + +Open another terminal and run the below npm script. It will start web server to serve our application. + +``` +npm run serve +``` + +Once the web server is up and running, we can run the end-to-end tests using the below npm script + +``` +npm run test +``` + +> **Note:** Since Protractor is using the Selenium Standalone Server, the Java Development Kit (JDK) need to be installed in your local machine. + +If JDK is not installed in your local machine, you can download it from [here](http://www.oracle.com/technetwork/java/javase/downloads/index.html). + +## Running + +The application is configured with [webpack-dev-server](https://webpack.js.org/configuration/dev-server/#devserver), so it will serve the web application in your default browser. + +We have used [Webpack](https://github.com/webpack/webpack) for module loading. + +You can use the below npm script to run the web application. + +``` +npm run start +``` + +## Resources + +You can also refer the below resources to know more details about Essential JS 2 components. + +* [Pure JS Demos](http://ej2.syncfusion.com/demos/) +* [Pure JS Documentation](http://ej2.syncfusion.com/documentation/) diff --git a/Localization/e2e/index.spec.js b/Localization/e2e/index.spec.js new file mode 100644 index 0000000..e69de29 diff --git a/Localization/e2e/protractor.conf.js b/Localization/e2e/protractor.conf.js new file mode 100644 index 0000000..43eee1b --- /dev/null +++ b/Localization/e2e/protractor.conf.js @@ -0,0 +1,21 @@ +exports.config = { + + allScriptsTimeout: 11000, + + capabilities: { + 'browserName': 'chrome' + }, + + framework: 'jasmine', + + jasmineNodeOpts: { + defaultTimeoutInterval: 10000 + }, + directConnect: true, + + onPrepare: function() { + browser.waitForAngularEnabled(false); + }, + + specs: ['./*.spec.js'] +}; \ No newline at end of file diff --git a/Localization/gulpfile.js b/Localization/gulpfile.js new file mode 100644 index 0000000..6a623f3 --- /dev/null +++ b/Localization/gulpfile.js @@ -0,0 +1,62 @@ +'use strict'; + +var gulp = require('gulp'); + +/** + * Compile TypeScript to JS + */ +gulp.task('compile', function (done) { + var webpack = require('webpack'); + var webpackStream = require('webpack-stream'); + gulp.src(['./src/app/app.ts']).pipe(webpackStream({ + config: require('./webpack.config.js') + }, webpack)) + .pipe(gulp.dest('./dist')) + .on('end', function () { + done(); + }); +}); + +/** + * Testing spec files + */ +var protractor = require('gulp-protractor').protractor; +var webdriver_standalone = require('gulp-protractor').webdriver_standalone; +var webdriver_update = require('gulp-protractor').webdriver_update_specific; + +gulp.task('e2e-serve', webdriver_standalone); + +gulp.task('e2e-webdriver-update', webdriver_update({ + webdriverManagerArgs: ['--ie', '--edge'] +})); + +gulp.task('e2e-test', gulp.series('compile', function (done) { + var browserSync = require('browser-sync'); + var bs = browserSync.create('Essential JS 2'); + var options = { + server: { + baseDir: [ + './dist/', + ], + directory: true + }, + ui: false, + open: false, + notify: false + }; + bs.init(options, function () { + gulp.src(['./spec/**/*.spec.js']) + .pipe(protractor({ + configFile: 'e2e/protractor.conf.js' + })) + .on('error', function (e) { + console.error('Error: ' + e.message); + done(); + process.exit(1); + }) + .on('end', function () { + done(); + process.exit(0); + }); + }); +})); \ No newline at end of file diff --git a/Localization/license b/Localization/license new file mode 100644 index 0000000..111c12a --- /dev/null +++ b/Localization/license @@ -0,0 +1,10 @@ +Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license. + +To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions. + +Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options. + +Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions. + +The Syncfusion license that contains the terms and conditions can be found at +https://www.syncfusion.com/content/downloads/syncfusion_license.pdf diff --git a/Localization/package.json b/Localization/package.json new file mode 100644 index 0000000..f108444 --- /dev/null +++ b/Localization/package.json @@ -0,0 +1,38 @@ +{ + "name": "ej2-quickstart", + "version": "0.0.1", + "description": "Essential JS 2 typescript quick start application", + "author": "Syncfusion Inc.", + "license": "SEE LICENSE IN license", + "repository": { + "type": "git", + "url": "https://github.com/syncfusion/ej2-quickstart.git" + }, + "scripts": { + "start": "webpack-dev-server --mode development", + "build": "webpack --mode production", + "serve": "gulp e2e-serve", + "test": "gulp e2e-test", + "update-webdriver": "gulp e2e-webdriver-update" + }, + "devDependencies": { + "ajv": "^8.11.2", + "browser-sync": "^2.18.12", + "gulp": "*", + "typescript": "*", + "gulp-protractor": "*", + "gulp-typescript": "*", + "jasmine": "^2.6.0", + "css-loader": "^6.7.2", + "ts-loader": "^9.4.1", + "mini-css-extract-plugin": "^2.7.0", + "html-webpack-plugin": "^5.5.0", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.0", + "webpack-dev-server": "^5.2.1", + "webpack-stream": "^7.0.0" + }, + "dependencies": { + "@syncfusion/ej2": "*" + } +} diff --git a/Localization/src/app/app.ts b/Localization/src/app/app.ts new file mode 100644 index 0000000..f5bd87d --- /dev/null +++ b/Localization/src/app/app.ts @@ -0,0 +1,271 @@ +import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageOrganizer } from '@syncfusion/ej2-pdfviewer'; +import {L10n} from '@syncfusion/ej2-base'; +// Inject required modules +PdfViewer.Inject(TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageOrganizer); + +const pdfviewer: PdfViewer = new PdfViewer({ + documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', + resourceUrl: "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib", + locale: 'ar-AE', //Using locale updates culture + enableRtl: true, //To enbale Right to Left rendering. +}); +//Load culutre files here + L10n.load({ + 'ar-AE': { + 'PdfViewer': { + 'PdfViewer': 'قوات الدفاع الشعبي المشاهد', + 'Cancel': 'إلغاء', + 'Download file': 'تحميل الملف', + 'Download': 'تحميل', + 'Enter Password': 'هذا المستند محمي بكلمة مرور. يرجى إدخال كلمة مرور.', + 'File Corrupted': 'ملف تالف', + 'File Corrupted Content': 'الملف تالف ولا يمكن فتحه.', + 'Fit Page': 'لائق بدنيا الصفحة', + 'Fit Width': 'لائق بدنيا عرض', + 'Automatic': 'تلقائي', + 'Go To First Page': 'عرض الصفحة الأولى', + 'Invalid Password': 'كلمة سر خاطئة. حاول مرة اخرى.', + 'Next Page': 'عرض الصفحة التالية', + 'OK': 'حسنا', + 'Open': 'فتح الملف', + 'Page Number': 'رقم الصفحة الحالية', + 'Previous Page': 'عرض الصفحة السابقة', + 'Go To Last Page': 'عرض الصفحة الأخيرة', + 'Zoom': 'تكبير', + 'Zoom In': 'تكبير في', + 'Zoom Out': 'تكبير خارج', + 'Page Thumbnails': 'مصغرات الصفحة', + 'Bookmarks': 'المرجعية', + 'Print': 'اطبع الملف', + 'Password Protected': 'كلمة المرور مطلوبة', + 'Copy': 'نسخ', + 'Text Selection': 'أداة اختيار النص', + 'Panning': 'وضع عموم', + 'Text Search': 'بحث عن نص', + 'Find in document': 'ابحث في المستند', + 'Match case': 'حالة مباراة', + 'Apply': 'تطبيق', + 'GoToPage': 'انتقل إلى صفحة', + 'No Matches': 'انتهى العارض من البحث في المستند. لم يتم العثور على مزيد من التطابقات', + 'No Text Found': 'لم يتم العثور على نص', + 'Undo': 'فك', + 'Redo': 'فعل ثانية', + 'Annotation': 'إضافة أو تعديل التعليقات التوضيحية', + 'Highlight': 'تسليط الضوء على النص', + 'Underline': 'تسطير النص', + 'Strikethrough': 'نص يتوسطه خط', + 'Delete': 'حذف التعليق التوضيحي', + 'Opacity': 'غموض', + 'Color edit': 'غير اللون', + 'Opacity edit': 'تغيير التعتيم', + 'highlight': 'تسليط الضوء', + 'underline': 'أكد', + 'strikethrough': 'يتوسطه', + // tslint:disable-next-line:max-line-length + 'Server error': 'خدمة الانترنت لا يستمع. يعتمد قوات الدفاع الشعبي المشاهد على خدمة الويب لجميع ميزاته. يرجى بدء خدمة الويب للمتابعة.', + 'Open text': 'افتح', + 'First text': 'الصفحة الأولى', + 'Previous text': 'الصفحة السابقة', + 'Next text': 'الصفحة التالية', + 'Last text': 'آخر صفحة', + 'Zoom in text': 'تكبير', + 'Zoom out text': 'تصغير', + 'Selection text': 'اختيار', + 'Pan text': 'مقلاة', + 'Print text': 'طباعة', + 'Search text': 'بحث', + 'Annotation Edit text': 'تحرير التعليق التوضيحي', + 'Line Thickness': 'سمك الخط', + 'Line Properties': 'خط الخصائص', + 'Start Arrow': 'ابدأ السهم', + 'End Arrow': 'نهاية السهم', + 'Line Style': 'أسلوب الخط', + 'Fill Color': 'ملء اللون', + 'Line Color': ' الخط اللون', + 'None': 'لا شيء', + 'Open Arrow': 'افتح', + 'Closed Arrow': 'مغلق', + 'Round Arrow': 'مستدير', + 'Square Arrow': 'مربع', + 'Diamond Arrow': 'الماس', + 'Cut': 'يقطع', + 'Paste': 'معجون', + 'Delete Context': 'حذف', + 'Properties': 'الخصائص', + 'Add Stamp': 'إضافة الطوابع', + 'Add Shapes': 'أضف الأشكال', + 'Stroke edit': 'تغيير لون السكتة الدماغية', + 'Change thickness': 'تغيير سمك الحدود', + 'Add line': 'إضافة خط', + 'Add arrow': 'سهم إضافة', + 'Add rectangle': 'أضف مستطيل', + 'Add circle': 'إضافة دائرة', + 'Add polygon': 'أضف مضلع', + 'Add Comments': 'أضف تعليقات', + 'Comments': 'تعليقات', + 'No Comments Yet': 'لا توجد تعليقات حتى الآن', + 'Accepted': 'وافقت', + 'Completed': 'منجز', + 'Cancelled': 'ألغيت', + 'Rejected': 'مرفوض', + 'Leader Length': 'زعيم الطول', + 'Scale Ratio': 'نسبة مقياس', + 'Calibrate': 'عاير', + 'Calibrate Distance': 'معايرة المسافة', + 'Calibrate Perimeter': 'معايرة محيط', + 'Calibrate Area': 'عاير منطقة', + 'Calibrate Radius': 'معايرة نصف القطر', + 'Calibrate Volume': 'معايرة الحجم', + 'Depth': 'عمق', + 'Closed': 'مغلق', + 'Round': 'مستدير', + 'Square': 'ميدان', + 'Diamond': 'الماس', + 'Edit': 'تصحيح', + 'Comment': 'تعليقات', + 'Comment Panel': 'لوحة التعليقات', + 'Set Status': 'تعيين الحالة', + 'Post': 'بريد', + 'Page': 'صفحة', + 'Add a comment': 'أضف تعليق', + 'Add a reply': 'أضف رد', + 'Import Annotations': 'استيراد التعليقات التوضيحية', + 'Export Annotations': 'شروح التصدير', + 'Add': 'أضف', + 'Clear': 'واضح', + 'Bold': 'بالخط العريض', + 'Italic': 'مائل', + 'Strikethroughs': 'يتوسطه', + 'Underlines': 'تحت الخط', + 'Superscript': 'حرف فوقي', + 'Subscript': 'الفرعية النصي', + 'Align left': 'محاذاة اليسار', + 'Align right': 'محاذاة اليمين', + 'Center': 'مركز', + 'Justify': 'برر', + 'Font color': 'لون الخط', + 'Text Align': 'محاذاة النص', + 'Text Properties': 'نوع الخط', + 'Draw Signature': 'ارسم التوقيع', + 'Create': 'خلق', + 'Font family': 'خط العائلة', + 'Font size': 'حجم الخط', + 'Free Text': 'نص حر', + 'Import Failed': 'نوع ملف سلمان أو اسم الملف غير صالح ؛ يرجى تحديد ملف سلمانصالح', + 'File not found': 'لم يتم العثور على ملف سلمان المستورد في الموقع المطلوب', + 'Export Failed': 'شل إجراء تصدير التعليقات التوضيحية ؛ يرجى التأكد من إضافة التعليقات التوضيحية بشكل صحيح', + 'Dynamic': 'متحرك', + 'Standard Business': 'الأعمال القياسية', + 'Sign Here': 'وقع هنا', + 'Custom Stamp': 'ختم مخصص', + 'InitialFieldDialogHeaderText': 'إضافة الأولية', + 'HandwrittenInitialDialogHeaderText': 'إضافة الأولية', + 'SignatureFieldDialogHeaderText': 'أضف التوقيع', + 'HandwrittenSignatureDialogHeaderText': 'أضف التوقيع', + 'Draw-hand Signature': 'يرسم', + 'Type Signature': 'نوع', + 'Upload Signature': 'تحميل', + 'Browse Signature Image': 'تصفح', + 'Save Signature': 'احفظ التوقيع', + 'Save Initial': 'حفظ الأولي', + 'Highlight context': 'تسليط الضوء', + 'Underline context': 'تسطير', + 'Strikethrough context': 'يتوسطه خط', + 'FormDesigner': 'إضافة وتحرير حقل النموذج', + 'SubmitForm': 'تقديم النموذج', + 'Search Text': 'بحث', + 'Draw Ink': 'ارسم الحبر', + 'Revised': 'مراجعة', + 'Reviewed': 'تمت المراجعة', + 'Received': 'تم الاستلام', + 'Confidential': 'مؤتمن', + 'Approved': 'وافق', + 'Not Approved': 'غير مقبول', + 'Witness': 'الشاهد', + 'Initial Here': 'المبدئي هنا', + 'Draft': 'مشروع', + 'Final': 'أخير', + 'For Public Release': 'للنشر العام', + 'Not For Public Release': 'ليس للنشر العام', + 'For Comment': 'للتعليق', + 'Void': 'فارغ', + 'Preliminary Results': 'نتائج اولية', + 'Information Only': 'المعلومات فقط', + 'Enter Signature as Name': 'أدخل أسمك', + 'Textbox': 'مربع الكتابة', + 'Password': 'كلمه السر', + 'Check Box': 'خانة اختيار', + 'Radio Button': 'زر الراديو', + 'Dropdown': 'اسقاط', + 'List Box': 'مربع القائمة', + 'Signature': 'إمضاء', + 'Delete FormField': 'حذف حقل النموذج', + 'FormDesigner Edit text': 'إضافة وتحرير حقل النموذج', + 'in': 'في', + 'm': 'م', + 'ft_in': 'قدم', + 'ft': 'قدم', + 'p': 'ص', + 'cm': 'سم', + 'mm': 'مم', + 'pt': 'نقطة', + 'cu': 'مكعب', + 'sq': 'قدم مربع', + 'General': 'جنرال لواء', + 'Appearance': 'مظهر خارجي', + 'Options': 'والخيارات', + 'Textbox Properties': 'خصائص مربع النص', + 'Name': 'اسم', + 'Tooltip': 'تلميح', + 'Value': 'القيمة', + 'Form Field Visibility': 'رؤية حقل النموذج', + 'Read Only': 'يقرأ فقط', + 'Required': 'مطلوب', + 'Checked': 'التحقق', + 'Show Printing': 'عرض الطباعة', + 'Formatting': 'صيغة', + 'Fill': 'يملأ', + 'Border': 'الحدود', + 'Border Color': 'لون الحدود', + 'Thickness': 'السماكة', + 'Max Length': 'الحد الاقصى للطول', + 'List Item': 'اسم العنصر', + 'Export Value': 'قيمة البند', + 'Dropdown Item List': 'قائمة العناصر المنسدلة', + 'List Box Item List': 'قائمة عناصر مربع القائمة', + 'Delete Item': 'حذف', + 'Up': 'فوق', + 'Down': 'تحت', + 'Multiline': 'متعدد الأسطر', + 'Initial': 'أولي', + 'Export XFDF': 'تصدير التعليق التوضيحي إلى ملف XFDF', + 'Import XFDF': 'استيراد التعليقات التوضيحية من ملف XFDF', + 'Organize Pages': 'تنظيم الصفحات', + 'Insert Right': 'أدخل الحق', + 'Insert Left': 'أدخل اليسار', + 'Total': 'المجموع', + 'Pages': 'الصفحات', + 'Rotate Right': 'تدوير لليمين', + 'Rotate Left': 'استدر يسارا', + 'Delete Page': 'حذف الصفحة', + 'Delete Pages': 'حذف الصفحات', + 'Copy Page': 'انسخ الصفحة', + 'Copy Pages': 'نسخ الصفحات', + 'Save': 'يحفظ', + 'Save As': 'حفظ باسم', + 'Select All': 'اختر الكل', + 'Import Document': 'استيراد المستند', + 'Match any word': 'تطابق أي كلمة', + 'Client error': 'تم العثور على خطأ في جانب العميل. يرجى التحقق من رؤوس Ajax المخصصة في خاصية AjaxRequestSettings وطرق الويب في خاصية ServerActionSettings', + 'Cors policy error': 'تعذر استرداد المستند بسبب عنوان URL غير صالح أو قيود على الوصول. يرجى التحقق من عنوان URL للمستند والمحاولة مرة أخرى', + 'No More Matches': 'انتهى العارض من البحث في المستند. لم يتم العثور على تطابقات أخرى', + 'No Search Matches': 'لم يتم العثور على تطابقات', + 'No More Search Matches': 'لم يتم العثور على تطابقات أخرى', + 'Exact Matches': 'تطابقات دقيقة', + 'Total Matches': 'إجمالي التطابقات' + + } + } + }); +pdfviewer.appendTo('#PdfViewer'); + diff --git a/Localization/src/index.html b/Localization/src/index.html new file mode 100644 index 0000000..5d1a94b --- /dev/null +++ b/Localization/src/index.html @@ -0,0 +1,19 @@ + + + + + Essential JS 2 + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/Localization/src/resources/favicon.ico b/Localization/src/resources/favicon.ico new file mode 100644 index 0000000..d8d5c15 Binary files /dev/null and b/Localization/src/resources/favicon.ico differ diff --git a/Localization/src/styles/styles.css b/Localization/src/styles/styles.css new file mode 100644 index 0000000..c5d413e --- /dev/null +++ b/Localization/src/styles/styles.css @@ -0,0 +1,9 @@ +@import '../../node_modules/@syncfusion/ej2-base/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-buttons/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-dropdowns/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-inputs/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-navigations/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-popups/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css'; +@import "../../node_modules/@syncfusion/ej2-pdfviewer/styles/material.css"; +@import "../../node_modules/@syncfusion/ej2-notifications/styles/material.css"; \ No newline at end of file diff --git a/Localization/tsconfig.json b/Localization/tsconfig.json new file mode 100644 index 0000000..db9b7c2 --- /dev/null +++ b/Localization/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es2016", + "module": "ES6", + "sourceMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "moduleResolution": "node" + } +} diff --git a/Localization/webpack.config.js b/Localization/webpack.config.js new file mode 100644 index 0000000..f61e596 --- /dev/null +++ b/Localization/webpack.config.js @@ -0,0 +1,41 @@ +const HtmlWebpackPlugin = require("html-webpack-plugin"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const path = require('path'); + +module.exports = { + entry: ['./src/app/app.ts', './src/styles/styles.css'], + module: { + rules: [ + { + test: /\.ts?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /\.css$/, + use: [ MiniCssExtractPlugin.loader, "css-loader" ] + }, + ], + }, + resolve: { + extensions: ['.ts', '.js'], + }, + output: { + filename: 'bundle.js', + path: path.resolve(__dirname, 'dist'), + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'src/index.html' + }), + new MiniCssExtractPlugin({ + filename: "bundle.css" + }) + ], + devServer: { + static: path.join(__dirname, "dist"), + compress: true, + port: 4000, + open: true + }, +};