Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Bosnian translations for tour and cheatsheet #564

Merged
merged 3 commits into from Sep 8, 2016

Conversation

Projects
None yet
4 participants
@sake92
Copy link
Contributor

commented Aug 27, 2016

Added Bosnian translations for following:

  • tutorials/tour
  • cheatsheet

Since Croatian and Serbian are very similar languages to Bosnian, they will also benefit from this, I hope. :)

@SethTisue

This comment has been minimized.

Copy link
Member

commented Aug 30, 2016

@sjrd

This comment has been minimized.

Copy link
Member

commented Aug 30, 2016

Ping @vjovanov. Maybe you can help, here?

@vjovanov

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2016

I can review this PR thoroughly in two days. From the first look it looks very well written (grammar, integration of english terms, completeness).

| <span class="label success">Dobro</span> `val x = 5`<br> <span class="label important">Loše</span> `x=6` | konstanta |
| `var x: Double = 5` | eksplicitni tip |
| <span id="functions" class="h2">funkcije</span> | |
| <span class="label success">Dobro</span> `def f(x: Int) = { x*x }`<br> <span class="label important">Loše</span> `def f(x: Int) { x*x }` | definicija funkcije <br> skrivena greška: bez = ovo je procedura koja vraća Unit; uzrokuje zabunu |

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

bez = ~> bez =

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

| `(1 to 5).map( x => x*x )` | anonimna funkcija: da bi koristili argument više od jednom, morate mu dati ime. |
| <span class="label success">Dobro</span> `(1 to 5).map(2*)`<br> <span class="label important">Loše</span> `(1 to 5).map(*2)` | anonimna funkcija: vezana infiksna metoda. Koristite `2*_` zbog jasnoće. |
| `(1 to 5).map { x => val y=x*2; println(y); y }` | anonimna funkcija: blokovski stil vraća vrijednost zadnjeg izraza. |
| `(1 to 5) filter {_%2 == 0} map {_*2}` | anonimne funkcije: pipeline stil. (može i sa oblim zagradama). |

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Dot (.) goes into parenthesis. M is uppercase at the beginning of that sentence.

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

I have changed all sentences from right column of cheatsheet to end with a dot (to be consistent). I didn't want to touch the initial formatting at first...

| `val zscore = (mean:R, sd:R) => (x:R) => (x-mean)/sd` | curry-jevanje, očita sintaksa. |
| `def zscore(mean:R, sd:R) = (x:R) => (x-mean)/sd` | curry-jevanje, očita sintaksa. |
| `def zscore(mean:R, sd:R)(x:R) = (x-mean)/sd` | curry-jevanje, sintaksni šećer(kratica). ali onda: |
| `val normer = zscore(7, 0.4) _` | je potrebna prateća donja crta za parcijalnu primjenu, samo kod šećer(skraćene) verzije. |

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

šećer(skraćene) ~> šećer (skraćene)

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

I have fixed all problems regarding missing space before parens. Thanks!

| `import java.util.{Date => _, _}` | import svega iz java.util paketa osim Date. |
| `package pkg` _na početku fajla_ <br> `package pkg { ... }` | deklaracija paketa. |
| <span id="data_structures" class="h2">strukture podataka</span> | |
| `(1,2,3)` | n-torka(tuple) literal. (`Tuple3`) |

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

torka (tuple)

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

| `package pkg` _na početku fajla_ <br> `package pkg { ... }` | deklaracija paketa. |
| <span id="data_structures" class="h2">strukture podataka</span> | |
| `(1,2,3)` | n-torka(tuple) literal. (`Tuple3`) |
| `var (x,y,z) = (1,2,3)` | destrukturirajuće vezivanje: otpakivanje n-torke podudaranjem uzorka(pattern matching). |

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

In Serbian it would be destruktivno, not sure about Bosnian.

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

I think that "destruktivno" would refer to "destroying" and not to "destructuring". We are not destroying anything with pattern matching so I left that as before.

| `import scala.util.control.Breaks._`<br>`breakable {`<br>` for (x <- xs) {`<br>` if (Math.random < 0.1) break`<br>` }`<br>`}`| break. ([slajdovi](http://www.slideshare.net/Odersky/fosdem-2009-1013261/21)) |
| `for (x <- xs if x%2 == 0) yield x*10` _isto kao_ <br>`xs.filter(_%2 == 0).map(_*10)` | for comprehension: filter/map |
| `for ((x,y) <- xs zip ys) yield x*y` _isto kao_ <br>`(xs zip ys) map { case (x,y) => x*y }` | for comprehension: destrukturirajuće vezivanje |
| `for (x <- xs; y <- ys) yield x*y` _isto kao_ <br>`xs flatMap {x => ys map {y => x*y}}` | for comprehension: međuproizvod(vektorski proizvod) |

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

d (vektorski

language: ba
---

U Scali, klase su parameterizovane vrijednostima(parameteri konstruktora) i tipovima(ako su [generičke](generic-classes.html)).

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

I will not comment on space before parenthesis any more. It should be fixed with search and replace.

*Apstraktni tipovi* su tipovi čiji identitet nije precizno definisan.
U gornjem primjeru, poznato je samo da svaki objekat klase `Buffer` ima a tip-član `T`,
ali definicija klase `Buffer` ne kazuje kojem konkretno tipu odgovara `T`.
Kao i definicije vrijednosti, možemo prebrisati(override) definicije tipova u podklasama.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

override is not prebrisati.

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

I've replaced it with "redefinisati". It seemed more clear to me but if you have some other suggestion I'll change it.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 8, 2016

Contributor

In german they say prepisati (überschreiben) also in some university books this is the term of choice. I would personally use premostiti.

}

Povratni tip metode `newIntSeqBuf` odnosi se na specijalizaciju trejta `Buffer` u kom je tip `U` sada jednak `Int`u.
Imamo sličan alijas tip u anonimnoj instanci klase u tijelu metode `newIntSeqBuf`.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

alijas is not a word. Maybe use pseudonim

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

println("content = " + buf.element)
}

Primijetite da moramo koristiti [anotacije za varijancu](variances.html) ovdje;

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

varijancu ~> varijansu

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

}
}

Kada bi zakomentarisali `throws` anotaciju u klasi Reader dobili bi sljedeću grešku s porukom pri kompajliranju Java main programa:

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Reader

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

mail = "support@coders.com")
public class MyClass extends HisClass ...

Primjena anotacije u Scali izgleda kao poziv konstruktora, dok se za instanciranje Javinih anotacija moraju koristiti imenovani argumenti:

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Scali ~> Skali or Scala-i

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

I left this one as before, but if you insist I'll change it. The thing is that there are some other words that should be treated same, like "Java" for example. I'd then have to change it also, like "Java-i", right?

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 8, 2016

Contributor

I think so but not 100% sure. It is fine to stay as before. I like Skali the most as this is how you pronounce it.

mail = "support@coders.com")
class MyScalaClass ...

Ova sintaksa je ponekad naporna, npr. ako anotacija ima samo jedan element(bez defaultne vrijednosti), pa po konvenciji,

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

defaultne ~> podrazumevane, predeterminisane

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed, thanks!

public String mail() default "";
}

I upotrijebiti je kao npr:

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

npr ~> na primer, npr.

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Changed to "npr.:", btw, in Bosnian it is "naprimjer".

class MyScalaClass ...

Element `mail` je specificiran s defaultnom vrijednošću tako da ne moramo eksplicitno navoditi vrijednost za njega.
Međutim, ako trebamo, ne možemo miksati dva Javina stila:

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

miksati ~> mijesati ?

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed. The word "mixin" was stuck in my head... xD Also, "mixable" is awkward to translate, "umjesiv"?

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 8, 2016

Contributor

:) This one is hard. I would not use mixable in the first place; can be mixed together is fine. I 6 years with Scala I have never heard that word.

language: ba
---

Scala omogućuje relativno lahku sintaksu za definisanje anonimnih funkcija. Sljedeći izraz kreira funkciju za sljedbenike cijelih brojeva:

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

lahku ~> laku?

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Nope, Bosnian is with "h".


(x: Int) => x + 1

Ovo je kratica za definiciju sljedeće anonimne klase:

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

double space

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

}
}

Program definiše izvršnu aplikaciju Classes u form vrhovnog singlton objekta s `main` metodom.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Classes

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

Treći i četvrti konstruktor su tu samo da dozvole korisnicima <code>HashMap</code>-e da kreiraju instance s vjerovatno-dobrim default parametrima
za kapacitet i faktor opterećenja.
Problematičnije je to da su defaultne vrijednosti i u Javadocu *i* u kodu.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Javadoc-u

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

Ovo umanjuje ponavljanje koda, ali je manje ekspresivno.
Scala ima direktnu podršku za ovo:

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

What is ovo in this case?

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

I missed this one, fixed it in third commit. Literal translation from English version, also ambiguous.

// named arguments
val m4 = new HashMap[String,Int](loadFactor = 0.8f)
Ovako možemo iskoristiti prednost *bilo koje* defaultne vrijednosti korištenjem [imenovanih parametara]({{ site.baseurl }}/tutorials/tour/named-parameters.html).

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

korištenjem ~> korišćenjem ?

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

No, Bosnian is with "t", like "sretan" etc.

language: ba
---

U Scali, uzorci(paterni) mogu biti definisani nezavisno od case klasa.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Use english in parenthesis to explain what you refer to.

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

Za implicitno importovane objekte `scala.Predef` deklariše nekoliko predefinisanih tipova (npr. `Pair`) i metoda (npr. `assert`) ali i nekoliko implicitnih konverzija.
Naprimjer, kada se pozivaju Javine metode koje očekuju `java.lang.Integer`, možete proslijediti `scala.Int`.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Na primjer

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

"Naprimjer" is in right in Bosnian.

}

_Napomena:_ nova `prepend` metoda ima manje restriktivan tip.
Ona dozvoljava, naprimjer, da se nadoveže objekt nadtipa na postojeću listu.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

na primjer

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Search and replace this, I will not comment any more.

S jednostrukim nasljeđivanjem i interfejsima ovo je nemoguće, jer obje klase sadrže implementacije članova.
Scala nam pomaže s _kompozicijom mixin-klasa_.
Ona dozvoljava programerima da ponovo iskoriste razliku definicija klasa, tj., sve nove definicije koje nisu naslijeđene.
Ovaj mehanizam omogućuje kombiniranje `StringIterator`-a s `RichIterator`-om, kao u sljedećem testnom programu koji ispisuje kolonu svih karaktera datog stringa.

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

testnom ~> test

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

Drugi `case` se podudara ako je `x` jednak stringu `"two"`.
Treći slučaj se sastoji od tipskog uzorka; podudara se sa bilo kojim integerom i povezuje vrijednost selektora `x` s varijablom `y` tipa integer.

Scalin pattern matching je najkorisniji za podudaranje algebarskih tipova koji su izraženi kroz [case klase](case-classes.html).

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Skalin or Scala-in. Search and replace in the rest.

language: ba
---

Suprotno od Jave, sve vrijednosti u Scali su objekti (uključujući brojeve i funkcije).

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

Suprotno od ~> Nasuprot

This comment has been minimized.

Copy link
@sake92

sake92 Sep 7, 2016

Author Contributor

Fixed.

language: ba
---

Scala podržava anotacije varijance tipskih parametara [generičkih klasa](generic-classes.html).

This comment has been minimized.

Copy link
@vjovanov

vjovanov Sep 7, 2016

Contributor

varijansu. Search and replace in the text.

@vjovanov

This comment has been minimized.

Copy link
Contributor

commented Sep 7, 2016

Done; excellent work overall. I would use this translation for Croatian and Serbian as well as it is quite close. Given that we have it now there is no point in translating again in those languages.

sake92 added some commits Sep 7, 2016

@sake92

This comment has been minimized.

Copy link
Contributor Author

commented Sep 7, 2016

Thanks for reviewing this, I appreciate it. I have fixed all of the formatting issues, reviewed all documents again, used more consistent terminology. If there are other issues regarding this, please let me know. What would be the next priority for translation? When I find time I'll try to contribute more. :)

@vjovanov

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2016

Excellent work!

@SethTisue SethTisue merged commit c4b399a into scala:master Sep 8, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@SethTisue

This comment has been minimized.

Copy link
Member

commented Sep 8, 2016

thanks all!

I would use this translation for Croatian and Serbian as well as it is quite close

(hmm, I'm not sure what the best way to do that within the existing site infrastructure would be)

@sake92 sake92 referenced this pull request Oct 13, 2017

Merged

Update Bosnian tutorials #895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.