diff --git a/static/js/app/userMenu.js b/static/js/app/userMenu.js
index c8cf7010..18360258 100644
--- a/static/js/app/userMenu.js
+++ b/static/js/app/userMenu.js
@@ -212,7 +212,6 @@ function showUserProfileModal() {
// FIXME: use classes
const barColor = percentage > 90 ? '#ef4444' : percentage > 70 ? '#f59e0b' : '#22c55e';
- const t = (key, fallback) => i18n.t(key) || fallback;
const existing = document.getElementById('profile-modal-overlay');
if (existing) existing.remove();
@@ -226,11 +225,11 @@ function showUserProfileModal() {
${initials}
${username}
${email}
- ${role === 'admin' ? 'π‘οΈ Admin' : `π€ ${t('user_menu.role_user', 'User')}`}
+ ${role === 'admin' ? 'π‘οΈ Admin' : `π€ ${i18n.t('user_menu.role_user')}`}
- ${t('storage.title', 'Storage')}
+ ${i18n.t('storage.title')}
@@ -238,7 +237,7 @@ function showUserProfileModal() {
${percentage}% Β· ${formatFileSize(usedBytes)} / ${formatQuotaSize(quotaBytes)}
`;
diff --git a/static/js/core/modal.js b/static/js/core/modal.js
index 22f28522..016f623d 100644
--- a/static/js/core/modal.js
+++ b/static/js/core/modal.js
@@ -137,14 +137,12 @@ const Modal = {
* @returns {Promise}
*/
promptNewFolder() {
- const t = i18n.t.bind(i18n);
-
return this.prompt({
- title: t('dialogs.new_folder_title') || 'New folder',
- label: t('dialogs.folder_name') || 'Folder name',
- placeholder: t('dialogs.folder_placeholder') || 'My folder',
+ title: i18n.t('dialogs.new_folder_title'),
+ label: i18n.t('dialogs.folder_name'),
+ placeholder: i18n.t('dialogs.folder_placeholder'),
icon: 'fa-folder-plus',
- confirmText: t('actions.create') || 'Create'
+ confirmText: i18n.t('actions.create')
});
},
@@ -155,18 +153,15 @@ const Modal = {
* @returns {Promise}
*/
promptRename(currentName, isFolder = false) {
- const t = i18n.t.bind(i18n);
-
- // For files, we want to select only the name part (without extension)
this._selectNameOnly = !isFolder;
return this.prompt({
- title: t('dialogs.rename_title') || 'Renombrar',
- label: t('dialogs.new_name') || 'Nuevo nombre',
+ title: i18n.t('dialogs.rename_title'),
+ label: i18n.t('dialogs.new_name'),
placeholder: '',
value: currentName,
icon: isFolder ? 'fa-folder' : 'fa-file',
- confirmText: t('actions.rename') || 'Renombrar'
+ confirmText: i18n.t('actions.rename')
});
},
diff --git a/static/js/core/notifications.js b/static/js/core/notifications.js
index 4986653e..4fe484b8 100644
--- a/static/js/core/notifications.js
+++ b/static/js/core/notifications.js
@@ -149,9 +149,8 @@ const notifications = (() => {
item.className = 'notif-item';
item.id = batchId;
- const t = i18n.t.bind(i18n);
- const uploadingText = folderName ? `π ${t('upload.uploading')} ${_esc(folderName)}β¦` : t('upload.uploading');
- const filesLabel = t('upload.files');
+ const uploadingText = folderName ? `π ${i18n.t('upload.uploading')} ${_esc(folderName)}β¦` : i18n.t('upload.uploading');
+ const filesLabel = i18n.t('upload.files');
item.innerHTML = `
@@ -254,8 +253,7 @@ const notifications = (() => {
const pctEl = $(`${batchId}-pct`);
const statsEl = $(`${batchId}-stats`);
- const t = i18n.t.bind(i18n);
- const filesLabel = t('upload.files');
+ const filesLabel = i18n.t('upload.files');
if (fillEl) fillEl.style.width = `${pctVal}%`;
if (pctEl) pctEl.textContent = `${pctVal}%`;
@@ -282,8 +280,7 @@ const notifications = (() => {
const curEl = $(`${batchId}-current`);
if (curEl) curEl.textContent = '';
- const t = i18n.t.bind(i18n);
- const completeText = t('upload.complete', {
+ const completeText = i18n.t('upload.complete', {
count: successCount,
total: totalFiles
});
diff --git a/static/js/features/files/contextMenus.js b/static/js/features/files/contextMenus.js
index d0eae153..338dd01e 100644
--- a/static/js/features/files/contextMenus.js
+++ b/static/js/features/files/contextMenus.js
@@ -1115,12 +1115,10 @@ const contextMenus = {
},
_renderPlaylistSelect(container, playlists) {
- const t = i18n.t.bind(i18n);
-
container.innerHTML = '';
if (playlists.length === 0) {
- container.innerHTML = `${t('music.no_playlists', 'No playlists yet. Create one first!')}
`;
+ container.innerHTML = `${i18n.t('music.no_playlists')}
`;
return;
}
@@ -1131,7 +1129,7 @@ const contextMenus = {
item.innerHTML = `
${this._escapeHtml(playlist.name)}
- ${playlist.track_count || 0} ${t('music.tracks', 'tracks')}
+ ${playlist.track_count || 0} ${i18n.t('music.tracks')}
`;
item.addEventListener('click', () => {
diff --git a/static/js/features/library/music.js b/static/js/features/library/music.js
index f002efac..9274a067 100644
--- a/static/js/features/library/music.js
+++ b/static/js/features/library/music.js
@@ -87,9 +87,6 @@ const musicView = {
if (!this._container) return;
// FIXME should call directly
- const t = (key, _fallback = '') => {
- return i18n.t(key);
- };
// Empty state: no playlists at all β show full-width centered onboarding
if (this.playlists.length === 0) {
@@ -98,11 +95,11 @@ const musicView = {
- ${t('music.no_playlists', 'No playlists yet')}
- ${t('music.empty_hint', 'Create your first playlist to start organizing your music')}
+ ${i18n.t('music.no_playlists')}
+ ${i18n.t('music.empty_hint')}
`;
@@ -118,8 +115,8 @@ const musicView = {