mirror of
https://github.com/funamitech/mastodon
synced 2025-01-24 10:44:14 +09:00
Merge branch 'main' of https://github.com/glitch-soc/mastodon
This commit is contained in:
commit
8afb64ba3b
@ -7,8 +7,7 @@ import { Helmet } from 'react-helmet';
|
||||
|
||||
import StackTrace from 'stacktrace-js';
|
||||
|
||||
import { source_url } from 'flavours/glitch/initial_state';
|
||||
import { preferencesLink } from 'flavours/glitch/utils/backend_links';
|
||||
import { version, source_url } from 'flavours/glitch/initial_state';
|
||||
|
||||
export default class ErrorBoundary extends PureComponent {
|
||||
|
||||
@ -24,7 +23,7 @@ export default class ErrorBoundary extends PureComponent {
|
||||
componentStack: undefined,
|
||||
};
|
||||
|
||||
componentDidCatch(error, info) {
|
||||
componentDidCatch (error, info) {
|
||||
this.setState({
|
||||
hasError: true,
|
||||
errorMessage: error.toString(),
|
||||
@ -44,88 +43,62 @@ export default class ErrorBoundary extends PureComponent {
|
||||
});
|
||||
}
|
||||
|
||||
handleReload(e) {
|
||||
e.preventDefault();
|
||||
window.location.reload();
|
||||
}
|
||||
handleCopyStackTrace = () => {
|
||||
const { errorMessage, stackTrace, mappedStackTrace } = this.state;
|
||||
const textarea = document.createElement('textarea');
|
||||
|
||||
let contents = [errorMessage, stackTrace];
|
||||
if (mappedStackTrace) {
|
||||
contents.push(mappedStackTrace);
|
||||
}
|
||||
|
||||
textarea.textContent = contents.join('\n\n\n');
|
||||
textarea.style.position = 'fixed';
|
||||
|
||||
document.body.appendChild(textarea);
|
||||
|
||||
try {
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
} catch (e) {
|
||||
|
||||
} finally {
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
|
||||
this.setState({ copied: true });
|
||||
setTimeout(() => this.setState({ copied: false }), 700);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { hasError, errorMessage, stackTrace, mappedStackTrace, componentStack } = this.state;
|
||||
const { hasError, copied, errorMessage } = this.state;
|
||||
|
||||
if (!hasError) return this.props.children;
|
||||
if (!hasError) {
|
||||
return this.props.children;
|
||||
}
|
||||
|
||||
const likelyBrowserAddonIssue = errorMessage && errorMessage.includes('NotFoundError');
|
||||
|
||||
let debugInfo = '';
|
||||
if (stackTrace) {
|
||||
debugInfo += 'Stack trace\n-----------\n\n```\n' + errorMessage + '\n' + stackTrace.toString() + '\n```';
|
||||
}
|
||||
if (mappedStackTrace) {
|
||||
debugInfo += 'Mapped stack trace\n-----------\n\n```\n' + errorMessage + '\n' + mappedStackTrace.toString() + '\n```';
|
||||
}
|
||||
if (componentStack) {
|
||||
if (debugInfo) {
|
||||
debugInfo += '\n\n\n';
|
||||
}
|
||||
debugInfo += 'React component stack\n---------------------\n\n```\n' + componentStack.toString() + '\n```';
|
||||
}
|
||||
|
||||
let issueTracker = source_url;
|
||||
if (source_url.match(/^https:\/\/github\.com\/[^/]+\/[^/]+\/?$/)) {
|
||||
issueTracker = source_url + '/issues';
|
||||
}
|
||||
|
||||
return (
|
||||
<div tabIndex={-1}>
|
||||
<div className='error-boundary'>
|
||||
<h1><FormattedMessage id='web_app_crash.title' defaultMessage="We're sorry, but something went wrong with the Mastodon app." /></h1>
|
||||
<p>
|
||||
<FormattedMessage id='web_app_crash.content' defaultMessage='You could try any of the following:' />
|
||||
</p>
|
||||
<ul>
|
||||
{ likelyBrowserAddonIssue && (
|
||||
<li>
|
||||
<FormattedMessage
|
||||
id='web_app_crash.disable_addons'
|
||||
defaultMessage='Disable browser add-ons or built-in translation tools'
|
||||
/>
|
||||
</li>
|
||||
) }
|
||||
<li>
|
||||
<FormattedMessage
|
||||
id='web_app_crash.report_issue'
|
||||
defaultMessage='Report a bug in the {issuetracker}'
|
||||
values={{ issuetracker: <a href={issueTracker} rel='noopener noreferrer' target='_blank'><FormattedMessage id='web_app_crash.issue_tracker' defaultMessage='issue tracker' /></a> }}
|
||||
/>
|
||||
{ debugInfo !== '' && (
|
||||
<details>
|
||||
<summary><FormattedMessage id='web_app_crash.debug_info' defaultMessage='Debug information' /></summary>
|
||||
<textarea
|
||||
className='web_app_crash-stacktrace'
|
||||
value={debugInfo}
|
||||
rows='10'
|
||||
readOnly
|
||||
/>
|
||||
</details>
|
||||
)}
|
||||
</li>
|
||||
<li>
|
||||
<FormattedMessage
|
||||
id='web_app_crash.reload_page'
|
||||
defaultMessage='{reload} the current page'
|
||||
values={{ reload: <a href='#' onClick={this.handleReload}><FormattedMessage id='web_app_crash.reload' defaultMessage='Reload' /></a> }}
|
||||
/>
|
||||
</li>
|
||||
{ preferencesLink !== undefined && (
|
||||
<li>
|
||||
<FormattedMessage
|
||||
id='web_app_crash.change_your_settings'
|
||||
defaultMessage='Change your {settings}'
|
||||
values={{ settings: <a href={preferencesLink}><FormattedMessage id='web_app_crash.settings' defaultMessage='settings' /></a> }}
|
||||
/>
|
||||
</li>
|
||||
<div className='error-boundary'>
|
||||
<div>
|
||||
<p className='error-boundary__error'>
|
||||
{ likelyBrowserAddonIssue ? (
|
||||
<FormattedMessage id='error.unexpected_crash.explanation_addons' defaultMessage='This page could not be displayed correctly. This error is likely caused by a browser add-on or automatic translation tools.' />
|
||||
) : (
|
||||
<FormattedMessage id='error.unexpected_crash.explanation' defaultMessage='Due to a bug in our code or a browser compatibility issue, this page could not be displayed correctly.' />
|
||||
)}
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{ likelyBrowserAddonIssue ? (
|
||||
<FormattedMessage id='error.unexpected_crash.next_steps_addons' defaultMessage='Try disabling them and refreshing the page. If that does not help, you may still be able to use Mastodon through a different browser or native app.' />
|
||||
) : (
|
||||
<FormattedMessage id='error.unexpected_crash.next_steps' defaultMessage='Try refreshing the page. If that does not help, you may still be able to use Mastodon through a different browser or native app.' />
|
||||
)}
|
||||
</p>
|
||||
|
||||
<p className='error-boundary__footer'>Mastodon v{version} · <a href={source_url} rel='noopener noreferrer' target='_blank'><FormattedMessage id='errors.unexpected_crash.report_issue' defaultMessage='Report issue' /></a> · <button onClick={this.handleCopyStackTrace} className={copied ? 'copied' : ''}><FormattedMessage id='errors.unexpected_crash.copy_stacktrace' defaultMessage='Copy stacktrace to clipboard' /></button></p>
|
||||
</div>
|
||||
|
||||
<Helmet>
|
||||
|
@ -129,7 +129,7 @@ const Firehose = ({ feedType, multiColumn }) => {
|
||||
}
|
||||
break;
|
||||
case 'public':
|
||||
dispatch(expandPublicTimeline({ onlyMedia }));
|
||||
dispatch(expandPublicTimeline({ onlyMedia, allowLocalOnly }));
|
||||
if (signedIn) {
|
||||
disconnect = dispatch(connectPublicStream({ onlyMedia, allowLocalOnly }));
|
||||
}
|
||||
|
@ -1,25 +1,39 @@
|
||||
{
|
||||
"about.fork_disclaimer": "Glitch-Goc یک نرمافزار آزاد است که از Mastodon انشعاب گرفته است.",
|
||||
"account.add_account_note": "افزودن یادداشت برای @{name}",
|
||||
"account.disclaimer_full": "اطلاعات زیر ممکن است نمایه کاربر را کامل منعکس نکند.",
|
||||
"account.joined": "در {date} پیوست",
|
||||
"account.view_full_profile": "مشاهده کامل نمایه",
|
||||
"account_note.cancel": "لغو",
|
||||
"account_note.edit": "ویرایش",
|
||||
"account_note.save": "ذخیره",
|
||||
"advanced_options.icon_title": "گزینههای پیشرفته",
|
||||
"advanced_options.local-only.short": "فقط محلی",
|
||||
"advanced_options.local-only.tooltip": "این فرسته فقط محلی است",
|
||||
"column_header.profile": "نمایه",
|
||||
"compose.attach.upload": "بارگذاری پرونده",
|
||||
"compose.content-type.html": "HTML",
|
||||
"compose.content-type.markdown": "مارکدون",
|
||||
"compose.content-type.plain": "متن ساده",
|
||||
"confirmations.missing_media_description.edit": "ویرایش رسانه",
|
||||
"confirmations.unfilter.author": "نویسنده",
|
||||
"confirmations.unfilter.confirm": "نمایش",
|
||||
"confirmations.unfilter.edit_filter": "ویرایش پالایه",
|
||||
"content-type.change": "نوع محتوا",
|
||||
"empty_column.follow_recommendations": "به نظر نمیتوان هیچ پیشنهادی برایتان ایجاد کرد. میتوانید برای یافتن افرادی که ممکن است بشناسید از جستوجو یا کاوش برچسبهای داغ استفاده کنید.",
|
||||
"endorsed_accounts_editor.endorsed_accounts": "حسابهای پیشنهاد شده",
|
||||
"follow_recommendations.done": "انجام شد",
|
||||
"follow_recommendations.heading": "افرادی را که میخواهید فرستههایشان را ببینید پیگیری کنید! اینها تعدادی پیشنهاد هستند.",
|
||||
"follow_recommendations.lead": "فرستههای افرادی که دنبال میکنید به ترتیب زمانی در خوراک خانهتان نشان داده خواهد شد. از اشتباه کردن نترسید. میتوانید به همین سادگی در هر زمانی از دنبال کردن افراد دست بکشید!",
|
||||
"home.column_settings.advanced": "پیشرفته",
|
||||
"navigation_bar.app_settings": "تنظیمات کاره",
|
||||
"navigation_bar.featured_users": "کاربران پیشنهاد شده",
|
||||
"navigation_bar.keyboard_shortcuts": "میانبرهای صفحهکلید",
|
||||
"notification.markForDeletion": "علامتگذاری برای حذف",
|
||||
"notification_purge.btn_all": "انتخاب همه",
|
||||
"onboarding.done": "انجام شد",
|
||||
"onboarding.page_one.federation": "{domain} is an \"instance\" of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.",
|
||||
"onboarding.page_one.federation": "{domain} یک \"نمونه\" از ماستودون است. ماستودون شبکه ای از کارسازهای مستقل است که برای ایجاد یک شبکه اجتماعی بزرگتر به هم می پیوندند. ما این کارسازها را نمونه می نامیم.",
|
||||
"onboarding.page_one.welcome": "به {domain} خوش آمدید!",
|
||||
"onboarding.page_six.github": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}. Glitchsoc is fully compatible with all Mastodon apps and instances. Glitchsoc is free open-source software. You can report bugs, request features, or contribute to the code on {github}.",
|
||||
"onboarding.page_six.various_app": "کارههای موبایل",
|
||||
"search_popout.tips.user": "کاربر",
|
||||
@ -32,8 +46,13 @@
|
||||
"settings.pop_in_right": "راست",
|
||||
"settings.preferences": "ترجیحات کاربر",
|
||||
"settings.shared_settings_link": "ترجیحات کاربر",
|
||||
"settings.side_arm.none": "هیچ یک",
|
||||
"settings.status_icons": "نقشکهای توت",
|
||||
"status.in_reply_to": "این توت یک پاسخ است",
|
||||
"status.is_poll": "این توت یک نظرسنجی است",
|
||||
"status.sensitive_toggle": "برای مشاهده کلیک کنید",
|
||||
"web_app_crash.debug_info": "اطلاعات اشکالزدایی",
|
||||
"web_app_crash.reload": "نوسازی",
|
||||
"web_app_crash.settings": "تنظیمات"
|
||||
"web_app_crash.settings": "تنظیمات",
|
||||
"web_app_crash.title": "متأسفیم، اما مشکلی در کاره ماستودون رخ داد."
|
||||
}
|
||||
|
@ -4,7 +4,9 @@
|
||||
"account.disclaimer_full": "下面的資訊可能不完全反映使用者的個人資料。",
|
||||
"account.follows": "跟隨",
|
||||
"account.joined": "加入於 {date}",
|
||||
"account.mute_notifications": "靜音來自 @{name} 的通知",
|
||||
"account.suspended_disclaimer_full": "使用者已被管理者停權。",
|
||||
"account.unmute_notifications": "重新接收來自 @{name} 的通知",
|
||||
"account.view_full_profile": "查看完整個人資料",
|
||||
"account_note.cancel": "取消",
|
||||
"account_note.edit": "編輯",
|
||||
|
@ -200,6 +200,7 @@ button {
|
||||
}
|
||||
}
|
||||
|
||||
.error-boundary,
|
||||
.app-holder noscript {
|
||||
flex-direction: column;
|
||||
font-size: 16px;
|
||||
|
@ -1,30 +0,0 @@
|
||||
.error-boundary {
|
||||
color: $primary-text-color;
|
||||
font-size: 15px;
|
||||
line-height: 20px;
|
||||
|
||||
h1 {
|
||||
font-size: 26px;
|
||||
line-height: 36px;
|
||||
font-weight: 400;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $primary-text-color;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: disc;
|
||||
margin-inline-start: 0;
|
||||
padding-inline-start: 1em;
|
||||
}
|
||||
|
||||
textarea.web_app_crash-stacktrace {
|
||||
width: 100%;
|
||||
resize: none;
|
||||
white-space: pre;
|
||||
font-family: $font-monospace, monospace;
|
||||
}
|
||||
}
|
@ -17,7 +17,6 @@
|
||||
@import 'lists';
|
||||
@import 'emoji_picker';
|
||||
@import 'local_settings';
|
||||
@import 'error_boundary';
|
||||
@import 'single_column';
|
||||
@import 'announcements';
|
||||
@import 'explore';
|
||||
|
@ -1 +1,11 @@
|
||||
---
|
||||
fa:
|
||||
admin:
|
||||
settings:
|
||||
hide_followers_count:
|
||||
title: نهفتن تعداد پیگیران
|
||||
other:
|
||||
title: ديگر
|
||||
appearance:
|
||||
localization:
|
||||
glitch_guide_link: https://crowdin.com/project/glitch-soc
|
||||
|
Loading…
Reference in New Issue
Block a user