> On June 1, 2014, 4:22 p.m., Alexander Potashev wrote:
> > What is the user changes the locale at run-time - will the query parser 
> > reload the month/weekday names?
> 
> Denis Steckelmacher wrote:
>     It depends on the client application. This list is cached in 
> pass_periodnames, that is private to one Baloo::QueryParser instance. If the 
> application, let's say KRunner, instantiates a new parser for every query, 
> then the new calendar will be used as soon as the user changes it.

OK. I guess adding some notification/listening API of KCalendarSystem in order 
to pull the changes in the current locale automatically would be an overkill. 
May be this name caching should be told about in a comment in code.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118448/#review58904
-----------------------------------------------------------


On June 1, 2014, 11:54 a.m., Denis Steckelmacher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118448/
> -----------------------------------------------------------
> 
> (Updated June 1, 2014, 11:54 a.m.)
> 
> 
> Review request for Baloo, Localization and Translation (l10n) and Alexander 
> Potashev.
> 
> 
> Repository: baloo
> 
> 
> Description
> -------
> 
> The query parser made the erroneous assumption that each language uses at 
> most one calendar system, and therefore used i18nc to translate the month and 
> day names recognized by the parser. This patches changes that and uses the 
> KCalendarSystem of the user to get the month and day names.
> 
> I've written the code by looking at how the gregorian, hebrew and islamic 
> calendars work (these are the three that I somehow understand). The idea is 
> to try to get as many days and months as possible, by incrementing an index 
> until the calendar system returns NULL strings. This works well for days, but 
> monthName() requires a year, that is used by some calendar systems to 
> rename/add months on leap years. I pass the current year, as most of the 
> users will look for dates not too far in the future nor in the past. Is there 
> a mean to get the complete list of month names and their corresponding 
> number, using KCalendarSystem or anything else?
> 
> 
> Diffs
> -----
> 
>   src/queryparser/pass_periodnames.h 1d7d522 
>   src/queryparser/pass_periodnames.cpp da688ed 
> 
> Diff: https://git.reviewboard.kde.org/r/118448/diff/
> 
> 
> Testing
> -------
> 
> The query parser testsuite still passes, and properly gets the name of 
> Gregorian months and days (the tests run using the C locale).
> 
> 
> Thanks,
> 
> Denis Steckelmacher
> 
>

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to