Skip to content

Commit 55ba3c6

Browse files
committed
Add more Bulgarian translate about functions, types and conditional evaluations
1 parent dc56498 commit 55ba3c6

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

translations/bg_BG/readme.md

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -392,66 +392,67 @@
392392
// на изпълненото фунционално извикване и думата "function"
393393
});
394394
395-
// Function accepting an array, no space
395+
// Функция приемаща масив като параметър, без интервал
396396
foo([ "alpha", "beta" ]);
397397
398398
// 2.C.1.2
399-
// Function accepting an object, no space
399+
// Функция приемаща обект като параметър, без интервал
400400
foo({
401401
a: "alpha",
402402
b: "beta"
403403
});
404404
405-
// Single argument string literal, no space
405+
// Единичен низ като параметър, също без интервал
406406
foo("bar");
407407
408-
// Expression parens, no space
408+
// Вътрешни скоби, също без интервал
409409
if ( !("foo" in obj) ) {
410410
obj = (obj.bar || defaults).baz;
411411
}
412412
413413
```
414414

415-
D. Consistency Always Wins
415+
D. Консистентността винаги побеждава
416416

417-
In sections 2.A-2.C, the whitespace rules are set forth as a recommendation with a simpler, higher purpose: consistency.
418-
It's important to note that formatting preferences, such as "inner whitespace" should be considered optional, but only one style should exist across the entire source of your project.
417+
В секции 2.A-2.C, правилата за интервали са изложени като препоръка с по-проста и по-извисена цел: консистентност.
418+
Важно е да се отбележи, че предпочитанията за форматиране, такива като "вътрешно пространстро", трябва да се считат за незадължителни, но само един стил трябва да съществува из целия код на вашия проект.
419419

420420
```javascript
421421
422422
// 2.D.1.1
423423
424424
if (condition) {
425-
// statements
425+
// изрази
426426
}
427427
428428
while (condition) {
429-
// statements
429+
// изрази
430430
}
431431
432432
for (var i = 0; i < 100; i++) {
433-
// statements
433+
// изрази
434434
}
435435
436436
if (true) {
437-
// statements
437+
// изрази
438438
} else {
439-
// statements
439+
// изрази
440440
}
441441
442442
```
443443

444-
E. Quotes
444+
E. Кавички
445+
446+
Независимо от това дали предпочитате единични или двойни кавички, няма разлика в това как JavaScript ги парсва. Това което **АБСОЛЮТНО ТРЯБВА** да се наложи е консистентност. **Никога не смесвайте кавичките в един и същи проект. Изберете един стил и се придържайте към него.**
445447

446-
Whether you prefer single or double shouldn't matter, there is no difference in how JavaScript parses them. What **ABSOLUTELY MUST** be enforced is consistency. **Never mix quotes in the same project. Pick one style and stick with it.**
448+
F. Край на Редовете и Празни Редове
447449

448-
F. End of Lines and Empty Lines
450+
Пространствата могат да развалят разликите да направят промените невъзможни за четене. Помислете да включите "pre-commit" кука, която да премахне автоматично пространството на края на реда и празните пространства на редовете.
449451

450-
Whitespace can ruin diffs and make changesets impossible to read. Consider incorporating a pre-commit hook that removes end-of-line whitespace and blanks spaces on empty lines automatically.
451452

452453
3. <a name="type">Type Checking (Courtesy jQuery Core Style Guidelines)</a>
453454

454-
A. Actual Types
455+
A. Типове
455456

456457
String:
457458

@@ -488,25 +489,25 @@
488489

489490
undefined:
490491

491-
Global Variables:
492+
Глобални променливи:
492493

493494
typeof variable === "undefined"
494495

495-
Local Variables:
496+
Локални променливи:
496497

497498
variable === undefined
498499

499-
Properties:
500+
Свойства:
500501

501502
object.prop === undefined
502503
object.hasOwnProperty( prop )
503504
"prop" in object
504505

505-
B. Coerced Types
506+
B. Прехвърляне на Типове
506507

507-
Consider the implications of the following...
508+
Представете си следното...
508509

509-
Given this HTML:
510+
Даден ви е следния HTML:
510511

511512
```html
512513
@@ -519,36 +520,34 @@
519520
520521
// 3.B.1.1
521522
522-
// `foo` has been declared with the value `0` and its type is `number`
523+
// `foo` е деклариран със стойност `0` и неговия тип е `number`
523524
var foo = 0;
524525
525526
// typeof foo;
526527
// "number"
527528
...
528529
529-
// Somewhere later in your code, you need to update `foo`
530-
// with a new value derived from an input element
530+
// Някъде по-късно във вашия код, трябва да обновите `foo`
531+
// с ново стойност взета от елемента 'input'
531532
532533
foo = document.getElementById("foo-input").value;
533534
534-
// If you were to test `typeof foo` now, the result would be `string`
535-
// This means that if you had logic that tested `foo` like:
536-
535+
// Ако сега тествате 'typeof foo`, резултатът ще бъде 'string'
536+
// Това означава, че ако имате локига която тества 'foo' като тази:
537537
if ( foo === 1 ) {
538538

539539
importantTask();
540540

541541
}
542542

543-
// `importantTask()` would never be evaluated, even though `foo` has a value of "1"
544-
543+
// `importantTask()` няма никога да бъде достигнат дори и `foo` да има стойност "1"
545544

546545
// 3.B.1.2
547546

548-
// You can preempt issues by using smart coercion with unary + or - operators:
547+
// Можете да избегнете проблеми като използвате умно конрвертиране в унарните оператори + и -:
549548

550549
foo = +document.getElementById("foo-input").value;
551-
// ^ unary + operator will convert its right side operand to a number
550+
// ^ унарния + ще преобразува десния си операнд в тип 'number'
552551

553552
// typeof foo;
554553
// "number"
@@ -559,7 +558,7 @@
559558

560559
}
561560

562-
// `importantTask()` will be called
561+
// `importantTask()` ще бъде извикана
563562
```
564563

565564
Here are some common cases along with coercions:
@@ -648,9 +647,9 @@
648647
!!~array.indexOf("d");
649648
// false
650649
651-
// Note that the above should be considered "unnecessarily clever"
652-
// Prefer the obvious approach of comparing the returned value of
653-
// indexOf, like:
650+
// Забележете, че горните примери може да се считат за "ненужно умни"
651+
// За предпочитане е очевидния подход да сравнявате върнатата стойност на
652+
// indexOf, по този начин:
654653
655654
if ( array.indexOf( "a" ) >= 0 ) {
656655
// ...
@@ -665,7 +664,7 @@
665664
666665
parseInt( num, 10 );
667666
668-
// is the same as...
667+
// е съшото като ...
669668
670669
~~num;
671670
@@ -676,24 +675,24 @@
676675
// All result in 2
677676
678677
679-
// Keep in mind however, that negative numbers will be treated differently...
678+
// Помнете, че отрицателните числа ще бъдат обработени различно ...
680679
681680
var neg = -2.5;
682681
683682
parseInt( neg, 10 );
684683
685-
// is the same as...
684+
// е същото като...
686685
687686
~~neg;
688687
689688
neg >> 0;
690689
691-
// All result in -2
692-
// However...
690+
// Всичко са равни на -2
691+
// Въпреки че при...
693692
694693
neg >>> 0;
695694
696-
// Will result in 4294967294
695+
// Резултата ще е 4294967294
697696
698697
699698
@@ -702,61 +701,62 @@
702701

703702

704703

705-
4. <a name="cond">Conditional Evaluation</a>
704+
4. <a name="cond">Условна Проверка</a>
706705

707706
```javascript
708707
709708
// 4.1.1
710-
// When only evaluating that an array has length,
711-
// instead of this:
709+
// Проверете дали масивът има дължина,
710+
// вместо:
712711
if ( array.length > 0 ) ...
713712
714-
// ...evaluate truthiness, like this:
713+
// ...проверявайте за истина, по този начин:
715714
if ( array.length ) ...
716715
717716
718717
// 4.1.2
719-
// When only evaluating that an array is empty,
720-
// instead of this:
718+
// Проверете дали масива е празен,
719+
// вместо:
721720
if ( array.length === 0 ) ...
722721
723-
// ...evaluate truthiness, like this:
722+
// ...проверявайте за вярност, по този начин:
724723
if ( !array.length ) ...
725724
726725
727726
// 4.1.3
728-
// When only evaluating that a string is not empty,
729-
// instead of this:
727+
// Проверете дали низа не е празен,
728+
// вместо:
729+
730730
if ( string !== "" ) ...
731731
732-
// ...evaluate truthiness, like this:
732+
// ...проверявайте за вярност, по този начин:
733733
if ( string ) ...
734734
735735
736736
// 4.1.4
737-
// When only evaluating that a string _is_ empty,
738-
// instead of this:
737+
// Проверете дали низа _е_ празен,
738+
// вместо:
739739
if ( string === "" ) ...
740740
741-
// ...evaluate falsy-ness, like this:
741+
// ...проверявайте дали израдът е неверен, по този начин:
742742
if ( !string ) ...
743743
744744
745745
// 4.1.5
746-
// When only evaluating that a reference is true,
747-
// instead of this:
746+
// Проверете дали тази референция е вярна,
747+
// вместо:
748748
if ( foo === true ) ...
749749
750-
// ...evaluate like you mean it, take advantage of built in capabilities:
750+
// ...проверявайте, възползвайки се от вградените възможности:
751751
if ( foo ) ...
752752
753753
754754
// 4.1.6
755-
// When evaluating that a reference is false,
756-
// instead of this:
755+
// Проверете дали тази референция е невярна,
756+
// вместо:
757757
if ( foo === false ) ...
758758
759-
// ...use negation to coerce a true evaluation
759+
// ...проверете, използвайки отрицание
760760
if ( !foo ) ...
761761
762762
// ...Be careful, this will also match: 0, "", null, undefined, NaN

0 commit comments

Comments
 (0)