Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix first-day-of-week detexion in dense calendar (Upcoming Transactions) #1907

Closed
wants to merge 1 commit into from

Conversation

nabijaczleweli
Copy link
Contributor

GnuCash depends on GTK3, and not GTK2. Thus:

$ gettext -d gtk20 calendar:week_start:0; echo
calendar:week_start:0
$ LC_LANG=pl_PL.UTF-8 gettext -d gtk20 calendar:week_start:0; echo
calendar:week_start:0

$ gettext -d gtk30 calendar:week_start:0; echo
calendar:week_start:1
$ LC_LANG=pl_PL.UTF-8 gettext -d gtk30 calendar:week_start:0; echo
calendar:week_start:1

because the "gtk20" catalog, provided by GTK2, doesn't exist.

Before:
image

After:
image

This corresponds to https://bugs.gnucash.org/show_bug.cgi?id=797623 and https://bugs.gnucash.org/show_bug.cgi?id=752395

@christopherlam
Copy link
Contributor

Would be better to use

gnc_start_of_week (void)
which returns 1..7 for Sun..Sat

…ions)

GnuCash depends on GTK3, and not GTK2. Thus:
  $ gettext -d gtk20 calendar:week_start:0; echo
  calendar:week_start:0
  $ LC_LANG=pl_PL.UTF-8 gettext -d gtk20 calendar:week_start:0; echo
  calendar:week_start:0

  $ gettext -d gtk30 calendar:week_start:0; echo
  calendar:week_start:1
  $ LC_LANG=pl_PL.UTF-8 gettext -d gtk30 calendar:week_start:0; echo
  calendar:week_start:1
because the "gtk20" catalog, provided by GTK2, doesn't exist.

This is the only place gtk20/gtk30 is used,
so replace it with gnc_start_of_week().

Fixes: https://bugs.gnucash.org/show_bug.cgi?id=797623
Fixes: https://bugs.gnucash.org/show_bug.cgi?id=752395
@nabijaczleweli
Copy link
Contributor Author

Indeed; applied.

@Bob-IT
Copy link
Contributor

Bob-IT commented Apr 8, 2024

I agree that this was an over site from gtk2 to 3 but curious on how have you tested this, what OS's.

@nabijaczleweli nabijaczleweli changed the title Fix first-day-of-week detexion in dense calculator (Upcoming Transactions) Fix first-day-of-week detexion in dense calendar (Upcoming Transactions) Apr 8, 2024
@nabijaczleweli
Copy link
Contributor Author

As evident from the top-level post, I just ran it and looked at the calendar. bookworm.

@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented Apr 27, 2024

3-week bump

@christopherlam
Copy link
Contributor

It's a simple fix which looks inadequate... Do you think it's feasible to support start of week on any of the weekdays?

@Bob-IT
Copy link
Contributor

Bob-IT commented May 4, 2024

It's a simple fix which looks inadequate... Do you think it's feasible to support start of week on any of the weekdays?

@christopherlam I did look at this a while back that did allow any start day but required some more testing and refinement.
I will dig it out and create a PR for comment next week.

@jralls
Copy link
Member

jralls commented May 4, 2024

It should be a localization setting. ICU has getFirstDayOfWeek. I found hints that nl_langinfo has added it in the last couple of years but it doesn't show up in the Linux docs.

@nabijaczleweli
Copy link
Contributor Author

ftr gnucash already uses getFirstDayOfWeek() for this

@Bob-IT
Copy link
Contributor

Bob-IT commented May 6, 2024

I have added #PR1935 which was what I was working on last year.

@jralls
Copy link
Member

jralls commented May 13, 2024

Closing in favor of #1935.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants