From 00ed6713516ba308743ce1fd35f1a25038b177af Mon Sep 17 00:00:00 2001 From: Arsen Melikyan Date: Tue, 2 Mar 2021 19:46:36 +0400 Subject: [PATCH 1/3] Translate Hello, world! article --- 1-js/02-first-steps/01-hello-world/article.md | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/1-js/02-first-steps/01-hello-world/article.md b/1-js/02-first-steps/01-hello-world/article.md index fa935f341..015dbdaab 100644 --- a/1-js/02-first-steps/01-hello-world/article.md +++ b/1-js/02-first-steps/01-hello-world/article.md @@ -1,17 +1,17 @@ # Hello, world! -This part of the tutorial is about core JavaScript, the language itself. +Ձեռնարկի այս մասը վերաբերում է բուն JavaScript լեզվին։ -But we need a working environment to run our scripts and, since this book is online, the browser is a good choice. We'll keep the amount of browser-specific commands (like `alert`) to a minimum so that you don't spend time on them if you plan to concentrate on another environment (like Node.js). We'll focus on JavaScript in the browser in the [next part](/ui) of the tutorial. +Մեզ հարկավոր է աշխատանքային միջավայր, որտեղ գործարկելու ենք մեր սկրիպտերը։ Քանի որ այս ձեռնարկը առցանց է, ապա զննիչը լավ ընտրություն է։ Զննիչներին հատուկ հրամանները (օրինակ՝ `alert`) կօգտագործենք հնարավորինս քիչ, որպեսզի դրանց վրա շատ ժամանակ չծախսեք, եթե պլանավորում եք այլ միջավայրում աշխատել (օրինակ՝ Node.js)։ Մենք կկենտրոնանանք զննիչներում JavaScript–ի աշխատանքին ձեռնարկի [հաջորդ բաժնում](/ui)։ -So first, let's see how we attach a script to a webpage. For server-side environments (like Node.js), you can execute the script with a command like `"node my.js"`. +Սկզվում տեսնենք, թե ինչպես էջին կցել որևէ սկրիպտ։ Սերվերային միջավայրերում (օրինակ՝ Node.js) սկրիպտը կարելի է գործարկել հետյալ կամ նմանատիպ հրամանով՝ `"node my.js"`։ -## The "script" tag +## «script» պիտակը (tag) -JavaScript programs can be inserted almost anywhere into an HTML document using the ` */!* -

...After the script.

+

...սկրիպտից հետո։

@@ -35,24 +35,24 @@ For instance: ``` ```online -You can run the example by clicking the "Play" button in the right-top corner of the box above. +Կարող եք գործարկել օրինակը սեղմելով «Play» կոճակը։ ``` -The ` ``` - This trick isn't used in modern JavaScript. These comments hide JavaScript code from old browsers that didn't know how to process the ` ``` -Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder. +Այստեղ, `/path/to/script.js`–ը կայքի արմատից (root) սկրիպտի բացարձակ ուղին է (absolute path)։ Կարելի է տրամադրել նաև հարաբերական ուղի տվյալ էջից։ Օրինակ՝ `src="script.js"`–ը նշանակում է, որ `"script.js"` ֆայլը գտնվում է տվյալ պանակում (folder)։ -We can give a full URL as well. For instance: +Կարելի է նաև նշել ամբողջական URL։ Օրինակ՝ ```html ``` -To attach several scripts, use multiple tags: +Մի քանի սկրիպտեր կցելու համար կարելի է օգտագործել մի քանի պիտակներ՝ ```html @@ -90,29 +90,29 @@ To attach several scripts, use multiple tags: ``` ```smart -As a rule, only the simplest scripts are put into HTML. More complex ones reside in separate files. +Սովորաբար միայն պարզ սկրիպտերն են ներդնում HTML–ում։ Առավել բարդերը տեղակայվում են առանձին ֆայլերում։ -The benefit of a separate file is that the browser will download it and store it in its [cache](https://en.wikipedia.org/wiki/Web_cache). +Առանձին ֆայլի առավելությունն այն է, որ զննիչը ներբեռնում է այն և պահում իր [cache](https://en.wikipedia.org/wiki/Web_cache)–ում։ -Other pages that reference the same script will take it from the cache instead of downloading it, so the file is actually downloaded only once. +Մյուս էջերը, որոնք հղում ունեն այդ նույն սկրիպտին, նորից ներբեռնելու փոխարեն կվերցնեն այն cache–ից։ -That reduces traffic and makes pages faster. +Սա էջերը դարձնոմ է ավելի արագ և նվազեցնում է traffic–ը։ ``` -````warn header="If `src` is set, the script content is ignored." -A single ` ``` -We must choose either an external ` @@ -122,11 +122,11 @@ The example above can be split into two scripts to work: ``` ```` -## Summary +## Ամփոփում -- We can use a ``. +- Կարող ենք օգտագործել ``։ -There is much more to learn about browser scripts and their interaction with the webpage. But let's keep in mind that this part of the tutorial is devoted to the JavaScript language, so we shouldn't distract ourselves with browser-specific implementations of it. We'll be using the browser as a way to run JavaScript, which is very convenient for online reading, but only one of many. +Այնքան բան կա սովորելու զննիչներում սկրիպտերի աշխատանքի և էջերի հետ դրանց փոխազդեցության մասին։ Հիշենք, որ ձեռնարկի այս բաժինը նվիրված է JavaScript լեզվին, այնպես որ պետք չէ ինքներս մեզ շեղենք զննիչներին հատուկ առանձնահատկություններով։ Մենք կօգտագործենք զննիչը JavaScript կոդը գործարկելու համար, ինչը հարմար է առցանց ընթերցանության համար։ From 6e5eecd2e74df07440feb8e0be8614ad0a7c110b Mon Sep 17 00:00:00 2001 From: Arsen Melikyan Date: Wed, 3 Mar 2021 01:01:16 +0400 Subject: [PATCH 2/3] Fix typos --- 1-js/02-first-steps/01-hello-world/article.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/1-js/02-first-steps/01-hello-world/article.md b/1-js/02-first-steps/01-hello-world/article.md index 015dbdaab..1ab99f22a 100644 --- a/1-js/02-first-steps/01-hello-world/article.md +++ b/1-js/02-first-steps/01-hello-world/article.md @@ -4,7 +4,7 @@ Մեզ հարկավոր է աշխատանքային միջավայր, որտեղ գործարկելու ենք մեր սկրիպտերը։ Քանի որ այս ձեռնարկը առցանց է, ապա զննիչը լավ ընտրություն է։ Զննիչներին հատուկ հրամանները (օրինակ՝ `alert`) կօգտագործենք հնարավորինս քիչ, որպեսզի դրանց վրա շատ ժամանակ չծախսեք, եթե պլանավորում եք այլ միջավայրում աշխատել (օրինակ՝ Node.js)։ Մենք կկենտրոնանանք զննիչներում JavaScript–ի աշխատանքին ձեռնարկի [հաջորդ բաժնում](/ui)։ -Սկզվում տեսնենք, թե ինչպես էջին կցել որևէ սկրիպտ։ Սերվերային միջավայրերում (օրինակ՝ Node.js) սկրիպտը կարելի է գործարկել հետյալ կամ նմանատիպ հրամանով՝ `"node my.js"`։ +Սկզբում տեսնենք, թե ինչպես էջին կցել որևէ սկրիպտ։ Սերվերային միջավայրերում (օրինակ՝ Node.js) սկրիպտը կարելի է գործարկել հետևյալ կամ նմանատիպ հրամանով՝ `"node my.js"`։ ## «script» պիտակը (tag) @@ -46,7 +46,7 @@ JavaScript ծրագրերը կարելի է ներդնել HTML փաստաթղթ ``։ -Այնքան բան կա սովորելու զննիչներում սկրիպտերի աշխատանքի և էջերի հետ դրանց փոխազդեցության մասին։ Հիշենք, որ ձեռնարկի այս բաժինը նվիրված է JavaScript լեզվին, այնպես որ պետք չէ ինքներս մեզ շեղենք զննիչներին հատուկ առանձնահատկություններով։ Մենք կօգտագործենք զննիչը JavaScript կոդը գործարկելու համար, ինչը հարմար է առցանց ընթերցանության համար։ +Այնքա՜ն բան կա սովորելու զննիչներում սկրիպտերի աշխատանքի և էջերի հետ դրանց փոխազդեցության մասին։ Հիշենք, որ ձեռնարկի այս բաժինը նվիրված է JavaScript լեզվին, այնպես որ պետք չէ ինքներս մեզ շեղենք զննիչներին հատուկ առանձնահատկություններով։ Մենք կօգտագործենք զննիչը JavaScript կոդը գործարկելու համար, ինչը հարմար է առցանց ընթերցանության համար։ From 417c495900fcf5500e4a766f9e38f33a9af53ff3 Mon Sep 17 00:00:00 2001 From: Arsen Melikyan Date: Wed, 3 Mar 2021 01:11:21 +0400 Subject: [PATCH 3/3] Translate tasks and solutions of Hello, world! article --- 1-js/02-first-steps/01-hello-world/1-hello-alert/task.md | 6 +++--- .../01-hello-world/2-hello-alert-ext/solution.md | 4 ++-- .../02-first-steps/01-hello-world/2-hello-alert-ext/task.md | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md b/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md index afed6a91d..b3650ef64 100644 --- a/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md +++ b/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md @@ -2,11 +2,11 @@ importance: 5 --- -# Show an alert +# Ցուցադրել հաղորդագրություն -Create a page that shows a message "I'm JavaScript!". +Ստեղծեք էջ, որը ցույց է տալիս «I'm JavaScript!» հաղորդագրությունը։ -Do it in a sandbox, or on your hard drive, doesn't matter, just ensure that it works. +Կարող եք անել այստեղ, կամ ձեր համակարգչում, տարբերություն չկա։ Միայն համոզվեք, որ լուծումն աշխատում է։ [demo src="solution"] diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md index f42c41e6d..50e1a0547 100644 --- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md +++ b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md @@ -1,8 +1,8 @@ -The HTML code: +HTML կոդը՝ [html src="index.html"] -For the file `alert.js` in the same folder: +`alert.js` ֆայլը՝ [js src="alert.js"] diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md index 26168d6a7..3aafb3982 100644 --- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md +++ b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md @@ -2,8 +2,8 @@ importance: 5 --- -# Show an alert with an external script +# Ցուցադրել հաղորդագրություն արտաքին սկրիպտի միջոցով -Take the solution of the previous task . Modify it by extracting the script content into an external file `alert.js`, residing in the same folder. +Վերցրեք նախորդ խնդրի լուծումը ։ Տեղափոխեք script պիտակի պարունակությունը `alert.js` ֆայլի մեջ, որը պետք է գտնվի նույն պանակում։ -Open the page, ensure that the alert works. +Բացեք էջը և համոզվեք, որ լուծումն աշխատում է։