diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2024-06-14 13:49:02 +0200 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2024-06-14 14:04:35 +0200 |
commit | 82b7084eb92fa7e4fcfa90ffe4a8bf36bf975917 (patch) | |
tree | a726cb46a857a1ba76c8c3385adcafdfd742078c /src | |
parent | e9b9cf49022521291fce0386c78f6df1e70fb731 (diff) |
fix(l10n): remove global assignment of translate functions
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/LeftSidebar/ConversationsList/Conversation.spec.js | 9 | ||||
-rw-r--r-- | src/components/MessagesList/MessagesList.spec.js | 9 | ||||
-rw-r--r-- | src/env.d.ts | 5 | ||||
-rw-r--r-- | src/main.js | 3 | ||||
-rw-r--r-- | src/mainAdminSettings.js | 2 | ||||
-rw-r--r-- | src/mainFilesSidebar.js | 3 | ||||
-rw-r--r-- | src/mainPublicShareAuthSidebar.js | 3 | ||||
-rw-r--r-- | src/mainPublicShareSidebar.js | 3 | ||||
-rw-r--r-- | src/mainRecording.js | 3 | ||||
-rw-r--r-- | src/test-setup.js | 7 | ||||
-rw-r--r-- | src/utils/requestRoomSelection.js | 4 |
11 files changed, 0 insertions, 51 deletions
diff --git a/src/components/LeftSidebar/ConversationsList/Conversation.spec.js b/src/components/LeftSidebar/ConversationsList/Conversation.spec.js index ded215d45..640f3c348 100644 --- a/src/components/LeftSidebar/ConversationsList/Conversation.spec.js +++ b/src/components/LeftSidebar/ConversationsList/Conversation.spec.js @@ -77,15 +77,6 @@ describe('Conversation.vue', () => { canLeaveConversation: true, canDeleteConversation: true, } - - // hack to catch last message rendering - const oldTee = global.t - global.t = jest.fn().mockImplementation(function(pkg, text, data) { - if (data && data.lastMessage) { - return (data.actor || 'You') + ': ' + data.lastMessage - } - return oldTee.apply(this, arguments) - }) }) afterEach(() => { diff --git a/src/components/MessagesList/MessagesList.spec.js b/src/components/MessagesList/MessagesList.spec.js index 949ecedfd..80372bc4a 100644 --- a/src/components/MessagesList/MessagesList.spec.js +++ b/src/components/MessagesList/MessagesList.spec.js @@ -32,15 +32,6 @@ describe('MessagesList.vue', () => { // scrollTo isn't implemented in JSDOM Element.prototype.scrollTo = () => {} - - // hack to catch date separators - const oldTee = global.t - global.t = jest.fn().mockImplementation(function(pkg, text, data) { - if (data && data.relativeDate) { - return data.relativeDate + ', ' + data.absoluteDate - } - return oldTee.apply(this, arguments) - }) }) afterEach(() => { diff --git a/src/env.d.ts b/src/env.d.ts index b9fc75197..4d9841cd3 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -3,8 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { translate, translatePlural } from '@nextcloud/l10n' - declare global { // @nextcloud/webpack-vue-config build globals const appName: string @@ -17,9 +15,6 @@ declare global { let __webpack_nonce__: ReturnType<typeof btoa> let __webpack_public_path__: string - - const t: typeof translate - const n: typeof translatePlural } export {} diff --git a/src/main.js b/src/main.js index 35250688b..ac23314b0 100644 --- a/src/main.js +++ b/src/main.js @@ -12,7 +12,6 @@ import Vuex from 'vuex' import { getRequestToken } from '@nextcloud/auth' import { emit } from '@nextcloud/event-bus' -import { translate, translatePlural } from '@nextcloud/l10n' import { generateFilePath } from '@nextcloud/router' import { options as TooltipOptions } from '@nextcloud/vue/dist/Directives/Tooltip.js' @@ -43,8 +42,6 @@ if (!IS_DESKTOP) { __webpack_public_path__ = generateFilePath('spreed', '', 'js/') } -Vue.prototype.t = translate -Vue.prototype.n = translatePlural Vue.prototype.OC = OC Vue.prototype.OCA = OCA diff --git a/src/mainAdminSettings.js b/src/mainAdminSettings.js index 48a1226ee..d997e05b1 100644 --- a/src/mainAdminSettings.js +++ b/src/mainAdminSettings.js @@ -9,8 +9,6 @@ import AdminSettings from './views/AdminSettings.vue' import '@nextcloud/dialogs/style.css' -Vue.prototype.t = t -Vue.prototype.n = n Vue.prototype.OC = OC Vue.prototype.OCA = OCA Vue.prototype.OCP = OCP diff --git a/src/mainFilesSidebar.js b/src/mainFilesSidebar.js index 245a0f56c..1809fb42b 100644 --- a/src/mainFilesSidebar.js +++ b/src/mainFilesSidebar.js @@ -10,7 +10,6 @@ import VueShortKey from 'vue-shortkey' import Vuex from 'vuex' import { getRequestToken } from '@nextcloud/auth' -import { translate, translatePlural } from '@nextcloud/l10n' import { generateFilePath } from '@nextcloud/router' import FilesSidebarCallViewApp from './FilesSidebarCallViewApp.vue' @@ -37,8 +36,6 @@ __webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-next-line __webpack_public_path__ = generateFilePath('spreed', '', 'js/') -Vue.prototype.t = translate -Vue.prototype.n = translatePlural Vue.prototype.OC = OC Vue.prototype.OCA = OCA diff --git a/src/mainPublicShareAuthSidebar.js b/src/mainPublicShareAuthSidebar.js index 392b35a19..e6253f611 100644 --- a/src/mainPublicShareAuthSidebar.js +++ b/src/mainPublicShareAuthSidebar.js @@ -10,7 +10,6 @@ import VueShortKey from 'vue-shortkey' import Vuex from 'vuex' import { getRequestToken } from '@nextcloud/auth' -import { translate, translatePlural } from '@nextcloud/l10n' import { generateFilePath } from '@nextcloud/router' import PublicShareAuthRequestPasswordButton from './PublicShareAuthRequestPasswordButton.vue' @@ -37,8 +36,6 @@ __webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-next-line __webpack_public_path__ = generateFilePath('spreed', '', 'js/') -Vue.prototype.t = translate -Vue.prototype.n = translatePlural Vue.prototype.OC = OC Vue.prototype.OCA = OCA diff --git a/src/mainPublicShareSidebar.js b/src/mainPublicShareSidebar.js index e25296d3b..05343c5ab 100644 --- a/src/mainPublicShareSidebar.js +++ b/src/mainPublicShareSidebar.js @@ -10,7 +10,6 @@ import VueShortKey from 'vue-shortkey' import Vuex from 'vuex' import { getRequestToken } from '@nextcloud/auth' -import { translate, translatePlural } from '@nextcloud/l10n' import { generateFilePath } from '@nextcloud/router' import PublicShareSidebar from './PublicShareSidebar.vue' @@ -37,8 +36,6 @@ __webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-next-line __webpack_public_path__ = generateFilePath('spreed', '', 'js/') -Vue.prototype.t = translate -Vue.prototype.n = translatePlural Vue.prototype.OC = OC Vue.prototype.OCA = OCA diff --git a/src/mainRecording.js b/src/mainRecording.js index e351effc4..00b39c5bb 100644 --- a/src/mainRecording.js +++ b/src/mainRecording.js @@ -12,7 +12,6 @@ import VueShortKey from 'vue-shortkey' import Vuex from 'vuex' import { getRequestToken } from '@nextcloud/auth' -import { translate, translatePlural } from '@nextcloud/l10n' import { generateFilePath } from '@nextcloud/router' import { options as TooltipOptions } from '@nextcloud/vue/dist/Directives/Tooltip.js' @@ -46,8 +45,6 @@ __webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-next-line __webpack_public_path__ = generateFilePath('spreed', '', 'js/') -Vue.prototype.t = translate -Vue.prototype.n = translatePlural Vue.prototype.OC = OC Vue.prototype.OCA = OCA diff --git a/src/test-setup.js b/src/test-setup.js index 16bfdf2e8..8b7678103 100644 --- a/src/test-setup.js +++ b/src/test-setup.js @@ -7,8 +7,6 @@ import 'regenerator-runtime/runtime' import Vue from 'vue' -import { translate, translatePlural } from '@nextcloud/l10n' - import { mockedCapabilities } from './__mocks__/capabilities.ts' jest.mock('extendable-media-recorder', () => ({ @@ -116,10 +114,5 @@ global.BroadcastChannel = jest.fn(() => ({ window.URL.createObjectURL = jest.fn() window.URL.revokeObjectURL = jest.fn() -global.t = translate -global.n = translatePlural - -Vue.prototype.t = global.t -Vue.prototype.n = global.n Vue.prototype.OC = OC Vue.prototype.OCA = OCA diff --git a/src/utils/requestRoomSelection.js b/src/utils/requestRoomSelection.js index 541624627..4f2503102 100644 --- a/src/utils/requestRoomSelection.js +++ b/src/utils/requestRoomSelection.js @@ -5,10 +5,6 @@ import Vue, { defineAsyncComponent } from 'vue' -import { t, n } from '@nextcloud/l10n' - -Vue.prototype.t = t -Vue.prototype.n = n Vue.prototype.OC = window.OC Vue.prototype.OCA = window.OCA Vue.prototype.OCP = window.OCP |