Skip to content

Commit a5b2250

Browse files
authored
Merge pull request #65 from uguratar/master
Namespaces çevirisi
2 parents 5f14337 + 0c4faa6 commit a5b2250

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

GLOSSARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ Fakat bazı terimlerin Türkçe çevrimi, cümleyi anlamsız bir hale getirebilm
2525
| Optional | İsteğe bağlı |
2626
| Type | Tip |
2727
| Engine | Motor |
28-
28+
| Namespace | Aduzayı |
2929
# Terim açıklamaları
3030
* Duck Typing: Eğer bir ördek gibi yürüyor ve bir ördek gibi "vak"lıyorsa, o zaman bu bir ördektir. Bir nesne yapısal olarak tüm üyelere sahipse, diğer şeylerin de (ne olduğu önemli değil) var olduğu kabul edilir.

docs/project/namespaces.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
## Namespaces
2-
Namespaces provide you with a convenient syntax around a common pattern used in JavaScript:
1+
## Aduzayları (Namespaces)
2+
Aduzayları, JavaScript'te kullanılan yaygın bir kalıp için uygun sözdizimi sağlar:
33

44
```ts
55
(function(something) {
@@ -8,8 +8,9 @@ Namespaces provide you with a convenient syntax around a common pattern used in
88

99
})(something || something = {})
1010
```
11+
Basit olarak anlatmak gerekirse `something || something = {}` ifadesi, anonim fonksiyonun *varolan bir nesneye eklenti yapmasını* (`something ||` kısmı) veya *yeni bir obje yaratarak yaratılan bu yeni objeye eklenti yapılmasına* (`|| something = {}` kısmı) imkan tanır.
12+
Bunun anlamı şudur, bir çalıştırma sınırıyla ayrılmış iki farklı kod bloğuna sahip olabilirsiniz:
1113

12-
Basically `something || something = {}` allows an anonymous function `function(something) {}` to *add stuff to an existing object* (the `something ||` portion) or *start a new object then add stuff to that object* (the `|| something = {}` portion). This means that you can have two such blocks split by some execution boundary :
1314

1415
```ts
1516
(function(something) {
@@ -29,8 +30,7 @@ console.log(something); // {foo:123}
2930
console.log(something); // {foo:123, bar:456}
3031

3132
```
32-
33-
This is commonly used in the JavaScript land for making sure that stuff doesn't leak into the global namespace. With file based modules you don't need to worry about this, but the pattern is still useful for *logical grouping* of a bunch of functions. Therefore TypeScript provides the `namespace` keyword to group these e.g.
33+
Javascript'te bunun en yaygın kullanım amacı global(küresel) aduzayına bilgi sızmasını önlemektir. Dosya tabanlı modüller kullanıldığında bu konu hakkında endişe etmenize gerek olmamakla birlikte, bu kalıp fonksiyonlarınızı *mantıksal olarak gruplamak* için oldukça kullanışlıdır. Bu tip gruplamaları yapabilmeniz için TypeScript `namespace` anahtar kelimesini sunmaktadır. Ör:
3434

3535
```ts
3636
namespace Utility {
@@ -46,7 +46,7 @@ namespace Utility {
4646
Utility.log('Call me');
4747
Utility.error('maybe!');
4848
```
49-
The `namespace` keyword generates the same JavaScript that we saw earlier:
49+
`namespace` anahtar kelimesi ilk bölümde gördüğümüz JavaScript kodunun aynısını üretmektedir.
5050

5151
```ts
5252
(function (Utility) {
@@ -55,7 +55,6 @@ The `namespace` keyword generates the same JavaScript that we saw earlier:
5555

5656
})(Utility || (Utility = {}));
5757
```
58+
Bir diğer nokta ise, aduzaylarının iç içe geçebiliyor olmalarıdır, bu sayede `namespace Utility.Messaging` gibi bir ifadeyle `Messaging` aduzayını `Utility` aduzayının içerisinde tanımlamak mümkün olmaktadır.
5859

59-
One thing to note is that namespaces can be nested so you can do stuff like `namespace Utility.Messaging` to nest a `Messaging` namespace under `Utility`.
60-
61-
For most projects we recommend using external modules and using `namespace` for quick demos and porting old JavaScript code.
60+
Örnek proje oluştururken veya eski JavaScript kodunu port ederken harici modül ve `namespace` kullanılması tavsiye edilmektedir.

0 commit comments

Comments
 (0)