Skip to content

Commit

Permalink
Set up Create User modal help for translation
Browse files Browse the repository at this point in the history
Implements the TODO comment I had added earlier.
  • Loading branch information
rmunn committed May 13, 2024
1 parent 4b0d557 commit a3e2e5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 5 additions & 9 deletions frontend/src/lib/components/Users/CreateUserModal.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script lang="ts">
import { Modal } from '$lib/components/modals';
// import t from '$lib/i18n'; // TODO
import t from '$lib/i18n';
import { helpLinks } from '$lib/components/help';
import CreateUser from '$lib/components/Users/CreateUser.svelte';
import Markdown from 'svelte-exmarkdown';
import { NewTabLinkRenderer } from '$lib/components/Markdown';
let createUserModal: Modal;
Expand All @@ -12,13 +14,7 @@
</script>

<Modal bind:this={createUserModal} bottom>
<!-- TODO: Move to en.json and use $t -->
<p>
Did you know you can also <a class="link" rel="external" href={helpLinks.addProjectMember}>create users on a project page</a>? That also allows you to make those users members of the project in one step;
users created here will not be members of any project and will need a second step to add them to a project.
</p>
<p>
If you want to create multiple users at once, the best way is probably to use the <a class="link" rel="external" href={helpLinks.bulkAddCreate}>Bulk Add/Create Project Members</a> tool.
</p>
<Markdown md={$t('admin_dashboard.create_user_modal.help_create_single_guest_user', helpLinks)} plugins={[{ renderer: { a: NewTabLinkRenderer } }]} />
<Markdown md={$t('admin_dashboard.create_user_modal.help_create_bulk_guest_users', helpLinks)} plugins={[{ renderer: { a: NewTabLinkRenderer } }]} />
<CreateUser autoLogin={false} onSubmit={() => createUserModal.submitModal()} />
</Modal>
2 changes: 2 additions & 0 deletions frontend/src/lib/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
},
"create_user_modal": {
"create_user": "Create User",
"help_create_single_guest_user": "Did you know you can also [create users on a project page]({addProjectMember})? That also allows you to make those users members of the project in one step; users created here will not be members of any project and will need a second step to add them to a project.",
"help_create_bulk_guest_users": "If you want to create multiple users at once, the best way is probably to use the [Bulk Add/Create Project Members]({bulkAddCreate}) tool.",
},
"user_details_modal": {
"registered": "Registered",
Expand Down

0 comments on commit a3e2e5d

Please sign in to comment.