I completed translating and testing rel_he.py and it seems to work w/o errors finally. However, I need some (python???) help with a specific case that effects the whole code.
I Hebrew we will need 4 “step” rather then just one: feminine/masculine, singular/plural.
I’ve seem something similar in rel_fr.py but my coding skills are at monkey see monkey do level…
The plural relationship describes the relationship between a person and a group of people with the same relationship, so you don’t know the gender of the people in the group. I don’t know if this is a problem.
For the single relationship you are given the gender of the two people involved in the variables gender_a and gender_b. You can use these variables to determined the translation of “step”.
It is possible that you may need to translate get_sibling_relationship_string if the logic of uncle, aunt sibling relationship descriptions is different from English.
I don’t mind looking at your code to see if I can help.
This is all done. All tests passes.
in English “step” works for all" step son, step doubter step mother and so on.
While in Hebrew "step (gen male) has one form i.e “אח שלוב” (step brother), and "step (gen female) has a different form i.e “אחות שלובה” (step sister). Each case has its plural form as well: “אחים שלובים” (step brothers) and “אחיות שלובות” (step sisters).
Current result are: “אחות שלוב” and “אחיות שלוב”…
Hope this better explains the issue
For the singular case , you could define a couple of new constants:
STEP_M = "שלוב"
STEP_F = "שלובה"
and then in the get_single_relationship_string method use logic similar to:
if only_birth:
step = ""
else:
if gender_b = MALE
step = self.STEP_M
elif gender_b = FEMALE
step = self.STEP_F
else:
step = "?" # Change this as appropriate for other and unknown gender
For the plural case, you will have step siblings rather than step brothers or step sisters.
I still have some English stuff in there that was unable to remove.
For Hebrew, 11 levels are more then enough, so i kept all level lists, at the first par of the script, 11 levels long. For some reason “_SON_LEVEL” and “_DAUGHTER_LEVEL” brakes the code if the lists are shorthorn than 30. I was assuming there is a param in the scrip to set the depth but couldn’t find the way to tweak it. If there is no easy way to do so, I’ll just translate those two list all the way to lvl30
@avma
I think the precedence of the שלובה should have higher importance.
Meaning that נכדה שלובה מרמה חמישית is better than נכדה מרמה חמישית שלובה for example.
Also the term שלובה, although well known is the less popular term for the term step, חורגת is much more popular.
True, I’ll re-arrange the wording order to make more sense Hebrew once i figure out how to deal with singular/plural form in the script. Keep in mind however that in Hebrew the the descriptive name for (son/doub) fifth generation and up is: “בת־מרמה־חמישית”, “בן־מרמה־חמישית”
The old (but still in use) word suggests “segregation”, “segmentation” and “exclusion”, the new one suggests “integration”, “acceptance” and “inclusion”.
Same for get_doubter…
I couldn’t figure out the singular/plural tweak yet ;(
Visually it looks also like the Indent is of too, very difficult to manipulate bi-di placings.
Just notice a small typo so it won’t infiltrate the code: מדרגה.
And another small one is שנייה instead of שניה (same goes for פנייה over פניה) as explained here.
The version without the commas is easier to read because it doesn’t interrupt the reading flow.
I would also lose the Maqaf, since there are so many words that need it it’s just annoying.
It is a social change we need to make in Israel but for now it’s not as popular for the greater public.
(adapting your sharing Technique…) Here is a working copy of " rel_he.py".
I’d love to keep on Trial and error-ring this some more, but once again, I’m fare from being any sort of coder.
I removed some parts of your code that were not required and created PR #1575.
The indent problem was caused by the “inlaw” and “step” substitution variables. Your strings have spaces between the variables and substituting empty strings left a couple of unwanted spaces. To make the problem more visible, the empty strings were interpreted as LTR and placed it the front of the strings for some reason.
There are two solutions to the problem:
Remove the spaces from your strings and add them in the in-law and step strings.
Use the strip() function to remove the unwanted spaces.
I’ve taken the second approach for now. It was easier for me than editing the mixed LTR and RTL strings.
Great thanks @Nick-Hall,
Trust me editing “bi-directional text on an Hebrew environment” is worst then a nightmare, where characters are thrown all over the line moving other stuff (tags, Latin chars and pieces of code) around until one can not tell head from tail any more. not much fun.
I’m currently having “add-on manager” issues both on beta 2 and 3, when that is fixed, I’ll look at both ‘date’ and ‘rel’ thoroughly, so I’m pretty sure this is not the last you’re gonna hear from me about it ;-/
Also I’m still eager to tweak that singular/plural form too.
Gotten slapped on my wrist for using the wrong branch for testing 5.2 (probably rightfully too), I re-based to maintenance/gramps52 and it seems to work as is… BUT
Look at the column “Age” (גיל) (marked “1” and “2” then on column “date” (תאריך) marked “3”.
“1” and “2” are not from the date handler and need to be tweaked too.
This is OK, however we might want to add a substitution list to the handler containing words one might use verbally describing the dates quality “בסביבות, בערך ב, באזור ה, קרוב ל, בקרוב, במקורב”