• Page:
  • 1

TOPIC:

Translation of dates with BEF, AFT, etc 8 years 1 month ago #1

  • rola
  • rola's Avatar Topic Author
  • Visitor
  • Visitor
As far as I can remember there was a possibility to translate correctly dates with BEF, AFT, ... It was something coded in a php script, now I cannot find where it is.

So my question - where is the logic for translation of such dates hidden?
For example in slovak a date with BEF and AFT should use the months name in instrumental. The translations for all needed cases are OK.

Please Log in or Create an account to join the conversation.

Re: Translation of dates with BEF, AFT, etc 8 years 1 month ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364
Hi Rola,

This logic is in Library/WT/Dates/Calendar.php
		if ($this->d && preg_match('/%[djlDNSwz]/', $format)) {
			// If we have a day-number *and* we are being asked to display it, then genitive
			$case='GENITIVE';
		} else {
			switch ($qualifier) {
			case '':
			case 'int':
			case 'est':
			case 'cal': $case='NOMINATIVE'; break;
			case 'to':
			case 'abt':
			case 'from': $case='GENITIVE'; break;
			case 'aft':  $case='LOCATIVE'; break;
			case 'bef':
			case 'bet':
			case 'and': $case='INSTRUMENTAL'; break;
			}

This code was written when we just had a few translators. The logic worked for just those few languages.

It now seems that it is inadequate for many languages. Ideally, we need separate translations for each *qualifier*, not for each *grammatical case*.

But, we have 6 calendars, with 12 (or 13!) months, and 11 qualifiers. This would require 800 separate translations. Even then, I think the system would be inadequate.

I think perhaps we need a system similar to the one I plan for relationships - each language has different rules, but the rules are stored as data, not stored as code.

[edit] Also, any solution should help with text in reports. For example "he was born on 1 January 1900" versus "he was born in January 1900"
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Last edit: by fisharebest.

Re: Translation of dates with BEF, AFT, etc 8 years 1 month ago #3

  • rola
  • rola's Avatar Topic Author
  • Visitor
  • Visitor
Thank you,

now a second question - I am not so good in php - how does switch statement work?
Does it mean that:

1 - BEF, BET, AND should use ISTRUMENTAL
or
2 - BEF, BET use no case and only AND is with INSTRUMENTAL?

It works like described in 2, but for me it should be like in 1. :-)

Ladislav

Please Log in or Create an account to join the conversation.

Re: Translation of dates with BEF, AFT, etc 8 years 1 month ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364
It works like (1)
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Re: Translation of dates with BEF, AFT, etc 8 years 1 month ago #5

  • rola
  • rola's Avatar Topic Author
  • Visitor
  • Visitor
Thanks once more, I did not read the three rows before the case statment - in slovak there should be the same case statment also when there is a day-number in the date.

Ladislav

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum