Don't import from i18n in headless
This commit is contained in:
parent
f6a985c24f
commit
fb704fdf87
@ -1,7 +1,6 @@
|
|||||||
import "@converse/headless/plugins/muc/index.js";
|
import "@converse/headless/plugins/muc/index.js";
|
||||||
import Bookmark from './model.js';
|
import Bookmark from './model.js';
|
||||||
import log from "@converse/headless/log.js";
|
import log from "@converse/headless/log.js";
|
||||||
import { __ } from 'i18n';
|
|
||||||
import { _converse, api, converse } from "@converse/headless/core";
|
import { _converse, api, converse } from "@converse/headless/core";
|
||||||
import { getOpenPromise } from '@converse/openpromise';
|
import { getOpenPromise } from '@converse/openpromise';
|
||||||
import { initStorage } from '@converse/headless/utils/storage.js';
|
import { initStorage } from '@converse/headless/utils/storage.js';
|
||||||
@ -86,6 +85,7 @@ const Bookmarks = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onBookmarkError (iq, options) {
|
onBookmarkError (iq, options) {
|
||||||
|
const { __ } = _converse;
|
||||||
log.error("Error while trying to add bookmark");
|
log.error("Error while trying to add bookmark");
|
||||||
log.error(iq);
|
log.error(iq);
|
||||||
api.alert(
|
api.alert(
|
||||||
@ -145,6 +145,7 @@ const Bookmarks = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onBookmarksReceivedError (deferred, iq) {
|
onBookmarksReceivedError (deferred, iq) {
|
||||||
|
const { __ } = _converse;
|
||||||
if (iq === null) {
|
if (iq === null) {
|
||||||
log.error('Error: timeout while fetching bookmarks');
|
log.error('Error: timeout while fetching bookmarks');
|
||||||
api.alert('error', __('Timeout Error'),
|
api.alert('error', __('Timeout Error'),
|
||||||
|
@ -3,7 +3,6 @@ import log from "@converse/headless/log";
|
|||||||
import sum from 'lodash-es/sum';
|
import sum from 'lodash-es/sum';
|
||||||
import { Collection } from "@converse/skeletor/src/collection";
|
import { Collection } from "@converse/skeletor/src/collection";
|
||||||
import { Model } from "@converse/skeletor/src/model";
|
import { Model } from "@converse/skeletor/src/model";
|
||||||
import { __ } from 'i18n';
|
|
||||||
import { _converse, api, converse } from "@converse/headless/core";
|
import { _converse, api, converse } from "@converse/headless/core";
|
||||||
import { initStorage } from '@converse/headless/utils/storage.js';
|
import { initStorage } from '@converse/headless/utils/storage.js';
|
||||||
import { rejectPresenceSubscription } from './utils.js';
|
import { rejectPresenceSubscription } from './utils.js';
|
||||||
@ -163,6 +162,7 @@ const RosterContacts = Collection.extend({
|
|||||||
try {
|
try {
|
||||||
await this.sendContactAddIQ(jid, name, groups);
|
await this.sendContactAddIQ(jid, name, groups);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
const { __ } = _converse;
|
||||||
log.error(e);
|
log.error(e);
|
||||||
alert(__('Sorry, there was an error while trying to add %1$s as a contact.', name || jid));
|
alert(__('Sorry, there was an error while trying to add %1$s as a contact.', name || jid));
|
||||||
return e;
|
return e;
|
||||||
@ -355,6 +355,7 @@ const RosterContacts = Collection.extend({
|
|||||||
contact = this.get(bare_jid);
|
contact = this.get(bare_jid);
|
||||||
|
|
||||||
if (!api.settings.get('allow_contact_requests')) {
|
if (!api.settings.get('allow_contact_requests')) {
|
||||||
|
const { __ } = _converse;
|
||||||
rejectPresenceSubscription(
|
rejectPresenceSubscription(
|
||||||
jid,
|
jid,
|
||||||
__("This client does not allow presence subscriptions")
|
__("This client does not allow presence subscriptions")
|
||||||
|
@ -7,7 +7,6 @@ import RosterContact from './contact.js';
|
|||||||
import RosterContacts from './contacts.js';
|
import RosterContacts from './contacts.js';
|
||||||
import roster_api from './api.js';
|
import roster_api from './api.js';
|
||||||
import { Presence, Presences } from './presence.js';
|
import { Presence, Presences } from './presence.js';
|
||||||
import { __ } from 'i18n';
|
|
||||||
import { _converse, api, converse } from '@converse/headless/core';
|
import { _converse, api, converse } from '@converse/headless/core';
|
||||||
import {
|
import {
|
||||||
onChatBoxesInitialized,
|
onChatBoxesInitialized,
|
||||||
@ -34,6 +33,7 @@ converse.plugins.add('converse-roster', {
|
|||||||
// API methods only available to plugins
|
// API methods only available to plugins
|
||||||
Object.assign(_converse.api, roster_api);
|
Object.assign(_converse.api, roster_api);
|
||||||
|
|
||||||
|
const { __ } = _converse;
|
||||||
_converse.HEADER_CURRENT_CONTACTS = __('My contacts');
|
_converse.HEADER_CURRENT_CONTACTS = __('My contacts');
|
||||||
_converse.HEADER_PENDING_CONTACTS = __('Pending contacts');
|
_converse.HEADER_PENDING_CONTACTS = __('Pending contacts');
|
||||||
_converse.HEADER_REQUESTING_CONTACTS = __('Contact requests');
|
_converse.HEADER_REQUESTING_CONTACTS = __('Contact requests');
|
||||||
|
Loading…
Reference in New Issue
Block a user