Skip to content

Commit

Permalink
fix: make all labels translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau committed Feb 3, 2024
1 parent 2d93592 commit 6cd47af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
14 changes: 5 additions & 9 deletions js/src/forum/components/MobileTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,13 @@ export default class MobileTab extends Component {
} else if ('askvortsov-categories' in flarum.extensions) {
items.add(
'categories',
<MobileTabItem
route={app.route('categories')}
icon="fas fa-th-list"
label={app.translator.trans('askvortsov-categories.forum.index.categories_link')}
/>,
<MobileTabItem route={app.route('categories')} icon="fas fa-th-list" label={app.translator.trans('acpl-mobile-tab.forum.categories')} />,
90
);
} else if ('flarum-tags' in flarum.extensions) {
items.add(
'tags',
<MobileTabItem route={app.route('tags')} icon="fas fa-tags" label={app.translator.trans('flarum-tags.forum.index.tags_link')} />,
<MobileTabItem route={app.route('tags')} icon="fas fa-tags" label={app.translator.trans('acpl-mobile-tab.forum.tags')} />,
90
);
}
Expand All @@ -59,11 +55,11 @@ export default class MobileTab extends Component {
<LinkButton
href={app.route('notifications')}
icon="fas fa-bell"
title={app.translator.trans('core.forum.notifications.title')}
title={app.translator.trans('acpl-mobile-tab.forum.notifications')}
className="Dropdown NotificationsDropdown"
>
{unread ? <span className="NotificationsDropdown-unread">{unread}</span> : ''}
{app.translator.trans('core.forum.notifications.title')}
{app.translator.trans('acpl-mobile-tab.forum.notifications')}
</LinkButton>,
80
);
Expand All @@ -73,7 +69,7 @@ export default class MobileTab extends Component {
items.add(
'logIn',
<Button icon="fas fa-user" className="Button Button--link" onclick={() => app.modal.show(LogInModal, {})}>
{app.translator.trans('core.forum.header.log_in_link')}
{app.translator.trans('acpl-mobile-tab.forum.log_in')}
</Button>,
70
);
Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/components/MobileTabSessionDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export default class MobileTabSessionDropdown extends SessionDropdown {
const user = app.session.user;

// The username can be long, so it is better to display "Profile"
return [avatar(user), ' ', <span className="Button-label">{app.translator.trans('core.forum.header.profile_button')}</span>];
return [avatar(user), ' ', <span className="Button-label">{app.translator.trans('acpl-mobile-tab.forum.profile')}</span>];
}
}
5 changes: 5 additions & 0 deletions locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ acpl-mobile-tab:
forum:
home: 'Home'
all_discussions: 'Discussions'
tags: => flarum-tags.forum.index.tags_link
categories: => askvortsov-categories.forum.index.categories_link
notifications: => core.forum.notifications.title
log_in: => core.forum.header.log_in_link
profile: => core.forum.header.profile_button

0 comments on commit 6cd47af

Please sign in to comment.