Skip to content

Commit

Permalink
Merge pull request moodle#5 from lucaboesch/multilang_packages
Browse files Browse the repository at this point in the history
Multilang packages
  • Loading branch information
srobotta authored Mar 8, 2024
2 parents 9404f86 + 9799084 commit 6f558cc
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import type { SelectOptionsMulti } from '@moodlenet/react-app/ui'
import type { FC } from 'react'
import { useMemo, useState } from 'react'
import { t } from '@moodlenet/react-app/webapp'

export type AddToCollectionButtonProps = {
collections: SelectOptionsMulti<OptionItemProp>
Expand All @@ -29,14 +30,14 @@ export const AddToCollectionButton: FC<AddToCollectionButtonProps> = ({

const modal = isAddingToCollection && collections && (
<Modal
title={`Select collections`}
title={t('select_collections')}
actions={
<PrimaryButton
onClick={() => {
setIsAddingToCollection(false)
}}
>
Done
{t('done')}
</PrimaryButton>
}
onClose={() => setIsAddingToCollection(false)}
Expand All @@ -50,7 +51,7 @@ export const AddToCollectionButton: FC<AddToCollectionButtonProps> = ({
value={selectedValues}
>
{collections.opts.map(({ label, value }) => (
<OptionItem key={value} label={label !== '' ? label : 'Unnamed'} value={value} />
<OptionItem key={value} label={label !== '' ? label : {t('unnamed')}} value={value} />
))}
</AddToCollectionsCard>
</Modal>
Expand All @@ -60,7 +61,7 @@ export const AddToCollectionButton: FC<AddToCollectionButtonProps> = ({
<>
{modal}
<SecondaryButton onClick={() => setIsAddingToCollection(true)}>
Add to collection
{t('add_to_collection')}
</SecondaryButton>
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Card } from '@moodlenet/component-library'
import type { Href } from '@moodlenet/react-app/common'
import { Link } from '@moodlenet/react-app/ui'
import type { FC } from 'react'
import { t } from '@moodlenet/react-app/webapp'
import defaultAvatar from '../../../assets/img/default-avatar.svg'
import './CollectionContributorCard.scss'

Expand All @@ -22,7 +23,7 @@ export const CollectionContributorCard: FC<CollectionContributorCardProps> = ({
<img className="avatar" src={avatarUrl || defaultAvatar} alt="Avatar" />
</Link>
<div className="description">
Collection curated by <Link href={creatorProfileHref}>{displayName}</Link>
{t('collection_curated_by')} <Link href={creatorProfileHref}>{displayName}</Link>
</div>
</Card>
)
Expand Down
34 changes: 32 additions & 2 deletions packages/react-app/src/locales/de/translation.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,30 @@ import type { Translations } from '../../webapp/types/i18n.mjs'

export const translations: Translations = {
add_content: 'Inhalte hinzufügen',
add_to_collection: 'Zur Sammlung hinzufügen',
admin: 'Admin',
agree_terms_conditions: 'Du stimmst den Nutzungsbedingungen zu',
ambitious_seed: 'Ehrgeiziger Samen',
approve: 'Freigeben',
approved_badge: 'Freigabe erteilt, dein Inhalt ist jetzt für alle sichtbar.',
avatar: 'Profilbild',
background: 'Hintergrund',
back_soon: 'Wir sind bald wieder da',
best_collection_ever: 'Beste Sammlung überhaupt',
bookmark: 'Lesezeichen',
bookmark_needs_login: 'Einloggen oder registieren um ein Lesezeichen zu setzen',
bookmark_remove: 'Lesezeichen entfernen',
bookmarks: 'Lesezeichen',
collection_curated_by: 'Sammlung kuratiert von',
create_account: 'Neues Nutzendenkonto erstellen',
curated_collections: 'Kuratierte Sammlungen',
dont_show_again: 'Nicht mehr anzeigen',
dazzling_biome: 'Faszinierendes Biotop',
determined_sprout: 'Entschlossener Spross',
display_name: 'Anzeigename',
done: 'Fertig',
dont_show_again: 'Nicht mehr anzeigen',
edit_background: 'Hintergrund bearbeiten',
edit_profile_picture: 'Profilbild bearbeiten',
enter_your_account: 'Zum Nutzendenkonto',
file_too_big: 'Die Datei ist zu gross, reduziere die Grösse oder gib eine URL an',
firmly_grounded: 'Fest verwurzelt',
Expand All @@ -34,16 +43,25 @@ export const translations: Translations = {
interest_title: 'Verbessere deine Erfahrung!',
image_too_big: 'Das Bild ist zu gross, reduziere die Grösse oder verwende ein anderes Bild',
join_now: 'Jetzt beitreten',
learn_more: 'Mehr erfahren',
leaves: 'Blätter',
level: 'Level',
level_avatar: 'Level-Symbol',
like: 'Gefällt mir',
like_needs_login: 'Einloggen oder registieren um zu liken',
like_own_content: 'Du kannst nicht deinen eigenen Inhalten liken',
like_remove: 'Gefällt mir entfernen',
load_more: 'Mehr laden',
location: 'Ort',
login: 'Einloggen',
login_or_signup_to_send_messages: 'Einloggen oder registieren um Nachrichten zu senden',
logout: 'Ausloggen',
log_in_desc: 'Einloggen oder registieren um Inhalt zu veröffentlichen',
moodlenet_community: 'MoodleNet Community',
more_actions: 'Mehr Aktionen',
myfollowers: 'Meine Folgenden',
new_collection: 'Neue Sammlung',
new_like_on_your_resource: 'Neuer Like auf deiner Ressource',
new_resource: 'Neue Ressource',
override_subtitle: 'Dies ist das OER-Repository der Berner Fachhochschule.',
override_title: 'Die Lehre von morgen gestalten',
Expand All @@ -56,9 +74,11 @@ export const translations: Translations = {
please_select_year: 'Bitte ein Jahr auswählen',
please_upload_content: 'Bitte einen Inhalt hochladen',
profile: 'Profil',
publish_collection: 'Sammlung veröffentlichen',
publish_content: 'Inhalte veröffentlichen',
publish_resource: 'Ressource veröffentlichen',
resources: 'Ressourcen',
rooted_learner: 'Verwurzelter Lernender',
rooted_learner: 'Verwurzelte*r Lernende*r',
scheduled_maintenance:
'MoodleNet ist für eine geplante Wartung nicht verfügbar und wird in wenigen Minuten wieder online sein',
search_placeholder: 'Nach OER-Inhalten suchen',
Expand All @@ -69,8 +89,14 @@ export const translations: Translations = {
see_more_resources: 'Weitere Ressourcen',
select_language: 'Sprache auswählen',
settings: 'Einstellungen',
select_collections: 'Sammlungen auswählen',
select_license: 'Lizenz auswählen',
send_a_message: 'Nachricht senden',
sfollowers: '\'s Folgende',
sfollowing: ' folgt',
set_up_interests: 'Interessen einrichten',
share_content: 'Inhalte teilen',
signup: 'Registrieren',
sky_reacher: 'Himmelstürmer*in',
sort_by: 'Sortieren nach',
signup: 'Registrieren',
Expand All @@ -92,6 +118,7 @@ export const translations: Translations = {
title_featured_resources: 'Aktuelle Ressourcen',
title_leaderboard: 'Leaderboard',
unapprove: 'Sperren',
unnamed: 'Unbenannt',
user_menu: 'Nutzendenmenü',
user_subtitle_featured_authors: 'Top Autor*innen, die dich ansprechen könnten',
user_subtitle_featured_collections:
Expand All @@ -103,7 +130,10 @@ export const translations: Translations = {
versatile_canopy: 'Vielseitiges Blätterdach',
visibility_required: 'Sichtbarkeit ist erforderlich',
we_love_to_get: 'Wir freuen uns über',
website: 'Webseite',
what_do_you_want_to_publish: 'Was möchtest du gerne veröffentlichen?',
what_should_others_know_about_you: 'Was sollten andere über dich wissen?',
you_can_suggest: 'Du kannst neue Funktionen vorschlagen und Fehler melden in der',
your_feedback: 'Dein Feedback zu MoodleNet',
your_resource_added_in_a_collection: 'Deine Ressource wurde in einer Sammlung hinzugefügt',
}
48 changes: 45 additions & 3 deletions packages/react-app/src/locales/en/translation.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,41 @@ import type { Translations } from '../../webapp/types/i18n.mjs'

export const translations: Translations = {
add_content: 'Add content',
add_someone_elses_resource_in_published_collection:
"Add someone else's resource in your published collection",
add_to_collection: 'Add to collection',
admin: 'Admin',
agree_terms_conditions: 'You agree to our Terms &amp; Conditions',
ambitious_seed: 'Ambitious seed',
approve: 'Approve',
approve_badge: 'Approved, your published content is visible to all',
avatar: 'Avatar',
background: 'Background',
back_soon: "We'll be back soon",
become_a_publisher: 'Become a publisher',
best_collection_ever: 'Best collection ever',
bookmark: 'Bookmark',
bookmark_a_contribution_or_user: 'Bookmark a contribution or a user',
bookmark_needs_login: 'Login or signup to bookmark',
bookmark_remove: 'Remove bookmark',
bookmarks: 'Bookmarks',
collection_curated_by: 'Collection curated by',
complete_profile: 'Complete profile',
congrats_you_already_did_it: 'Congrats! You already did it!',
create_account: 'Create a new account',
curated_collections: 'Curated collections',
dont_show_again: 'Do not show again',
dazzling_biome: 'Dazzling biome',
determined_sprout: 'Determined sprout',
display_name: 'Display name',
done: 'Done',
dont_show_again: 'Do not show again',
edit_background: 'Edit background',
edit_profile_picture: 'Edit profile picture',
enter_your_account: 'Enter to your account',
file_too_big: 'The file is too big, reduce the size or provide a url',
firmly_grounded: 'Firmly grounded',
follow: 'Follow',
follow_a_user_a_collection_or_a_subject: 'Follow a user, a collection, or a subject',
follow_needs_login: 'Login or signup to follow',
follow_own_content: 'Creators cannot follow their own content',
follow_remove_user: 'Unfollow user',
Expand All @@ -29,21 +45,36 @@ export const translations: Translations = {
followers_cnt_sing: '{1} follower',
followers_cnt_pl: '{1} followers',
following: 'Following',
get_a_point_for_each_detail: 'Get a point for each detail filled, profile and background images, location, website, description',
get_a_point_interests: 'Get a point when setting the interests type in your settings page',
goto_settings: 'Go to settings',
interest_description: 'Select your interests to get the most out of MoodleNet',
interest_title: 'Enhance your experience!',
image_too_big: 'The image is too big, reduce the size or use another image',
join_now: 'Join now',
learn_more: 'Learn more',
leaves: 'Leaves',
level: 'Level',
level_avatar: 'Level avatar',
like: 'Like',
like_a_resource: 'Like a resource',
like_needs_login: 'Login or signup to like',
like_own_content: 'Creators cannot like their own content',
like_remove: 'Remove like',
load_more: 'Load more',
location: 'Location',
login: 'Log in',
login_or_signup_to_send_messages: 'Login or signup to send messages',
logout: 'Log out',
log_in_desc: 'Log in or create an account to start publishing content',
moodlenet_community: 'MoodleNet Community',
more_actions: 'More actions',
myfollowers: 'My followers',
new_bookmark_on_your_profile_or_contribution: 'New bookmark on your profile or contribution',
new_collection: 'New collection',
new_follower: 'New follower',
new_follower_on_your_collection: 'New follower on your collection',
new_like_on_your_resource: 'New like on your resource',
new_resource: 'New resource',
override_subtitle: 'This is the OER Repository of the Bern University of Applied Sciences.',
override_title: 'Shaping the teaching of tomorrow',
Expand All @@ -56,7 +87,9 @@ export const translations: Translations = {
please_select_year: 'Please select a year',
please_upload_content: 'Please upload a content',
profile: 'Profile',
publish_collection: 'Publish collection',
publish_content: 'Publish content',
publish_resource: 'Publish resource',
resources: 'Resources',
rooted_learner: 'Rooted learner',
scheduled_maintenance:
Expand All @@ -69,7 +102,12 @@ export const translations: Translations = {
seedling_scholar: 'Seedling scholar',
select_language: 'Select language',
settings: 'Settings',
select_collections: 'Select collections',
select_license: 'Select a license',
send_a_message: 'Send a message',
set_up_interests: 'Set up interests',
sfollowers: '\'s followers',
sfollowing: '\'s following',
share_content: 'Share content',
signup: 'Sign up',
sky_reacher: 'Sky reacher',
Expand All @@ -90,17 +128,21 @@ export const translations: Translations = {
title_featured_resources: 'Featured resources',
title_leaderboard: 'Leaderboard',
unapprove: 'Unapprove',
unnamed: 'Unnamed',
user_menu: 'User menu',
user_subtitle_featured_authors: 'Top contributors you might appreciate',
user_subtitle_featured_collections: 'High quality collections you might enjoy',
user_subtitle_featured_resources: 'Top resource aligned with your interests',
user_title_featured_authors: 'Authors selection',
user_title_featured_collections: 'Collections selection',
user_title_featured_resources: 'Resources selection',
what_do_you_want_to_publish: 'What would you like to publish?',
versatile_canopy: 'Versatile canopy',
visibility_required: 'Visibility is required',
we_love_to_get: "We'd love to get",
we_love_to_get: 'We\'d love to get',
website: 'Website',
what_do_you_want_to_publish: 'What would you like to publish?',
what_should_others_know_about_you: 'What should others know about you?',
you_can_suggest: 'You can suggest new features and report bugs in the',
your_feedback: 'your feedback on MoodleNet',
your_resource_added_in_a_collection: 'Your resource added in a collection',
}
8 changes: 4 additions & 4 deletions packages/web-user/src/common/gamification/user-levels.mts
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ export const actionsAndPointsObtained: { action: string; points: number; abbr?:
abbr: 'Get a point for each detail filled, profile and background images, location, website, description',
},
{
action: 'Set up interests',
action: {t('set_up_interests')},
points: P.engagement.profile.interestsSet.points,
abbr: 'Get a point when setting the interests type in your settings page',
},
{ action: 'Publish collection', points: P.contribution.collection.published.toCreator.points },
{ action: {t('publish_collection')}, points: P.contribution.collection.published.toCreator.points },
{
action: "Add someone else's resource in your published collection",
points: P.contribution.collection.listCuration.toCollectionCreator.points,
},
{
action: 'Your resource added in a collection',
action: {t('your_resource_added_in_a_collection')},
points: P.contribution.collection.listCuration.toResourceCreator.points,
},
{ action: 'Publish resource', points: P.contribution.resource.published.toCreator.points },
{ action: {t('publish_resource')}, points: P.contribution.resource.published.toCreator.points },
{
action: 'Follow a user a collection or a subject',
points: P.engagement.follow.followerProfile.points,
Expand Down
Loading

0 comments on commit 6f558cc

Please sign in to comment.