Skip to content

Commit 3188956

Browse files
add French and fix some hardcoded strings (#67)
Co-authored-by: Luís Dalmolin <[email protected]>
1 parent cb4e1e9 commit 3188956

18 files changed

+83
-22
lines changed

resources/dist/commentions.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/commentions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Placeholder from '@tiptap/extension-placeholder'
55
import suggestion from './suggestion'
66

77
document.addEventListener('alpine:init', () => {
8-
Alpine.data('editor', (content, mentions, component) => {
8+
Alpine.data('editor', (content, mentions, component, placeholder) => {
99
let editor
1010

1111
return {
@@ -25,7 +25,7 @@ document.addEventListener('alpine:init', () => {
2525
suggestion: suggestion(mentions),
2626
}),
2727
Placeholder.configure({
28-
placeholder: 'Type your comment…',
28+
placeholder: placeholder,
2929
}),
3030
],
3131
editorProps: {

resources/lang/en/comments.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
return [
44
'label' => 'Comments',
5+
'placeholder' => 'Type your comment…',
56
'no_comments_yet' => 'No comments yet.',
67

78
'user_avatar_alt' => 'User Avatar',
@@ -18,10 +19,15 @@
1819
'save' => 'Save',
1920
'comment' => 'Comment',
2021
'add_reaction' => 'Add Reaction',
22+
'show_more' => 'Show More',
2123

2224
'notifications' => 'Notifications',
2325
'unsubscribe' => 'Unsubscribe',
2426
'subscribe' => 'Subscribe',
2527
'subscribers' => 'Subscribers',
26-
'more' => 'more',
28+
'more' => 'more|more',
29+
30+
'notification_subscribed' => 'Subscribed to notifications',
31+
'notification_unsubscribed' => 'Unsubscribed from notifications',
32+
'notification_comment_deleted' => 'Comment deleted',
2733
];

resources/lang/es/comments.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
return [
44
'label' => 'Comentarios',
5+
'placeholder' => 'Escribe tu comentario...',
56
'no_comments_yet' => 'Aún no hay comentarios.',
67

78
'user_avatar_alt' => 'Avatar de usuario',
@@ -18,10 +19,14 @@
1819
'save' => 'Guardar',
1920
'comment' => 'Comentar',
2021
'add_reaction' => 'Agregar reacción',
22+
'show_more' => 'Mostrar más',
2123

2224
'notifications' => 'Notificaciones',
23-
'unsubscribe' => 'Desuscribirse',
24-
'subscribe' => 'Suscribirse',
25+
'unsubscribe' => 'Desabonarse',
26+
'subscribe' => 'Suscribir',
2527
'subscribers' => 'Suscriptores',
2628
'more' => 'Más',
29+
'notification_subscribed' => 'Suscrito a notificaciones',
30+
'notification_unsubscribed' => 'Darse de baja de las notificaciones',
31+
'notification_comment_deleted' => 'Comentario eliminado',
2732
];

resources/lang/fr/comments.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
return [
4+
'label' => 'Commentaires',
5+
'placeholder' => 'Rédiger votre commentaire...',
6+
'no_comments_yet' => 'Aucun commentaire pour le moment.',
7+
8+
'user_avatar_alt' => 'Avatar de l\'utilisateur',
9+
10+
'commented_at' => 'Commenté le :datetime',
11+
'edited_at' => 'Edité le :datetime',
12+
'edited' => 'édité',
13+
14+
'delete_comment_heading' => 'Supprimer le commentaire',
15+
'delete_comment_body' => 'Etes-vous sûr de vouloir supprimer ce commentaire ? Cette action est irréversible.',
16+
17+
'cancel' => 'Annuler',
18+
'delete' => 'Supprimer',
19+
'save' => 'Enregistrer',
20+
'comment' => 'Commenter',
21+
'add_reaction' => 'Ajouter une réaction',
22+
'show_more' => 'Afficher plus',
23+
24+
'notifications' => 'Notifications',
25+
'unsubscribe' => 'Se désabonner',
26+
'subscribe' => 'S\'abonner',
27+
'subscribers' => 'Abonnés',
28+
'more' => 'supplémentaire|supplémentaires',
29+
30+
'notification_subscribed' => 'Abonné aux notifications',
31+
'notification_unsubscribed' => 'Désabonné des notifications',
32+
'notification_comment_deleted' => 'Commentaire supprimé',
33+
34+
];

resources/lang/ro/comments.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
return [
44
'label' => 'Comentarii',
5+
'placeholder' => 'Scrie comentariul tău...',
56
'no_comments_yet' => 'Niciun comentariu încă.',
67

78
'user_avatar_alt' => 'Avatar',
@@ -18,11 +19,16 @@
1819
'save' => 'Salvare',
1920
'comment' => 'Comentariu',
2021
'add_reaction' => 'Adaugă reacție',
22+
'show_more' => 'Afișează mai multe',
2123

2224
'notifications' => 'Notificări',
2325
'unsubscribe' => 'Dezabonare',
2426
'subscribe' => 'Abonare',
2527
'subscribers' => 'Abonați',
2628
'more' => 'mai mulţi',
2729

30+
'notification_subscribed' => 'Abonat la notificări',
31+
'notification_unsubscribed' => 'Dezabonat de la notificări',
32+
'notification_comment_deleted' => 'Comentariu șters',
33+
2834
];

resources/views/comment-list.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class="comm:w-8 comm:h-8 comm:text-gray-400 comm:dark:text-gray-500"
3030
wire:click="loadMore"
3131
wire:target="loadMore"
3232
wire:loading.attr="disabled"
33-
>{{ $loadMoreLabel }}</x-filament::button>
33+
>{{ $this->getLoadMoreLabel() }}</x-filament::button>
3434
</div>
3535
@endif
3636
</div>

resources/views/comments-modal.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
:polling-interval="$pollingInterval"
77
:paginate="$paginate ?? true"
88
:per-page="$perPage ?? 5"
9-
:load-more-label="$loadMoreLabel ?? 'Show more'"
9+
:load-more-label="$loadMoreLabel ?? __('commentions::comments.show_more')"
1010
:per-page-increment="$perPageIncrement ?? null"
1111
:sidebar-enabled="$sidebarEnabled ?? true"
1212
:show-subscribers="$showSubscribers ?? true"

resources/views/comments.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{{-- tiptap editor --}}
99
<div class="comm:relative tip-tap-container comm:mb-2" x-on:click="wasFocused = true" wire:ignore>
1010
<div
11-
x-data="editor(@js($commentBody), @js($this->mentions), 'comments')"
11+
x-data="editor(@js($commentBody), @js($this->mentions), 'comments', @js($this->getPlaceholder()))"
1212
>
1313
<div x-ref="element"></div>
1414
</div>
@@ -38,7 +38,7 @@
3838
:polling-interval="$pollingInterval"
3939
:paginate="$paginate ?? true"
4040
:per-page="$perPage ?? 5"
41-
:load-more-label="$loadMoreLabel ?? 'Show more'"
41+
:load-more-label="$loadMoreLabel ?? __('commentions::comments.show_more')"
4242
:per-page-increment="$perPageIncrement ?? null"
4343
/>
4444
</div>

resources/views/subscription-sidebar.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class="comm:w-4 comm:h-4 comm:rounded-full comm:object-cover comm:flex-shrink-0"
8282
@endforeach
8383
@if ($this->subscribers->count() > 5)
8484
<div class="comm:text-xs comm:text-gray-500 comm:dark:text-gray-400 comm:pl-6">
85-
+{{ $this->subscribers->count() - 5 }} {{ __('commentions::comments.more') }}
85+
+{{ $this->subscribers->count() - 5 }} {{ trans_choice('commentions::comments.more', $this->subscribers->count() - 5) }}
8686
</div>
8787
@endif
8888
</div>

0 commit comments

Comments
 (0)