Skip to content

Commit

Permalink
Merge pull request #425 from yang991178/1.1.1
Browse files Browse the repository at this point in the history
Version 1.1.1
  • Loading branch information
yang991178 authored Jun 9, 2022
2 parents 8165797 + efb704c commit d5ab8bf
Show file tree
Hide file tree
Showing 19 changed files with 608 additions and 28 deletions.
3 changes: 1 addition & 2 deletions dist/article/article.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
html,
body {
margin: 0;
font-family: "Segoe UI", "Source Han Sans SC Regular", "Microsoft YaHei",
sans-serif;
font-family: "Segoe UI", "Source Han Sans Regular", sans-serif;
}
body {
padding: 12px 96px 32px;
Expand Down
19 changes: 17 additions & 2 deletions dist/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,27 @@ body.darwin {
html,
body {
background-color: transparent;
font-family: "Segoe UI", "Source Han Sans SC Regular", "Microsoft YaHei",
sans-serif;
font-family: "Segoe UI", "Source Han Sans Regular", sans-serif;
height: 100%;
overflow: hidden;
margin: 0;
}
body:lang(zh-CN) {
font-family: "Segoe UI", "Source Han Sans SC Regular", "Microsoft YaHei",
sans-serif;
}
body:lang(zh-TW) {
font-family: "Segoe UI", "Source Han Sans TC Regular", "Microsoft JhengHei",
sans-serif;
}
body:lang(ja) {
font-family: "Segoe UI", "Source Han Sans JP Regular", "Yu Gothic UI",
sans-serif;
}
body:lang(ko) {
font-family: "Segoe UI", "Source Han Sans KR Regular", "Malgun Gothic",
sans-serif;
}
body.win32,
body.linux {
background-color: var(--neutralLighterAlt);
Expand Down
5 changes: 4 additions & 1 deletion electron-builder-mas.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
appId: DevHYLiu.FluentReader
buildVersion: 25
buildVersion: 26
productName: Fluent Reader
copyright: Copyright © 2020 Haoyuan Liu
files:
Expand Down Expand Up @@ -29,6 +29,9 @@ mac:
- it
- nl
- ko
- ru
- pt_BR
- pt_PT
minimumSystemVersion: 10.14.0
mas:
entitlements: build/entitlements.mas.plist
Expand Down
6 changes: 6 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ mac:
- it
- nl
- ko
- ru
- pt_BR
- pt_PT
win:
target:
- nsis
Expand All @@ -49,6 +52,9 @@ appx:
- it
- nl
- ko
- ru
- pt-BR
- pt-PT
showNameOnTiles: true
setBuildNumber: true
nsis:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fluent-reader",
"version": "1.1.0",
"version": "1.1.1",
"description": "Modern desktop RSS reader",
"main": "./dist/electron.js",
"scripts": {
Expand Down
22 changes: 14 additions & 8 deletions src/components/article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,22 @@ class Article extends React.Component<ArticleProps, ArticleState> {
}
loadFull = async () => {
this.setState({ fullContent: "", loaded: false, error: false })
const link = this.props.item.link
try {
const result = await fetch(this.props.item.link)
const result = await fetch(link)
if (!result || !result.ok) throw new Error()
const html = await decodeFetchResponse(result, true)
this.setState({ fullContent: html })
if (link === this.props.item.link) {
this.setState({ fullContent: html })
}
} catch {
this.setState({
loaded: true,
error: true,
errorDescription: "MERCURY_PARSER_FAILURE",
})
if (link === this.props.item.link) {
this.setState({
loaded: true,
error: true,
errorDescription: "MERCURY_PARSER_FAILURE",
})
}
}
}

Expand Down Expand Up @@ -467,7 +472,8 @@ class Article extends React.Component<ArticleProps, ArticleState> {
className={this.state.error ? "error" : ""}
key={
this.props.item._id +
(this.state.loadWebpage ? "_" : "")
(this.state.loadWebpage ? "_" : "") +
(this.state.loadFull ? "__" : "")
}
src={
this.state.loadWebpage
Expand Down
7 changes: 6 additions & 1 deletion src/components/cards/compact-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ const CompactCard: React.FunctionComponent<Card.Props> = props => (
text={props.item.title}
filter={props.filter}
title
dir={props.source.textDir}
/>
</span>
<span className="snippet">
<Highlights text={props.item.snippet} filter={props.filter} />
<Highlights
text={props.item.snippet}
filter={props.filter}
dir={props.source.textDir}
/>
</span>
</div>
<Time date={props.item.date} />
Expand Down
13 changes: 11 additions & 2 deletions src/components/cards/default-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ const DefaultCard: React.FunctionComponent<Card.Props> = props => (
) : null}
<CardInfo source={props.source} item={props.item} />
<h3 className="title">
<Highlights text={props.item.title} filter={props.filter} title />
<Highlights
text={props.item.title}
filter={props.filter}
title
dir={props.source.textDir}
/>
</h3>
<p className={"snippet" + (props.item.thumb ? "" : " show")}>
<Highlights text={props.item.snippet} filter={props.filter} />
<Highlights
text={props.item.snippet}
filter={props.filter}
dir={props.source.textDir}
/>
</p>
</div>
)
Expand Down
16 changes: 15 additions & 1 deletion src/components/cards/highlights.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as React from "react"
import { validateRegex } from "../../scripts/utils"
import { FeedFilter, FilterType } from "../../scripts/models/feed"
import { SourceTextDirection } from "../../scripts/models/source"

type HighlightsProps = {
text: string
filter: FeedFilter
title?: boolean
dir?: SourceTextDirection
}

const Highlights: React.FunctionComponent<HighlightsProps> = props => {
Expand Down Expand Up @@ -57,10 +59,22 @@ const Highlights: React.FunctionComponent<HighlightsProps> = props => {
}
}

const testStyle = {
direction: "inherit",
} as React.CSSProperties
if (props.dir === SourceTextDirection.RTL) {
testStyle.direction = "rtl"
}
return (
<>
{spans.map(([text, flag]) =>
flag ? <span className="h">{text}</span> : text
flag ? (
<div className="h" style={testStyle}>
{text}
</div>
) : (
<div style={testStyle}>{text}</div>
)
)}
</>
)
Expand Down
2 changes: 2 additions & 0 deletions src/components/cards/list-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ const ListCard: React.FunctionComponent<Card.Props> = props => (
text={props.item.title}
filter={props.filter}
title
dir={props.source.textDir}
/>
</h3>
{Boolean(props.viewConfigs & ViewConfigs.ShowSnippet) && (
<p className="snippet">
<Highlights
text={props.item.snippet}
filter={props.filter}
dir={props.source.textDir}
/>
</p>
)}
Expand Down
2 changes: 2 additions & 0 deletions src/components/cards/magazine-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ const MagazineCard: React.FunctionComponent<Card.Props> = props => (
text={props.item.title}
filter={props.filter}
title
dir={props.source.textDir}
/>
</h3>
<p className="snippet">
<Highlights
text={props.item.snippet}
filter={props.filter}
dir={props.source.textDir}
/>
</p>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/settings/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ class AppTab extends React.Component<AppTabProps, AppTabState> {
{ key: "it", text: "Italiano" },
{ key: "nl", text: "Nederlands" },
{ key: "pt-BR", text: "Português do Brasil" },
{ key: "pt-PT", text: "Português de Portugal" },
{ key: "fi-FI", text: "Suomi" },
{ key: "sv", text: "Svenska" },
{ key: "tr", text: "Türkçe" },
{ key: "uk", text: "Українська" },
{ key: "ru", text: "Русский" },
{ key: "ko", text: "한글" },
{ key: "ja", text: "日本語" },
{ key: "zh-CN", text: "中文(简体)" },
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Currently, Fluent Reader supports the following languages.
| nl | Nederlands | [@Vistaus](https://github.com/Vistaus) |
| it | Italiano | [@andrewasd](https://github.com/andrewasd) |
| pt-BR | Português do Brasil | [@fabianski7](https://github.com/fabianski7) |
| pt-PT | Português de Portugal | [@0x1336](https://github.com/0x1336) |
| ko | 한글 | [@1drive](https://github.com/1drive) |
| ru | Russian | [@nxblnd](https://github.com/nxblnd) |

Refer to the repo of [react-intl-universal](https://github.com/alibaba/react-intl-universal) to get started on internationalization.
4 changes: 4 additions & 0 deletions src/scripts/i18n/_locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import sv from "./sv.json"
import tr from "./tr.json"
import it from "./it.json"
import uk from "./uk.json"
import ru from "./ru.json"
import pt_BR from "./pt-BR.json"
import fi_FI from "./fi-FI.json"
import ko from "./ko.json"
import pt_PT from "./pt-PT.json"

const locales = {
"en-US": en_US,
Expand All @@ -27,9 +29,11 @@ const locales = {
"tr": tr,
"it": it,
"uk": uk,
"ru": ru,
"pt-BR": pt_BR,
"fi-FI": fi_FI,
"ko": ko,
"pt-PT": pt_PT,
}

export default locales
Loading

0 comments on commit d5ab8bf

Please sign in to comment.