hartenthaler / hh_extended_family

webtrees - showing the extended family of an individual (like cousins and uncles, aunts, ...)
GNU General Public License v3.0
23 stars 9 forks source link

Czech translations of some phrases impossible #32

Closed jpretired closed 3 years ago

jpretired commented 3 years ago

Within translations in each part there are pairs of phrases which cannot be properly translated into Czech as they are. These are e.g. in Grandchildren (and similar pairs in all other parts): '%s has %d female grandchildren recorded.' => ... '%s has %d male grandchildren recorded.' => ... They are plurals. In Czech each of them needs to be translated into two different plural phrases according to plural rule which is shown in webtrees script: /vendor/fisharebest/localization/src/PluralRule/PluralRule8.php In Czech one plural is for (%d>=2 && %d<=4) and the other plural for %d>4.

It means that it should look like this: '%s has %d male grandchild recorded. ' . I18N::PLURAL . '%s has %d male grandchildren recorded. ' => '%s má %d vnuka. ' . I18N::PLURAL . '%s má %d vnuky. ' . I18N::PLURAL . '%s má %d vnuků. ',

Then the corresponding code in '/views/tab.phtml' would be: ` <?php if ($extfam_obj->Grandchildren->femaleCount == 0): ?>

Grandchildren->maleCount, $extfam_obj->Self->niceName, $extfam_obj->Grandchildren->maleCount) ?>

`

The result is

image

The same change should be done to 'female grandchild' and to the pairs in all other parts of translation.

hartenthaler commented 3 years ago

And I thought that German is a complicated language ...

Let me try to understand that. You can not translate the combined sentence "x has n1 grandson(s) and n2 granddaughter(s) recorded.", because you don't know if 2 <= n1+n2 <= 4 or n1+n2 > 4? Right?

Ok, then we have to make two sentences out of this as you have suggested: "x has n1 grandson(s) recorded. " and "He/She has n2 granddaughter(s) recorded." Ok? This ("He/She") sounds better that repeating the same sentence two times. OK?

I have never seen this sequence with three parts like '%s má %d vnuka. ' . I18N::PLURAL . '%s má %d vnuky. ' . I18N::PLURAL . '%s má %d vnuků. '. So I just learned a new thing. Thank you!

jpretired commented 3 years ago

No, Hermann, you probably do not understand me yet. The 'combined' translation sentence you mention is OK. The issue is in case when the person has either only grandsons (2 and more) or only granddaughters (2 and more). Please give me some time to express my solution more clearly.

hartenthaler commented 3 years ago

ok, then I got it. I will change the cases with only grandsons (2 and more) or only granddaughters (2 and more) from "translate" to I18N::PLURAL as proposed by you.

hartenthaler commented 3 years ago

... done in Czech translation for 2 and more (only) grandsons and 2 and more (only) granddaughters. Modified in German and Dutch, too.

Can you check if it is ok now, please? Do we need this now in other parts, too?

jpretired commented 3 years ago

I downloaded the latest 2.0.16.20 but cannot run it. Blank screen! Don't know why.

jpretired commented 3 years ago

Sorry, forget it, it was my fault. Please wait with translations, I made a few changes in both tab.phtml and module.php. I will inform you asap.

hartenthaler commented 3 years ago

I had this problem in the last weeks from time to time, too. But I do not know why. I didn't have it when I'm logged in, only when I'm logged out. Maybe try to logout and login again. If the reason is my module, I need help to find the reason.

Ok, I see that your problem is solved now. You have a lot of time because next week I don't have much time.

jpretired commented 3 years ago

I suggest I will do all the changes regarding translations:

hartenthaler commented 3 years ago

Go! Do it! Good idea! Thank you!

jpretired commented 3 years ago

Here I am appending the final (hopefully) version as to Czech, German and Dutch translations discussed earlier in this issue. Based on 2.0.16.20. The .zip archive contains both module.php and tab.phtml. hh_extended_family-module-and-tab.zip

hartenthaler commented 3 years ago

Thank you a lot! I only found in tab.phtml one "grandmotherss". I will integrate your contribution in the next release.