Skip to content

Commit

Permalink
Add: #465 時限投稿などの翻訳 (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode authored Feb 5, 2024
1 parent 4e1e675 commit f30b6f5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
7 changes: 2 additions & 5 deletions app/javascript/mastodon/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ export const defaultMediaVisibility = (status) => {
};

const messages = defineMessages({
public_short: { id: 'privacy.public.short', defaultMessage: 'Public' },
unlisted_short: { id: 'privacy.unlisted.short', defaultMessage: 'Quiet public' },
private_short: { id: 'privacy.private.short', defaultMessage: 'Followers' },
direct_short: { id: 'privacy.direct.short', defaultMessage: 'Specific people' },
limited_short: { id: 'privacy.limited.short', defaultMessage: 'Limited' },
edited: { id: 'status.edited', defaultMessage: 'Edited {date}' },
});

Expand Down Expand Up @@ -612,7 +609,7 @@ class Status extends ImmutablePureComponent {
const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status);
const expanded = !status.get('hidden') || status.get('spoiler_text').length === 0;

const withLimited = status.get('visibility_ex') === 'limited' && status.get('limited_scope') ? <span className='status__visibility-icon'><Icon id='get-pocket' icon={LimitedIcon} title='Limited' /></span> : null;
const withLimited = status.get('visibility_ex') === 'limited' && status.get('limited_scope') ? <span className='status__visibility-icon'><Icon id='get-pocket' icon={LimitedIcon} title={intl.formatMessage(messages.limited_short)} /></span> : null;
const withQuote = status.get('quote_id') ? <span className='status__visibility-icon'><Icon id='quote-right' icon={QuoteIcon} title='Quote' /></span> : null;
const withReference = (!withQuote && status.get('status_references_count') > 0) ? <span className='status__visibility-icon'><Icon id='link' icon={ReferenceIcon} title='Reference' /></span> : null;
const withExpiration = status.get('expires_at') ? <span className='status__visibility-icon'><Icon id='clock-o' icon={TimerIcon} title='Expiration' /></span> : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ import { Icon } from 'mastodon/components/icon';

const messages = defineMessages({
add_expiration: { id: 'status.expiration.add', defaultMessage: 'Set status expiration' },
expiration_5_minutes: { id: 'status.expiration.5_minutes', defaultMessage: 'Remove 5 minutes later' },
expiration_30_minutes: { id: 'status.expiration.30_minutes', defaultMessage: 'Remove 30 minutes later' },
expiration_1_hour: { id: 'status.expiration.1_hour', defaultMessage: 'Remove 1 hour later' },
expiration_3_hours: { id: 'status.expiration.3_hours', defaultMessage: 'Remove 3 hours later' },
expiration_12_hours: { id: 'status.expiration.12_hours', defaultMessage: 'Remove 12 hours later' },
expiration_1_day: { id: 'status.expiration.1_day', defaultMessage: 'Remove 1 day later' },
expiration_7_days: { id: 'status.expiration.7_days', defaultMessage: 'Remove 7 days later' },
});

const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true;
Expand Down Expand Up @@ -203,14 +210,16 @@ class ExpirationDropdown extends PureComponent {
};

componentWillMount () {
const { intl } = this.props;

this.options = [
{ value: '#exp5m', text: '#exp5m (5 minutes)' },
{ value: '#exp30m', text: '#exp30m (30 minutes)' },
{ value: '#exp1h', text: '#exp1h (1 hour)' },
{ value: '#exp3h', text: '#exp3h (3 hours)' },
{ value: '#exp12h', text: '#exp12h (12 hours)' },
{ value: '#exp1d', text: '#exp1d (1 day)' },
{ value: '#exp7d', text: '#exp7d (7 days)' },
{ value: '#exp5m', text: intl.formatMessage(messages.expiration_5_minutes) },
{ value: '#exp30m', text: intl.formatMessage(messages.expiration_30_minutes) },
{ value: '#exp1h', text: intl.formatMessage(messages.expiration_1_hour) },
{ value: '#exp3h', text: intl.formatMessage(messages.expiration_3_hours) },
{ value: '#exp12h', text: intl.formatMessage(messages.expiration_12_hours) },
{ value: '#exp1d', text: intl.formatMessage(messages.expiration_1_day) },
{ value: '#exp7d', text: intl.formatMessage(messages.expiration_7_days) },
];
}

Expand Down
7 changes: 7 additions & 0 deletions app/javascript/mastodon/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,13 @@
"status.embed": "Embed",
"status.emoji_reaction": "Emoji reaction",
"status.emoji_reaction.pick": "Pick emoji reaction",
"status.expiration.5_minutes": "Remove 5 minutes later",
"status.expiration.30_minutes": "Remove 30 minutes later",
"status.expiration.1_hour": "Remove 1 hour later",
"status.expiration.3_hours": "Remove 3 hours later",
"status.expiration.12_hours": "Remove 12 hours later",
"status.expiration.1_day": "Remove 1 day later",
"status.expiration.7_days": "Remove 7 days later",
"status.expiration.add": "Set status expired time",
"status.favourite": "Favorite",
"status.filter": "Filter this post",
Expand Down
9 changes: 9 additions & 0 deletions app/javascript/mastodon/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@
"compose_form.poll.duration": "アンケート期間",
"compose_form.poll.switch_to_multiple": "複数選択に変更",
"compose_form.poll.switch_to_single": "単一選択に変更",
"compose_form.publish": "投稿",
"compose_form.publish_form": "投稿",
"compose_form.reply": "返信",
"compose_form.spoiler.marked": "本文は警告の後ろに隠されます",
"compose_form.spoiler.unmarked": "本文は隠されていません",
"confirmation_modal.cancel": "キャンセル",
Expand Down Expand Up @@ -772,6 +774,13 @@
"status.embed": "埋め込み",
"status.emoji_reaction": "絵文字リアクション",
"status.emoji_reaction.pick": "絵文字を追加する",
"status.expiration.5_minutes": "5 分後に削除",
"status.expiration.30_minutes": "30 分後に削除",
"status.expiration.1_hour": "1 時間後に削除",
"status.expiration.3_hours": "3 時間後に削除",
"status.expiration.12_hours": "12 時間後に削除",
"status.expiration.1_day": "1 日後に削除",
"status.expiration.7_days": "7 日後に削除",
"status.expiration.add": "時限投稿を設定",
"status.favourite": "お気に入り",
"status.filter": "この投稿をフィルターする",
Expand Down

0 comments on commit f30b6f5

Please sign in to comment.