Attention Translators: New month strings in DateDisplayers

View: New views
6 Messages — Rating Filter:   Alert me  

Attention Translators: New month strings in DateDisplayers

by Brian Matherly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Translators:

I just made a change to all the DateDisplay classes that will affect the translation of months. Previously, the DateDisplay classes used the localized months detected by GrampsLocale. This prohibits us from using a DateDisplay class for translating to languages other than the language Gramps is currently running in.

I have added two new string arrays to each DateDisplay class. Those strings need to be translated in the code (we don't use gettext for those).

At your leisure, please open your respective _Date_xx.py file and edit the following lines:

    # TODO: Translate these month strings:
    long_months = ( u"January", u"February", u"March", u"April", u"May",
                    u"June", u"July", u"August", u"September", u"October",
                    u"November", u"December" )
   
    short_months = ( u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun", u"Jul",
                     u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )

Please remove the #TODO comment when you are done.

Whomever translates Spanish: I translated _Date_es.py for testing purposes. Please double check my work and remove the "# TODO" comment if you are satisfied.

Thanks everyone! This change will lead us to be able to have user selectable report translations.

~Brian

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Attention Translators: New month strings in DateDisplayers

by Josip-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 >
 >Brian Matherly wrote:

> Translators:
>
> I just made a change to all the DateDisplay classes that will affect the translation of months. Previously, the DateDisplay classes used the localized months detected by GrampsLocale. This prohibits us from using a DateDisplay class for translating to languages other than the language Gramps is currently running in.
>
> I have added two new string arrays to each DateDisplay class. Those strings need to be translated in the code (we don't use gettext for those).
>
> At your leisure, please open your respective _Date_xx.py file and edit the following lines:
>
>     # TODO: Translate these month strings:
>     long_months = ( u"January", u"February", u"March", u"April", u"May",
>                     u"June", u"July", u"August", u"September", u"October",
>                     u"November", u"December" )
>    
>     short_months = ( u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun", u"Jul",
>                      u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
>
> Please remove the #TODO comment when you are done.
>
> Whomever translates Spanish: I translated _Date_es.py for testing purposes. Please double check my work and remove the "# TODO" comment if you are satisfied.
>
> Thanks everyone! This change will lead us to be able to have user selectable report translations.
>
> ~Brian
>

May i ask how this will be used? (so to know how to translate)
My language do declination of months, so in enumerations of months they
are in nominative case (October-listopad) but in dates they stand in
genitive case (28. listopada). They are writen in small letters but can
be writen in caps if they are independent of rest of text, like titles
and subtitles etc...

--
Josip


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Attention Translators: New month strings in DateDisplayers

by Brian Matherly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Josip,

> > I just made a change to all the DateDisplay classes
> that will affect the translation of months. Previously, the
> DateDisplay classes used the localized months detected by
> GrampsLocale. This prohibits us from using a DateDisplay
> class for translating to languages other than the language
> Gramps is currently running in.
> >
> > I have added two new string arrays to each DateDisplay
> class. Those strings need to be translated in the code (we
> don't use gettext for those).
> >
> > At your leisure, please open your respective
> _Date_xx.py file and edit the following lines:
> >
> >     # TODO: Translate these month
> strings:
> >     long_months = ( u"January",
> u"February", u"March", u"April", u"May",     
>            
>    u"June", u"July", u"August", u"September",
> u"October",             
>        u"November", u"December" )
> >         short_months = (
> u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
> u"Jul",             
>         u"Aug", u"Sep", u"Oct", u"Nov",
> u"Dec" )
> >
> > Please remove the #TODO comment when you are done.
> >
> > Whomever translates Spanish: I translated _Date_es.py
> for testing purposes. Please double check my work and remove
> the "# TODO" comment if you are satisfied.
> >
> > Thanks everyone! This change will lead us to be able
> to have user selectable report translations.
> >
>
> May i ask how this will be used? (so to know how to
> translate)
> My language do declination of months, so in enumerations of
> months they are in nominative case (October-listopad) but in
> dates they stand in genitive case (28. listopada). They are
> writen in small letters but can be writen in caps if they
> are independent of rest of text, like titles and subtitles
> etc...

Excellent question.

The DateDisplay class is used to build date strings that can be used in either reports or the UI. In the preferences you can change the date format. Depending on your language, there are various options.

That format is used in the "date" columns of the user interface (birth, death in people view, for example). If you choose a date format that spells out the month, then these strings will be used. So, for example, in English, I can choose the format: "Month Day, Year" in the preferences. Then, Christmas would be displayed in the person view as "December 25, 2009".

The DateDisplay class is also used to get date strings for sentences in reports. For example, in the Detailed Descendant Report, you would see a sentences like this: "Edwin was born on October 28, 2009". The "October 28, 2009" part of that sentence comes from the DateDisplay class (assuming that is the date format selected in the preferences).

The strings in the new arrays previously came from GrampsLocale.long_months and GrampsLocale.short_months respectively. Those definitions are still in GrampsLocale if you would like to see what they are for your language.

I hope that helps,

~Brian


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Attention Translators: New month strings in DateDisplayers

by Josip-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brian Matherly wrote:

>
> Excellent question.
>
> The DateDisplay class is used to build date strings that can be used in either reports or the UI. In the preferences you can change the date format. Depending on your language, there are various options.
>
> That format is used in the "date" columns of the user interface (birth, death in people view, for example). If you choose a date format that spells out the month, then these strings will be used. So, for example, in English, I can choose the format: "Month Day, Year" in the preferences. Then, Christmas would be displayed in the person view as "December 25, 2009".
>
> The DateDisplay class is also used to get date strings for sentences in reports. For example, in the Detailed Descendant Report, you would see a sentences like this: "Edwin was born on October 28, 2009". The "October 28, 2009" part of that sentence comes from the DateDisplay class (assuming that is the date format selected in the preferences).
>
> The strings in the new arrays previously came from GrampsLocale.long_months and GrampsLocale.short_months respectively. Those definitions are still in GrampsLocale if you would like to see what they are for your language.
>
> I hope that helps,
>

So basically it means they be used most as a part of dates and in my
case they should be in genitive form.

But i already use months enumerated in DateDisplay() both in genitive
form or as roman numbers (see _Date_hr.py). Would that still works?

--
Josip

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Attention Translators: New month strings in DateDisplayers

by Brian Matherly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Josip,

> So basically it means they be used most as a part of dates
> and in my case they should be in genitive form.
>
> But i already use months enumerated in DateDisplay() both
> in genitive form or as roman numbers (see _Date_hr.py).
> Would that still works?

Oh yes, I see what you've done in there.

First, I see that you don't have a date format that uses abbreviated month names ("jan", "feb", etc.). So short_months won't be used. You might still consider defining the short_month strings in case a report would like to use abbreviated month names (for example in a calendar report). But you could also just delete short_months altogether in _Date_hr.py.

For long_months, I would recommend that you simply rename hr_months to long_months (to be consistent with the way other languages do it). Then,  anywhere you used "hr_months", replace it with "long_months".

"roman_months" can remain unchanged.

~Brian

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Attention Translators: New month strings in DateDisplayers

by Jerome :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> May i ask how this will be used?

Used to try to print reports in different languages easier :
http://www.gramps-project.org/bugs/view.php?id=2371

> (so to know how to translate)

Looks like there is no rule (small letters or not), it is a list, isn't it ? [0], [1], [2], [3] ... [12]

> My language do declination of months, so in enumerations of
> months they
> are in nominative case (October-listopad) but in dates they
> stand in
> genitive case (28. listopada).

I suppose you can try to "cheat/force" !
by looking at GrampsLocale and maybe set your locale on command ?
Your distribution might return the value (like before)

Note, I get some differences between OpenSuse 10.3 and Ubuntu 9.04 with short_months under my locale (strict versus logical).




--- En date de : Mer 28.10.09, Josip <josip@...> a écrit :

> De: Josip <josip@...>
> Objet: Re: [Gramps-devel] Attention Translators: New month strings in DateDisplayers
> À: brian@...
> Cc: "Gramps Development List" <gramps-devel@...>
> Date: Mercredi 28 Octobre 2009, 14h29
>  >
>  >Brian Matherly wrote:
> > Translators:
> >
> > I just made a change to all the DateDisplay classes
> that will affect the translation of months. Previously, the
> DateDisplay classes used the localized months detected by
> GrampsLocale. This prohibits us from using a DateDisplay
> class for translating to languages other than the language
> Gramps is currently running in.
> >
> > I have added two new string arrays to each DateDisplay
> class. Those strings need to be translated in the code (we
> don't use gettext for those).
> >
> > At your leisure, please open your respective
> _Date_xx.py file and edit the following lines:
> >
> >     # TODO: Translate these month
> strings:
> >     long_months = ( u"January",
> u"February", u"March", u"April", u"May",
> >               
>      u"June", u"July", u"August",
> u"September", u"October",
> >               
>      u"November", u"December" )
> >     
> >     short_months = ( u"Jan",
> u"Feb", u"Mar", u"Apr", u"May", u"Jun", u"Jul",
> >               
>       u"Aug", u"Sep", u"Oct", u"Nov", u"Dec"
> )
> >
> > Please remove the #TODO comment when you are done.
> >
> > Whomever translates Spanish: I translated _Date_es.py
> for testing purposes. Please double check my work and remove
> the "# TODO" comment if you are satisfied.
> >
> > Thanks everyone! This change will lead us to be able
> to have user selectable report translations.
> >
> > ~Brian
> >
>
> May i ask how this will be used? (so to know how to
> translate)
> My language do declination of months, so in enumerations of
> months they
> are in nominative case (October-listopad) but in dates they
> stand in
> genitive case (28. listopada). They are writen in small
> letters but can
> be writen in caps if they are independent of rest of text,
> like titles
> and subtitles etc...
>
> --
> Josip
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference
> in SF, CA
> is the only developer event you need to attend this year.
> Jumpstart your
> developing skills, take BlackBerry mobile applications to
> market and stay
> ahead of the curve. Join us from November 9 - 12, 2009.
> Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Gramps-devel mailing list
> Gramps-devel@...
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>


     

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel