The modern mode, "use strict" - #15
Conversation
szcsl
left a comment
There was a problem hiding this comment.
Hi @justizumi!
Thanks for the PR! I appreciate your contribution, but unfortunately, the hungarian translation is awkward on occassions and this can hinder understanding for newbies.
I am happy to help make it sound more natural, although it will require a bit of a rewrite -- but the PR and the contribution would still be yours. :)
May I comment your PRs?
|
Dear @szcsl Thank you for reviewing my pull request! I also noticed, that my translation may not be as good as it should be, but I would be more than happy, if you could help me improve it! So please feel free to comment my PR's! Tips on how to be better at translating in the first place are appreciated too :) |
There was a problem hiding this comment.
Apologies for commenting a lot. I tried to honor the initial translation as much as possible, but I have a strong preference for reducing unnecessary constructs. But again, many thanks for taking your time!
I put the whole replacement text in the comment for each line, where applicable. Feel free to ask if in doubt. I'll setup a more convenient communaction channel soon, to ease the conversation.
I could have merged it and update it myself, but I don't want to hijack your contribution. If you prefer, I can simply merge and update the other PR and any future PRs -- but I think it's fair, to have it merged as your PR. :)
My general guidelines for translations are:
- Think about the point of the original text and try to convey the same message in your own words as clearly and succintly as possible. You don't have to stick with the structure and phrasing of the original text if that would be more verbose or just awkward.
- A nice summary of general guidelines: https://www.accelingo.com/technical-translation-best-practices/
| @@ -1,89 +1,89 @@ | |||
| # The modern mode, "use strict" | |||
| # A modern mode, "use strict" | |||
There was a problem hiding this comment.
Modern ΓΌzemmΓ³d, "use strict"
| # A modern mode, "use strict" | ||
|
|
||
| For a long time, JavaScript evolved without compatibility issues. New features were added to the language while old functionality didn't change. | ||
| Egy hosszΓΊ ideig a JavaScript kompatibilitΓ‘si hibΓ‘k nΓ©lkΓΌl fejlΕdΓΆtt. Γj funkciΓ³k gyakran jelentek meg, Γ‘m a rΓ©giek viszont sosem vΓ‘ltoztak. |
There was a problem hiding this comment.
A JavaScript hosszΓΊ ideig kompatibilitΓ‘si nehΓ©zsΓ©gek nΓ©lkΓΌl fejlΕdΓΆtt. A nyelv ΓΊj elemekkel bΕvΓΌlt, a meglΓ©vΕek pedig vΓ‘ltozatlanok voltak.
| Egy hosszΓΊ ideig a JavaScript kompatibilitΓ‘si hibΓ‘k nΓ©lkΓΌl fejlΕdΓΆtt. Γj funkciΓ³k gyakran jelentek meg, Γ‘m a rΓ©giek viszont sosem vΓ‘ltoztak. | ||
|
|
||
| That had the benefit of never breaking existing code. But the downside was that any mistake or an imperfect decision made by JavaScript's creators got stuck in the language forever. | ||
| Ennek nagy elΕnye volt, hogy a kΓ³dot bΓ‘rmikor is ΓrtΓ‘k mindig helytΓ‘llΓ³ maradt, Γ‘m viszont azzal hogy a rΓ©gi dolgok sosem vΓ‘ltoztak azzal az a nagy baj, hogy bΓ‘rmilyen imperfekciΓ³t is ejtettek a JavaScript kΓ©szΓtΕi, az ΓΆrΓΆkre a nyelvben ragadt. |
There was a problem hiding this comment.
A nyelv ΓΊjabb verziΓ³i Γgy kompatibilisek maradtak a korΓ‘bban Γrt programokkal, cserΓ©be viszont egyΓΌtt kellett Γ©lni a nyelv tervezΓ©sekor hozott rossz dΓΆntΓ©sekkel.
|
|
||
| This was the case until 2009 when ECMAScript 5 (ES5) appeared. It added new features to the language and modified some of the existing ones. To keep the old code working, most such modifications are off by default. You need to explicitly enable them with a special directive: `"use strict"`. | ||
| Ez volt a helyzet, mΓg 2009-ben meg nem jelent az ECMAScript 5 (ES5). Az ES5 sok ΓΊj funkciΓ³t hozott a JS-be Γ©s sok rΓ©git is megvΓ‘ltoztatott. Ahoz hogy a rΓ©gi kΓ³d tovΓ‘bbΓ‘ is mΕ±kΓΆdΕkΓ©pes maradhasson, ezeknek a vΓ‘ltoztatΓ‘soknak nagy rΓ©szΓ©t alapbΓ³l kikapcsoltΓ‘k. Ezeket a funciΓ³kat egy kΓΌlΓΆnleges diretΓvΓ‘val kapcsolhatjuk be, a `"use strict"`-el. | ||
|
|
There was a problem hiding this comment.
Ez volt a tΓ©nyΓ‘llΓ‘s, mΓgnem 2009-ben megjelent az ECMAScript 5 (ES5), amely nem csak bΕvΓtette a nyelvet, hanem nΓ©hol meg is vΓ‘ltoztatta a mΕ±kΓΆdΓ©sΓ©t. Annak Γ©rdekΓ©ben, hogy ezek a vΓ‘ltozΓ‘sok ne okozzanak gondot a rΓ©gebben Γrt programokban, e vΓ‘ltoztatΓ‘sok alapΓ©rtelmezetten ki vannak kapcsolva, az engedΓ©lyezΓ©sΓΌkhΓΆz pedig egy speciΓ‘lis "use strict" diektΓvΓ‘t kell elhelyezni a kΓ³dban.
| ## "use strict" | ||
|
|
||
| The directive looks like a string: `"use strict"` or `'use strict'`. When it is located at the top of a script, the whole script works the "modern" way. | ||
| Ez a direktΓva pontosan ΓΊgy nΓ©z ki mint egy Γ‘tlagos szΓΆveg (string) objektum: `"use strict"`, vagy `'use strict'`. Mikor ezt a direktΓvΓ‘t a szkript tetejΓ©re hejezed, akkor az a szkriptet arra utasΓtja, hogy a "modern mΓ³don" mΕ±kΓΆdjΓΆn. |
There was a problem hiding this comment.
Ez a direktΓva rΓ‘nΓ©zΓ©sre egy Γ‘tlagos szΓΆveg (string): "use strict", vagy 'use strict'. A szkript tetejΓ©re helyezve azonban arra utasΓtja a JS motort, hogy a szkriptet modern ΓΌzemmΓ³dban futtassa.
| Ez a kΓ©rdΓ©s, mΓg elΕszΓΆr elΓ©ggΓ© egyΓ©rtelmΕ±nek hangzik, a valΓ³sΓ‘gban nem az. | ||
|
|
||
| One could recommend to start scripts with `"use strict"`... But you know what's cool? | ||
| Ugye, egyesek azt ajΓ‘nlanΓ‘k, hogy hasznΓ‘ld elΕszeretettel a `"use strict"`-et ...De tudod mi itt a menΕ dolog? |
There was a problem hiding this comment.
Okkal gondolhatnΓ‘nk, hogy mindig Γ©rdemes hasznΓ‘lni a "use strict"-et, de erre nincs szΓΌksΓ©g.
| Ugye, egyesek azt ajΓ‘nlanΓ‘k, hogy hasznΓ‘ld elΕszeretettel a `"use strict"`-et ...De tudod mi itt a menΕ dolog? | ||
|
|
||
| Modern JavaScript supports "classes" and "modules" - advanced language structures (we'll surely get to them), that enable `use strict` automatically. So we don't need to add the `"use strict"` directive, if we use them. | ||
| A modern JavaScript tΓ‘mogat olyanokat mint pΓ©ldΓ‘ul a "class"-ek Γ©s a "module"-ok (majd azokat is tanulni fogjuk), amik automatikusan engedΓ©lyezik a `"use strict"`-et. TehΓ‘t ha ilyenek vannak a kΓ³dunkban, a `"use strict"`-et nyugodtan nΓ©lkΓΌlΓΆzhetjΓΌk. |
There was a problem hiding this comment.
A modern JavaScript egyes nyelvi elemei, mint az osztΓ‘ly (class) Γ©s a modul (module) - ezeket kΓ©sΕbb rΓ©szletezzΓΌk - alapΓ©rtelmezetten strict ΓΌzemmΓ³dban futnak, Γgy ezeknek a nyelvi elemeknek a hasznΓ‘latakor a "use strict" elhagyhatΓ³.
| A modern JavaScript tΓ‘mogat olyanokat mint pΓ©ldΓ‘ul a "class"-ek Γ©s a "module"-ok (majd azokat is tanulni fogjuk), amik automatikusan engedΓ©lyezik a `"use strict"`-et. TehΓ‘t ha ilyenek vannak a kΓ³dunkban, a `"use strict"`-et nyugodtan nΓ©lkΓΌlΓΆzhetjΓΌk. | ||
|
|
||
| **So, for now `"use strict";` is a welcome guest at the top of your scripts. Later, when your code is all in classes and modules, you may omit it.** | ||
| **TehΓ‘t egyelΕre a `"use strict";` az csak egy kis extra a szkriptjeink elejΓ©n. KΓ©sΕbb, amikor a kΓ³dunk tele lesz modulokkal Γ©s classokkal, mΓ‘r nyugodtan kihagyhatjuk a `"use strict"`-et.** |
There was a problem hiding this comment.
EgyelΕre jΓ³, ha hasznΓ‘ljuk a "use strict"-et, de kΓ©sΕbb, amikor a kΓ³dunk modulokbΓ³l Γ©s osztΓ‘lyokbΓ³l Γ‘ll, elhagyhatjuk.
| A kΓΆvetkezΕ fejezetekben tanulunk majd egy kicsit a nyelvi funckiΓ³krΓ³l Γ©s az ΓΊj Γ©s rΓ©gi mΓ³dok kΓΆzti kΓΌlΓΆnbsΓ©gekrΕl. SzerencsΓ©nkre az utΓ³bbiakbΓ³l nincsen sok, Γ©s azok amik vannak azok is csak a mi dolgunkat fogjΓ‘k kΓΆnnyΓteni. | ||
|
|
||
| All examples in this tutorial assume strict mode unless (very rarely) specified otherwise. | ||
| Az ebben a fejezetben lΓ©vΕ pΓ©ldΓ‘k mind elvΓ‘rjΓ‘k a "strict mode" hasznΓ‘latΓ‘t, hacsak ennek az Γ‘llΓtΓ‘snak hamissΓ‘gΓ‘t nem fejeztΓΌk ki elΕre. |
There was a problem hiding this comment.
Az ebben a fejezetben lΓ©vΕ pΓ©ldΓ‘k, ha nincs mΓ‘skΓ©nt feltΓΌntetve, strict ΓΌzemmΓ³dot feltΓ©teleznek.
| Ez a legtΓΆbb bΓΆngΓ©szΕben (mint pΓ©ldΓ‘ul a Chrome vagy a Firefox) mΕ±kΓΆdik. | ||
|
|
||
| If it doesn't, e.g. in an old browser, there's an ugly, but reliable way to ensure `use strict`. Put it inside this kind of wrapper: | ||
| Ha esetleg mΓ©gse (pΓ©ldΓ‘ul egy rΓ©gi bΓΆngΓ©szΕben), akkor van egy csΓΊnya, de megbΓzhatΓ³ megoldΓ‘s a `use strict` hasznΓ‘latΓ‘ra. Egy ilyesmi kΓ³d blokkra lesz szΓΌksΓ©gΓΌnk: |
There was a problem hiding this comment.
Ha ez nem mΕ±kΓΆdne (pΓ©ldΓ‘ul rΓ©gi bΓΆngΓ©szΕben), akkor egy megbΓzhatΓ³ megoldΓ‘s az alΓ‘bbi konstrukciΓ³ hasznΓ‘lata:
|
Please make the requested changes. After it, add a comment "/done". |
|
/done |
szcsl
left a comment
There was a problem hiding this comment.
Thanks for following through! :) I will review the other PR soon.
|
Thank you π I updated the Progress Issue #1 π π π |
No description provided.