Repository navigation
Conversation
calendar system switches from Gregorian to Jalali based on time zone
| background-color: var(--background-color-light); | ||
| color: var(--font-color); | ||
| font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", "PingFang SC", "Microsoft YaHei", sans-serif; | ||
| font-family: "Vazirmatn", "OpenSans", "Cantarell", "Helvetica", "Arial", "PingFang SC", "Microsoft YaHei", sans-serif; |
There was a problem hiding this comment.
The RTL files are automatically generated, so a processing directive would be better.
Perhaps something like:
| font-family: "Vazirmatn", "OpenSans", "Cantarell", "Helvetica", "Arial", "PingFang SC", "Microsoft YaHei", sans-serif; | |
| font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", "PingFang SC", "Microsoft YaHei", sans-serif /*rtl:prepend:"Vazirmatn", */; |
There was a problem hiding this comment.
Er, in the non-RTL file that is, don't apply these suggestions as is. ;-)
| @@ -1,4 +1,5 @@ | |||
| @charset "UTF-8"; | |||
| @import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap'); | |||
There was a problem hiding this comment.
Same, but with something like:
| @import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap'); | |
| /*rtl:raw:@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');*/ |
There was a problem hiding this comment.
I would rather avoid a query to a Google server if possible. Could this font be exported to be used locally?
There was a problem hiding this comment.
Yes it could be used locally. But first i need to look into themes structure so i can implement it better...
There was a problem hiding this comment.
have a look into the CSS @font-face.
Font files are stored in the directory /p/themes/fonts
|
For internal developers: We need to find out what to do with those fonts. We might not be able to satisfy all use cases with an identical declaration (cf. e.g. #5671). Maybe a menu to change the font independently of the theme, or a list of fonts that depends on the language... What do you think @math-GH @Frenzie ? |
|
It is very nice to see that FreshRSS is used around the globe. It is very important that the community gives input from their language/local needs. What could help me to understand the current situation better? @qasedak Could you please paste a screenshot here how it looks like before the PR without this specific font family? |
strict_types must be on the first line
|
@math-GH , the font family is no big deal it's just a more appealing font for Arabic, Persian, ... |
A UI language dependency sounds problematic to me. Even as a correlation that's quite weak. We should probably distinguish between fonts that might be installed on the OS (is there any harm?) and web fonts (better to avoid downloading them unnecessarily). But I would start to write it a bit differently, i.e. font-family:
/* generic */
Helvetica, Tex Gyre Pagella, blah blah,
/* Japanese */
Mac Japanese Font, Win Japanese font,
/* Persian */
etc.
Yes, ultimately that makes the most sense to me, though I'll point out this can also quite easily be done with the CustomCSS. |
| $userLanguage = FreshRSS_Context::$user_conf->language; | ||
| if ($raw) { | ||
| return $this->date; | ||
| } else if ($userTimezone == 'Asia/Tehran' || $userTimezone == 'Asia/Kabul') { |
There was a problem hiding this comment.
I am not knowledgeable enough. A few points for which I have doubts:
- are all users of this timezone using this calendar?
- isn't this calendar used in other timezones, for instance when people travel?
In other words, I believe we might need a new selector option in the UI
There was a problem hiding this comment.
are all users of this timezone using this calendar?
Indeed, that goes both ways. It could make sense as a default but it's otherwise more or less identical to the font issue.
There was a problem hiding this comment.
In Iran and Afghanistan it's the official calendar. Also I like to add Hijri calendar system which is common in Arab and Islamic countries. If we add an option (like regional format in windows) for users to select their preferred calendar system it would be a better way I think.
There was a problem hiding this comment.
Maybe picking another library then? https://packagist.org/?query=Jalali%20Hijri
https://github.com/fisharebest/ext-calendar seems to be quite popular and well maintained.
Could you check whether that could work for you?
| */ | ||
|
|
||
| /* F */ | ||
| function jdate($format, $timestamp = '', $none = '', $time_zone = 'Asia/Tehran', $tr_num = 'fa') { |
There was a problem hiding this comment.
Is there a version of this library (or equivalent) that exists on https://packagist.org so that we could depend on it through composer?
There was a problem hiding this comment.
There was a problem hiding this comment.
Co-authored-by: Luc SANCHEZ <[email protected]>


Jalali is the official calendar in Iran and Afghanistan, so it would be nice to support jalali calendar for their time zones.
Changes proposed in this pull request: