Skip to content

Commit adfc1ac

Browse files
chore: Add missing Font and Sound translation keys (#36406)
Co-authored-by: Tiago Evangelista Pinto <17487063+tiagoevanp@users.noreply.github.com>
1 parent 3fb48d2 commit adfc1ac

File tree

23 files changed

+378
-21
lines changed

23 files changed

+378
-21
lines changed

.changeset/hungry-meals-grin.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rocket.chat/meteor': patch
3+
'@rocket.chat/i18n': patch
4+
---
5+
6+
add some missing translations for sound names and font sizes

apps/meteor/client/providers/CustomSoundProvider/lib/helpers.ts

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,42 @@ export const getCustomSoundURL = (sound: ICustomSound) => {
88
return getAssetUrl(`/custom-sounds/${sound._id}.${sound.extension}`, { _dc: sound.random || 0 });
99
};
1010

11+
// Translation keys for sound names
12+
export const soundTranslationKeys: Record<string, string> = {
13+
'chime': 'Sound_Chime',
14+
'door': 'Sound_Door',
15+
'beep': 'Sound_Beep',
16+
'chelle': 'Sound_Chelle',
17+
'ding': 'Sound_Ding',
18+
'droplet': 'Sound_Droplet',
19+
'highbell': 'Sound_Highbell',
20+
'seasons': 'Sound_Seasons',
21+
'telephone': 'Sound_Telephone',
22+
'outbound-call-ringing': 'Sound_Outbound_Call_Ringing',
23+
'call-ended': 'Sound_Call_Ended',
24+
'dialtone': 'Sound_Dialtone',
25+
'ringtone': 'Sound_Ringtone',
26+
};
27+
1128
export const defaultSounds: ICustomSound[] = [
12-
{ _id: 'chime', name: 'Chime', extension: 'mp3', src: getAssetUrl('sounds/chime.mp3') },
13-
{ _id: 'door', name: 'Door', extension: 'mp3', src: getAssetUrl('sounds/door.mp3') },
14-
{ _id: 'beep', name: 'Beep', extension: 'mp3', src: getAssetUrl('sounds/beep.mp3') },
15-
{ _id: 'chelle', name: 'Chelle', extension: 'mp3', src: getAssetUrl('sounds/chelle.mp3') },
16-
{ _id: 'ding', name: 'Ding', extension: 'mp3', src: getAssetUrl('sounds/ding.mp3') },
17-
{ _id: 'droplet', name: 'Droplet', extension: 'mp3', src: getAssetUrl('sounds/droplet.mp3') },
18-
{ _id: 'highbell', name: 'Highbell', extension: 'mp3', src: getAssetUrl('sounds/highbell.mp3') },
19-
{ _id: 'seasons', name: 'Seasons', extension: 'mp3', src: getAssetUrl('sounds/seasons.mp3') },
20-
{ _id: 'telephone', name: 'Telephone', extension: 'mp3', src: getAssetUrl('sounds/telephone.mp3') },
21-
{ _id: 'outbound-call-ringing', name: 'Outbound Call Ringing', extension: 'mp3', src: getAssetUrl('sounds/outbound-call-ringing.mp3') },
22-
{ _id: 'call-ended', name: 'Call Ended', extension: 'mp3', src: getAssetUrl('sounds/call-ended.mp3') },
23-
{ _id: 'dialtone', name: 'Dialtone', extension: 'mp3', src: getAssetUrl('sounds/dialtone.mp3') },
24-
{ _id: 'ringtone', name: 'Ringtone', extension: 'mp3', src: getAssetUrl('sounds/ringtone.mp3') },
29+
{ _id: 'chime', name: 'Sound_Chime', extension: 'mp3', src: getAssetUrl('sounds/chime.mp3') },
30+
{ _id: 'door', name: 'Sound_Door', extension: 'mp3', src: getAssetUrl('sounds/door.mp3') },
31+
{ _id: 'beep', name: 'Sound_Beep', extension: 'mp3', src: getAssetUrl('sounds/beep.mp3') },
32+
{ _id: 'chelle', name: 'Sound_Chelle', extension: 'mp3', src: getAssetUrl('sounds/chelle.mp3') },
33+
{ _id: 'ding', name: 'Sound_Ding', extension: 'mp3', src: getAssetUrl('sounds/ding.mp3') },
34+
{ _id: 'droplet', name: 'Sound_Droplet', extension: 'mp3', src: getAssetUrl('sounds/droplet.mp3') },
35+
{ _id: 'highbell', name: 'Sound_Highbell', extension: 'mp3', src: getAssetUrl('sounds/highbell.mp3') },
36+
{ _id: 'seasons', name: 'Sound_Seasons', extension: 'mp3', src: getAssetUrl('sounds/seasons.mp3') },
37+
{ _id: 'telephone', name: 'Sound_Telephone', extension: 'mp3', src: getAssetUrl('sounds/telephone.mp3') },
38+
{
39+
_id: 'outbound-call-ringing',
40+
name: 'Sound_Outbound_Call_Ringing',
41+
extension: 'mp3',
42+
src: getAssetUrl('sounds/outbound-call-ringing.mp3'),
43+
},
44+
{ _id: 'call-ended', name: 'Sound_Call_Ended', extension: 'mp3', src: getAssetUrl('sounds/call-ended.mp3') },
45+
{ _id: 'dialtone', name: 'Sound_Dialtone', extension: 'mp3', src: getAssetUrl('sounds/dialtone.mp3') },
46+
{ _id: 'ringtone', name: 'Sound_Ringtone', extension: 'mp3', src: getAssetUrl('sounds/ringtone.mp3') },
2547
];
2648

2749
export const formatVolume = (volume: number) => {

apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const AccessibilityPage = () => {
143143
control={control}
144144
name='fontSize'
145145
render={({ field: { onChange, value } }) => (
146-
<Select id={fontSizeId} value={value} onChange={onChange} options={fontSizes} />
146+
<Select id={fontSizeId} value={value} onChange={onChange} options={fontSizes(t)} />
147147
)}
148148
/>
149149
</FieldRow>
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import type { SelectOption } from '@rocket.chat/fuselage';
2+
import type { TranslationKey } from '@rocket.chat/ui-contexts';
23

3-
export const fontSizes: SelectOption[] = [
4-
[`${(14 / 16) * 100}%`, 'Small'],
5-
['100%', 'Default'],
6-
[`${(18 / 16) * 100}%`, 'Medium'],
7-
[`${(20 / 16) * 100}%`, 'Large'],
8-
[`${(24 / 16) * 100}%`, 'Extra large'],
4+
type TranslationFunction = (key: TranslationKey) => string;
5+
6+
export const fontSizes = (t: TranslationFunction): SelectOption[] => [
7+
[`${(14 / 16) * 100}%`, t('Font_Small')],
8+
['100%', t('Font_Default')],
9+
[`${(18 / 16) * 100}%`, t('Font_Medium')],
10+
[`${(20 / 16) * 100}%`, t('Font_Large')],
11+
[`${(24 / 16) * 100}%`, t('Font_Extra_large')],
912
];

apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { SelectOption } from '@rocket.chat/fuselage';
22
import { AccordionItem, Field, FieldGroup, FieldHint, FieldLabel, FieldRow, Select, Slider, ToggleSwitch } from '@rocket.chat/fuselage';
3+
import type { TranslationKey } from '@rocket.chat/ui-contexts';
34
import { useCustomSound, useTranslation } from '@rocket.chat/ui-contexts';
45
import { useId } from 'react';
56
import { Controller, useFormContext } from 'react-hook-form';
@@ -8,7 +9,7 @@ const PreferencesSoundSection = () => {
89
const t = useTranslation();
910

1011
const customSound = useCustomSound();
11-
const soundsList: SelectOption[] = customSound.list?.map((value) => [value._id, value.name]) || [];
12+
const soundsList: SelectOption[] = customSound.list?.map((value) => [value._id, t(value.name as TranslationKey)]) || [];
1213
const { control, watch } = useFormContext();
1314
const { newMessageNotification, notificationsSoundVolume = 100, masterVolume = 100, voipRingerVolume = 100 } = watch();
1415

packages/i18n/src/locales/ar.i18n.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,11 @@
15791579
"Field_removed": "تمت إزالة الحقل",
15801580
"Field_required": "حقل مطلوب",
15811581
"File": "الملف",
1582+
"Font_Default": "افتراضي",
1583+
"Font_Extra_large": "كبير جداً",
1584+
"Font_Large": "كبير",
1585+
"Font_Medium": "متوسط",
1586+
"Font_Small": "صغير",
15821587
"FileSize_Bytes": "{{fileSize}} بايت",
15831588
"FileSize_KB": "{{fileSize}} كيلوبايت",
15841589
"FileSize_MB": "{{fileSize}} ميجابايت",
@@ -3468,7 +3473,20 @@
34683473
"Sort_By": "فرز حسب",
34693474
"Sort_by_activity": "فرز حسب النشاط",
34703475
"Sound": "الصوت",
3476+
"Sound_Beep": "صوت تنبيه",
3477+
"Sound_Call_Ended": "انتهت المكالمة",
3478+
"Sound_Chelle": "شيلي",
3479+
"Sound_Chime": "نغمة",
3480+
"Sound_Dialtone": "نغمة الطلب",
3481+
"Sound_Ding": "دينغ",
3482+
"Sound_Door": "باب",
3483+
"Sound_Droplet": "قطرة",
34713484
"Sound_File_mp3": "ملف الصوت (mp3)",
3485+
"Sound_Highbell": "جرس عالي",
3486+
"Sound_Outbound_Call_Ringing": "مكالمة صادرة",
3487+
"Sound_Ringtone": "نغمة الرنين",
3488+
"Sound_Seasons": "مواسم",
3489+
"Sound_Telephone": "هاتف",
34723490
"Source": "المصدر",
34733491
"Star": "تمييز بنجمة",
34743492
"Star_Message": "تمييز الرسالة بنجمة",

packages/i18n/src/locales/de.i18n.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,11 @@
17531753
"Field_removed": "Feld entfernt",
17541754
"Field_required": "Feld erforderlich",
17551755
"File": "Datei",
1756+
"Font_Default": "Standard",
1757+
"Font_Extra_large": "Sehr groß",
1758+
"Font_Large": "Groß",
1759+
"Font_Medium": "Mittel",
1760+
"Font_Small": "Klein",
17561761
"FileSize_Bytes": "{{fileSize}} Bytes",
17571762
"FileSize_KB": "{{fileSize}} KB",
17581763
"FileSize_MB": "{{fileSize}} MB",
@@ -3860,8 +3865,21 @@
38603865
"Sort_By": "Sortieren nach",
38613866
"Sort_by_activity": "Nach Aktivität sortieren",
38623867
"Sound": "Ton",
3868+
"Sound_Beep": "Piepton",
3869+
"Sound_Call_Ended": "Anruf beendet",
3870+
"Sound_Chelle": "Chelle",
3871+
"Sound_Chime": "Glockenspiel",
3872+
"Sound_Dialtone": "Wählton",
3873+
"Sound_Ding": "Ding",
3874+
"Sound_Door": "Tür",
3875+
"Sound_Droplet": "Tropfen",
38633876
"Sound File": "Ton-Datei",
38643877
"Sound_File_mp3": "Ton-Datei (.mp3)",
3878+
"Sound_Highbell": "Hohe Glocke",
3879+
"Sound_Outbound_Call_Ringing": "Ausgehender Anruf",
3880+
"Sound_Ringtone": "Klingelton",
3881+
"Sound_Seasons": "Jahreszeiten",
3882+
"Sound_Telephone": "Telefon",
38653883
"Source": "Quelle",
38663884
"Speakers": "Lautsprecher",
38673885
"Star": "Favorisieren",

packages/i18n/src/locales/en.i18n.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,11 @@
21262126
"Field_removed": "Field removed",
21272127
"Field_required": "Field required",
21282128
"File": "File",
2129+
"Font_Default": "Default",
2130+
"Font_Extra_large": "Extra Large",
2131+
"Font_Large": "Large",
2132+
"Font_Medium": "Medium",
2133+
"Font_Small": "Small",
21292134
"FileSize_Bytes": "{{fileSize}} Bytes",
21302135
"FileSize_KB": "{{fileSize}} KB",
21312136
"FileSize_MB": "{{fileSize}} MB",
@@ -4797,7 +4802,20 @@
47974802
"Sorting_mechanism": "Sorting mechanism",
47984803
"Sound": "Sound",
47994804
"Sound File": "Sound File",
4805+
"Sound_Beep": "Beep",
4806+
"Sound_Call_Ended": "Call Ended",
4807+
"Sound_Chelle": "Chelle",
4808+
"Sound_Chime": "Chime",
4809+
"Sound_Dialtone": "Dialtone",
4810+
"Sound_Ding": "Ding",
4811+
"Sound_Door": "Door",
4812+
"Sound_Droplet": "Droplet",
48004813
"Sound_File_mp3": "Sound File (mp3)",
4814+
"Sound_Highbell": "Highbell",
4815+
"Sound_Outbound_Call_Ringing": "Outbound Call Ringing",
4816+
"Sound_Ringtone": "Ringtone",
4817+
"Sound_Seasons": "Seasons",
4818+
"Sound_Telephone": "Telephone",
48014819
"Sounds": "Sounds",
48024820
"Source": "Source",
48034821
"Speaker": "Speaker",

packages/i18n/src/locales/es.i18n.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,11 @@
15971597
"Field_removed": "Campo eliminado",
15981598
"Field_required": "Campo obligatorio",
15991599
"File": "Archivo",
1600+
"Font_Default": "Predeterminado",
1601+
"Font_Extra_large": "Muy grande",
1602+
"Font_Large": "Grande",
1603+
"Font_Medium": "Mediano",
1604+
"Font_Small": "Pequeño",
16001605
"FileSize_Bytes": "{{fileSize}} bytes",
16011606
"FileSize_KB": "{{fileSize}} KB",
16021607
"FileSize_MB": "{{fileSize}} MB",
@@ -3558,7 +3563,20 @@
35583563
"Sort_By": "Ordenar por",
35593564
"Sort_by_activity": "Ordenar por actividad",
35603565
"Sound": "Sonido",
3566+
"Sound_Beep": "Pitido",
3567+
"Sound_Call_Ended": "Llamada terminada",
3568+
"Sound_Chelle": "Chelle",
3569+
"Sound_Chime": "Campanilla",
3570+
"Sound_Dialtone": "Tono de marcar",
3571+
"Sound_Ding": "Ding",
3572+
"Sound_Door": "Puerta",
3573+
"Sound_Droplet": "Gota",
35613574
"Sound_File_mp3": "Archivo de sonido (mp3)",
3575+
"Sound_Highbell": "Campana alta",
3576+
"Sound_Outbound_Call_Ringing": "Llamada saliente",
3577+
"Sound_Ringtone": "Tono de llamada",
3578+
"Sound_Seasons": "Estaciones",
3579+
"Sound_Telephone": "Teléfono",
35623580
"Source": "Fuente",
35633581
"Star": "Destacar",
35643582
"Star_Message": "Destacar mensaje",

packages/i18n/src/locales/fi.i18n.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,11 @@
18041804
"Field_removed": "Kenttä poistettu",
18051805
"Field_required": "Kenttä pakollinen",
18061806
"File": "Tiedosto",
1807+
"Font_Default": "Oletus",
1808+
"Font_Extra_large": "Erittäin suuri",
1809+
"Font_Large": "Suuri",
1810+
"Font_Medium": "Keskikokoinen",
1811+
"Font_Small": "Pieni",
18071812
"FileSize_Bytes": "{{fileSize}} tavua",
18081813
"FileSize_KB": "{{fileSize}} kt",
18091814
"FileSize_MB": "{{fileSize}} Mt",
@@ -3996,8 +4001,21 @@
39964001
"Sort_by_activity": "Lajittelu toiminnan mukaan",
39974002
"Sorting_mechanism": "Lajittelumekanismi",
39984003
"Sound": "Ääni",
4004+
"Sound_Beep": "Piippaus",
4005+
"Sound_Call_Ended": "Puhelu päättyi",
4006+
"Sound_Chelle": "Chelle",
4007+
"Sound_Chime": "Kello",
4008+
"Sound_Dialtone": "Valintaääni",
4009+
"Sound_Ding": "Ding",
4010+
"Sound_Door": "Ovi",
4011+
"Sound_Droplet": "Pisara",
39994012
"Sound File": "Äänitiedosto",
40004013
"Sound_File_mp3": "Äänitiedosto (mp3)",
4014+
"Sound_Highbell": "Korkea kello",
4015+
"Sound_Outbound_Call_Ringing": "Lähtevä puhelu",
4016+
"Sound_Ringtone": "Soittoääni",
4017+
"Sound_Seasons": "Vuodenajat",
4018+
"Sound_Telephone": "Puhelin",
40014019
"Source": "Lähde",
40024020
"Speakers": "Kaiuttimet",
40034021
"Star": "Tähti",

0 commit comments

Comments
 (0)