Recent

Author Topic: Questions about a new Calendar component.  (Read 67661 times)

linuxer

  • Jr. Member
  • **
  • Posts: 50
  • Systemd kills Linux Freedom Move to Artix Linux
    • Linuxer
Re: Questions about a new Calendar component.
« Reply #105 on: December 28, 2018, 02:15:35 am »
Thank you very much!

I will proceed accordingly..

On callite-trunk you can find a new version 0.3.4 which has built-in Greek language support, and it will be available via Online Package Manager soon.

I think this is the last language that was hard-coded into the callight source, and I guess I'll remove all these hard-coded languages again to support only the po file and the property approaches mentioned in my previous post. To prepare for the change I deprecated the property "Languages"


linuxer

  • Jr. Member
  • **
  • Posts: 50
  • Systemd kills Linux Freedom Move to Artix Linux
    • Linuxer
Re: Questions about a new Calendar component.
« Reply #106 on: December 28, 2018, 02:59:32 am »

On callite-trunk you can find a new version 0.3.4 which has built-in Greek language support, and it will be available via Online Package Manager soon.

I think this is the last language that was hard-coded into the callight source, and I guess I'll remove all these hard-coded languages again to support only the po file and the property approaches mentioned in my previous post. To prepare for the change I deprecated the property "Languages"

Now I am getting this error....

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Questions about a new Calendar component.
« Reply #107 on: December 28, 2018, 09:05:35 am »
What are you doing? I cannot reproduce this. Please post a project which shows the error.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Questions about a new Calendar component.
« Reply #108 on: December 28, 2018, 11:27:18 am »
Thanks for your answer....

Nice job!

You will have to add these lines:

    dsDomingo   = 'Κυρ';
    dsLunes     = 'Δευ';
    dsMartes    = 'Τρί';
    dsMiercoles = 'Τετ';
    dsJueves    = 'Πεμ';
    dsViernes   = 'Παρ';
    dsSabado    = 'Σαβ';
  (* Meses. *)
    nmEnero      = 'Ιανουάριος';
    nmFebrero    = 'Φεβρουάριος';
    nmMarzo      = 'Μάρτιος';
    nmAbril      = 'Απρίλος';
    nmMayo       = 'Μάιος';
    nmJunio      = 'Ιούνιος';
    nmJulio      = 'Ιούλιος';
    nmAgosto     = 'Αύγουστος';
    nmSeptiembre = 'Σεπτέμβριος';
    nmOctubre    = 'Οκτώβριος';
    nmNoviembre  = 'Νοέμβριος';
    nmDiciembre  = 'Δεκέμβριος';

Check the order too...

If you can't find a solution, may be you can try my own custom calendar component (package includes more components).  If it works for you, you can send me a patch to add Greek to it. :)

Than you for the translation.  I'll check it and add multilanguage support. :)
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

linuxer

  • Jr. Member
  • **
  • Posts: 50
  • Systemd kills Linux Freedom Move to Artix Linux
    • Linuxer
Re: Questions about a new Calendar component.
« Reply #109 on: December 28, 2018, 11:41:41 am »
Awaiting your feedback regarding the multi-language support.

Could you add a setproperty, in order to have diffirent size (Width x Height) of the arrows, too?

Regards

Thanks for your answer....

Nice job!

You will have to add these lines:

    dsDomingo   = 'Κυρ';
    dsLunes     = 'Δευ';
    dsMartes    = 'Τρί';
    dsMiercoles = 'Τετ';
    dsJueves    = 'Πεμ';
    dsViernes   = 'Παρ';
    dsSabado    = 'Σαβ';
  (* Meses. *)
    nmEnero      = 'Ιανουάριος';
    nmFebrero    = 'Φεβρουάριος';
    nmMarzo      = 'Μάρτιος';
    nmAbril      = 'Απρίλος';
    nmMayo       = 'Μάιος';
    nmJunio      = 'Ιούνιος';
    nmJulio      = 'Ιούλιος';
    nmAgosto     = 'Αύγουστος';
    nmSeptiembre = 'Σεπτέμβριος';
    nmOctubre    = 'Οκτώβριος';
    nmNoviembre  = 'Νοέμβριος';
    nmDiciembre  = 'Δεκέμβριος';

Check the order too...

If you can't find a solution, may be you can try my own custom calendar component (package includes more components).  If it works for you, you can send me a patch to add Greek to it. :)

Than you for the translation.  I'll check it and add multilanguage support. :)
« Last Edit: December 28, 2018, 11:47:05 am by linuxer »

linuxer

  • Jr. Member
  • **
  • Posts: 50
  • Systemd kills Linux Freedom Move to Artix Linux
    • Linuxer
Re: Questions about a new Calendar component.
« Reply #110 on: December 28, 2018, 12:39:28 pm »
My mistake was that I was not selecting the Language correctly, sorry..  :(

But the problem is that even with lgGreek setting, it shows GreekDays correctly, but incorrectly GreekMonths.

Pls check my screenshots below....

What are you doing? I cannot reproduce this. Please post a project which shows the error.
« Last Edit: December 28, 2018, 12:44:11 pm by linuxer »

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Questions about a new Calendar component.
« Reply #111 on: December 28, 2018, 05:11:15 pm »
Yes, I just saw that day and month names are taken sometimes from the Calendar properties and sometimes from the system's FormatSettings. And the DisplayTexts are not correct either because they should contain a %s or %d placeholder for the Format command since their position may depend on the language.

I am currently redoing this part of the component and hope to fix it soon.

Did the request for adaptable size of the navigation arrows refer to CalLite or to Ñuño_Martínez' component?

nanobit

  • Full Member
  • ***
  • Posts: 160
Re: Questions about a new Calendar component.
« Reply #112 on: December 28, 2018, 06:13:31 pm »
I just want to mention here, that untyped utf8 literals are not safe with current versions of fpc.
So applications should avoid them until resolved.
https://bugs.freepascal.org/view.php?id=34674

You will have to add these lines:

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Questions about a new Calendar component.
« Reply #113 on: December 29, 2018, 01:09:07 am »
I am currently redoing this part of the component and hope to fix it soon.
r6775 contains a major rework of the translation code. These are the main changes:
  • There's a new language enumeration value now: lgCustom. When this option is selected in property "Language" then the DayNames, MonthNames and DisplayTexts are taken from the corresponding properties.
  • DayNames is a comma-separated list of the day names of the new language; each name can consist of the long and short version of the name. For English, e.g., this string is
    Sunday|Sun,Monday|Mon,Tuesday|Tue,Wednesday|Wed,Thursday|Thu,Friday|Fri,Saturday|Sat.
  • Likewise, MonthNames is a list of the name of the months, again in a long and a short version.
  • DisplayTexts is another comma-separated list of strings displayed by the component. Just translate the string displayed in the object inspector for the property to your language.
    • The 1st string, 'Today is %s', is the string displayed at the bottom of the calendar. %s is replaced by today's date
    • The 2nd string, e.g. 'mmm dd, yyyy', is the format mask used by FormatDateTime to format the date in 'Today is'
    • The 3rd string, 'Holidays in %d', is the caption of the context menu of the calendar, %d is replaced by the currently selected year.
    • The 4th string, 'There are no holidays set for %d', is an error message when no holidays are defined for the year inserted for %d.
    • The 5th string, 'dddd, mmm dd, yyyy', is new; it denotes the format mask used by FormatDateTime to format the date in 'Today is' when option coShowTodayName is set.
    • The 6th string, 'mmmm yyyy', is new, too. It is the caption of the calendar displaying the current month and year, e.g. 'December 2018'
  • If you want to use the translation system of the LCL based on po files set the Language to lgEnglish and provide translated strings in the po files.
I hope that the changes are backward-compatible. In my tests the old DisplayTexts which did not have the format specifiers %s and %d so far, did work equally well.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Questions about a new Calendar component.
« Reply #114 on: December 29, 2018, 03:48:17 am »
    • If you want to use the translation system of the LCL based on po files set the Language to lgEnglish and provide translated strings in the po files.

    Why don't you rather add lgDefault to use the po files? This way one can select the English values if desired.
    Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
    Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
    (K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

    linuxer

    • Jr. Member
    • **
    • Posts: 50
    • Systemd kills Linux Freedom Move to Artix Linux
      • Linuxer
    Re: Questions about a new Calendar component.
    « Reply #115 on: December 29, 2018, 09:38:45 am »
    Thank you very much for your further quick actions and response.

    I can confirm it's proper operation for Greek UTF8 language (pls check my screenshot below), now!  :D :D :D

    I am currently redoing this part of the component and hope to fix it soon.
    r6775 contains a major rework of the translation code. These are the main changes:
    • There's a new language enumeration value now: lgCustom. When this option is selected in property "Language" then the DayNames, MonthNames and DisplayTexts are taken from the corresponding properties.
    • DayNames is a comma-separated list of the day names of the new language; each name can consist of the long and short version of the name. For English, e.g., this string is
      Sunday|Sun,Monday|Mon,Tuesday|Tue,Wednesday|Wed,Thursday|Thu,Friday|Fri,Saturday|Sat.
    • Likewise, MonthNames is a list of the name of the months, again in a long and a short version.
    • DisplayTexts is another comma-separated list of strings displayed by the component. Just translate the string displayed in the object inspector for the property to your language.
      • The 1st string, 'Today is %s', is the string displayed at the bottom of the calendar. %s is replaced by today's date
      • The 2nd string, e.g. 'mmm dd, yyyy', is the format mask used by FormatDateTime to format the date in 'Today is'
      • The 3rd string, 'Holidays in %d', is the caption of the context menu of the calendar, %d is replaced by the currently selected year.
      • The 4th string, 'There are no holidays set for %d', is an error message when no holidays are defined for the year inserted for %d.
      • The 5th string, 'dddd, mmm dd, yyyy', is new; it denotes the format mask used by FormatDateTime to format the date in 'Today is' when option coShowTodayName is set.
      • The 6th string, 'mmmm yyyy', is new, too. It is the caption of the calendar displaying the current month and year, e.g. 'December 2018'
    • If you want to use the translation system of the LCL based on po files set the Language to lgEnglish and provide translated strings in the po files.
    I hope that the changes are backward-compatible. In my tests the old DisplayTexts which did not have the format specifiers %s and %d so far, did work equally well.

    linuxer

    • Jr. Member
    • **
    • Posts: 50
    • Systemd kills Linux Freedom Move to Artix Linux
      • Linuxer
    Re: Questions about a new Calendar component.
    « Reply #116 on: December 29, 2018, 02:11:15 pm »
    Hi again,

    Where can I find further documentation regarding CalendarLite, i.e. getting the selected date from the Tdate array e.t.c. ?

    Regards

    I am currently redoing this part of the component and hope to fix it soon.
    r6775 contains a major rework of the translation code. These are the main changes:
    • There's a new language enumeration value now: lgCustom. When this option is selected in property "Language" then the DayNames, MonthNames and DisplayTexts are taken from the corresponding properties.
    • DayNames is a comma-separated list of the day names of the new language; each name can consist of the long and short version of the name. For English, e.g., this string is
      Sunday|Sun,Monday|Mon,Tuesday|Tue,Wednesday|Wed,Thursday|Thu,Friday|Fri,Saturday|Sat.
    • Likewise, MonthNames is a list of the name of the months, again in a long and a short version.
    • DisplayTexts is another comma-separated list of strings displayed by the component. Just translate the string displayed in the object inspector for the property to your language.
      • The 1st string, 'Today is %s', is the string displayed at the bottom of the calendar. %s is replaced by today's date
      • The 2nd string, e.g. 'mmm dd, yyyy', is the format mask used by FormatDateTime to format the date in 'Today is'
      • The 3rd string, 'Holidays in %d', is the caption of the context menu of the calendar, %d is replaced by the currently selected year.
      • The 4th string, 'There are no holidays set for %d', is an error message when no holidays are defined for the year inserted for %d.
      • The 5th string, 'dddd, mmm dd, yyyy', is new; it denotes the format mask used by FormatDateTime to format the date in 'Today is' when option coShowTodayName is set.
      • The 6th string, 'mmmm yyyy', is new, too. It is the caption of the calendar displaying the current month and year, e.g. 'December 2018'
    • If you want to use the translation system of the LCL based on po files set the Language to lgEnglish and provide translated strings in the po files.
    I hope that the changes are backward-compatible. In my tests the old DisplayTexts which did not have the format specifiers %s and %d so far, did work equally well.
    « Last Edit: December 29, 2018, 02:16:13 pm by linuxer »

    wp

    • Hero Member
    • *****
    • Posts: 11854
    Re: Questions about a new Calendar component.
    « Reply #117 on: December 29, 2018, 02:21:56 pm »
    Where can I find further documentation regarding CalendarLite, i.e. getting the selected date from the Tdate array e.t.c. ?
    CalLite is documented in the wiki:

    linuxer

    • Jr. Member
    • **
    • Posts: 50
    • Systemd kills Linux Freedom Move to Artix Linux
      • Linuxer
    Re: Questions about a new Calendar component.
    « Reply #118 on: December 29, 2018, 02:27:16 pm »
    Thank you very much!  :) :) :) :)

    Where can I find further documentation regarding CalendarLite, i.e. getting the selected date from the Tdate array e.t.c. ?
    CalLite is documented in the wiki:

    howardpc

    • Hero Member
    • *****
    • Posts: 4144
    Re: Questions about a new Calendar component.
    « Reply #119 on: December 29, 2018, 02:55:35 pm »
    CalLite is an interesting example of a control that was developed entirely by contributors to this forum, attempting to meet a need originally expressed by a hobby programmer living in Israel who could not find a Pascal calendar component that could cope with Hebrew (right to left script). It is easy to trace the history of its development here.

    wp, who maintains CalLite, has managed to weave together the best ideas from several contributors, and also documented the result.

    Of course, as with all open source code, the ultimate documentation is the source itself.

     

    TinyPortal © 2005-2018