Skip to content

Commit

Permalink
Merge pull request #56 from monarch-initiative/49-translation-validat…
Browse files Browse the repository at this point in the history
…ion-by-zafer

49 translation validation by zafer
  • Loading branch information
pnrobinson authored Jul 16, 2024
2 parents 2674102 + d6432d7 commit c3e189b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public String getIndividualDescription(PpktIndividual individual) {
}

private String hpoOnsetDescription(HpoOnsetAge hpoOnsetTermAge) {
return String.format("Hastalığın başlangıcı %s meydana geldi",
return String.format("Hastalık %s başladı",
nameOfLifeStage(hpoOnsetTermAge));
}

Expand Down Expand Up @@ -100,7 +100,7 @@ private String nameOfLifeStage(HpoOnsetAge hpoOnsetTermAge) {
}

private String iso8601onsetDescription(Iso8601Age isoAge) {
return String.format("Hastalığın başlangıcı %s yaşında meydana geldi",
return String.format("Hastalık %s başladı",
bbGenerator.yearsMonthsDaysOld(isoAge.getYears(), isoAge.getMonths(), isoAge.getDays()));
}

Expand Down Expand Up @@ -193,15 +193,15 @@ private String imAlterVonIsoAgeExact(PhenopacketAge ppktAge) {
return String.format("%d yaşında", y);
} else if (y > 0) {
if (m > 0) {
return String.format("%d %s ve %d %s yaşında", y, "yıl", m, "ay");
return String.format("%d %s %d %s yaşında", y, "yıl", m, "ay");
} else {
return String.format("%d yaşında", y);
}
}
if (m > 0) {
return String.format("%d %s ve %d %s yaşında", m, "ay", d, "gün");
return String.format("%d %s %d %s yaşında", m, "ay", d, "gün");
} else {
return String.format("%d gün", d);
return String.format("%d günlükken", d);
}
}

Expand Down Expand Up @@ -254,13 +254,13 @@ private String dAlter(Iso8601Age iso8601Age, GrammatikalischesGeschlecht geschle
int d = iso8601Age.getDays();
List<String> components = new ArrayList<>();
if (y > 0) {
components.add(String.format("%d yıl", y));
components.add(String.format("%d yaşinda", y));
}
if (m > 0) {
components.add(String.format("%d ay", m));
components.add(String.format("%d aylıkken", m));
}
if (d > 0) {
components.add(String.format("%d gün", d));
components.add(String.format("%d günlükken", d));
}
String ymd;
if (components.isEmpty()) {
Expand Down Expand Up @@ -288,19 +288,19 @@ private String iso8601ToYearMonth(Iso8601Age iso8601Age, PhenopacketSex psex) {
if (iso8601Age.getMonths() == 0) {
return String.format("%d yaşında bir erkek çocuk", y);
} else {
return String.format("%d %s yıl, %d %s ay yaşında bir erkek çocuk", y, y>1?"Jahre":"Jahr", m, m>1?"Monate":"Monat");
return String.format("%d %s yaş, %d %s aylıkken bir erkek çocuk", y, y>1?"Jahre":"Jahr", m, m>1?"Monate":"Monat");
}
} else if (psex.equals(PhenopacketSex.FEMALE)) {
if (iso8601Age.getMonths() == 0) {
return String.format("%d yaşında bir kız çocuk", y);
} else {
return String.format("%d %s yıl, %d %s ay yaşında bir kız çocuk", y, y>1?"Jahre":"Jahr", m, m>1?"Monate":"Monat");
return String.format("%d %s yaş, %d %s aylıkken bir kız çocuk", y, y>1?"Jahre":"Jahr", m, m>1?"Monate":"Monat");
}
}
if (iso8601Age.getMonths() == 0) {
return String.format("%d yaşında bir çocuk", y);
} else {
return String.format("%d yıl, %d ay yaşında bir çocuk", y, m); }
return String.format("%d yaş, %d aylıkken bir çocuk", y, m); }
}

private String monthString(int m) {
Expand All @@ -315,11 +315,11 @@ private String iso8601ToMonthDay(Iso8601Age iso8601Age) {
int m = iso8601Age.getMonths();
int d = iso8601Age.getDays();
if (m == 0) {
return String.format("%d gün", d);
return String.format("%d günlükken", d);
} else if (d>0){
return String.format("%d ay ve %d gün", m, monthString(m), d, dayString(d));
return String.format("%d ay %d günlükken", m, monthString(m), d, dayString(d));
} else {
return String.format("%d ay", m);
return String.format("%d aylıkken", m);
}
}

Expand All @@ -333,19 +333,19 @@ private String iso8601AtAgeOf(Iso8601Age isoAge) {
List<String> components = new ArrayList<>();

if (isoAge.getYears()>1) {
components.add(String.format("%d yıl", isoAge.getYears()));
components.add(String.format("%d yaşinda", isoAge.getYears()));
} else if (isoAge.getYears() == 1) {
components.add("bir yıl");
components.add("bir yaşinda");
}
if (isoAge.getMonths() > 1) {
components.add(String.format("%d ay", isoAge.getMonths()));
components.add(String.format("%d aylıkken", isoAge.getMonths()));
} else if (isoAge.getMonths() == 1) {
components.add("bir ay");
components.add("bir aylıkken");
}
if (isoAge.getDays()>1) {
components.add(String.format("%d gün", isoAge.getDays()));
components.add(String.format("%d günlükken", isoAge.getDays()));
} else if (isoAge.getDays()==1) {
components.add("bir gün");
components.add("bir günlükken");
}
if (components.isEmpty()) {
return "doğumda";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private String getCommaList(List<String> items) {
// if we have more than two, join all but the very last item with a comma
String penultimate = items.stream()
.limit(items.size() - 1)
.collect(Collectors.joining(","));
.collect(Collectors.joining(", "));
String ultimate = items.get(items.size() - 1);
return penultimate + " ve " + ultimate;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,35 @@ public String monthDayOld(int m, int d) {
} else if (components.size() == 1) {
return components.get(0);
} else {
return String.format("%s ve %slükken", components.get(0), components.get(1));
return String.format("%s %slıkken", components.get(0), components.get(1));
}
}

@Override
public String yearsMonthsDaysOld(int y, int m, int d) {
List<String> components = new ArrayList<>();
if (y > 0) {
components.add(String.format("%d yıl", y));
if (m == 0 && d == 0) {
components.add(String.format("%d yaşında", y));
} else {
components.add(String.format("%d yaş", y));
}
}
if (m > 0) {
components.add(String.format("%d ay", m));
components.add(String.format("%d aylıkken", m));
}
if (d > 0) {
components.add(String.format("%d gün", d));
components.add(String.format("%d günlükken", d));
}
if (components.isEmpty()) {
return "doğumdan sonraki ilk gün";
} else if (components.size() == 1) {
return components.get(0);
} else if (components.size() == 2) {
return String.format("%s ve %slükken", components.get(0), components.get(1));
return String.format("%s %slıkken", components.get(0), components.get(1));
} else {
// we must have y,m,d
return String.format("%s %s ve %slükken", components.get(0), components.get(1), components.get(2));
return String.format("%s %s %slıkken", components.get(0), components.get(1), components.get(2));
}
}

Expand Down Expand Up @@ -241,7 +245,7 @@ public String probandNoAgePresentedWith() {

@Override
public String probandWasAMale() {
return "Proband bir adamdı";
return "Proband bir erkekti";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public String formatFeatures(List<OntologyTerm> ontologyTerms) {
public String getVignetteAtAge(PhenopacketAge page, PhenopacketSex psex, List<OntologyTerm> terms) {
String ageString = this.ppktAgeSexGenerator.atAgeForVignette(page);
String person = switch (psex) {
case MALE -> "o";
case FEMALE -> "o";
case MALE -> "";
case FEMALE -> "";
default -> "etkilenen kişi";
};
return this.ppktPhenotypicFeatureGenerator.featuresAtEncounter(person, ageString, terms);
Expand All @@ -61,8 +61,8 @@ public String getVignetteAtAge(PhenopacketAge page, PhenopacketSex psex, List<On
@Override
public String getVignetteAtOnset(PpktIndividual individual){
String person = switch (individual.getSex()) {
case MALE -> "O";
case FEMALE -> "O";
case MALE -> "Etkilenen kişi";
case FEMALE -> "Etkilenen kişi";
default -> "Etkilenen kişi";
};
return this.ppktPhenotypicFeatureGenerator.featuresAtOnset(person, individual.getPhenotypicFeaturesAtOnset());
Expand Down

0 comments on commit c3e189b

Please sign in to comment.