2
0
Эх сурвалжийг харах

Fixes #3464. Missing localization

JC Brand 4 сар өмнө
parent
commit
f6654c2a83

+ 1 - 0
CHANGES.md

@@ -33,6 +33,7 @@
 - #3337: Correctly display multiline nested quotes
 - #3362: Don't create empty nick element in bookmarks
 - #3386: Registration form is not fetched
+- #3464: Missing localization: the online status is not localized
 - #3476: better UI for form "fixed" fields
 - #3478: MUC participant status indicator misplaced 
 - #3510: MUC's configuration panel loads endlessly, if it's the second one you want to configure 

+ 0 - 9
src/plugins/muc-views/constants.js

@@ -1,9 +0,0 @@
-export const PRETTY_CHAT_STATUS = {
-    'offline':      'Offline',
-    'unavailable':  'Unavailable',
-    'xa':           'Extended Away',
-    'away':         'Away',
-    'dnd':          'Do not disturb',
-    'chat':         'Chattty',
-    'online':       'Online'
-};

+ 1 - 1
src/plugins/muc-views/templates/occupant.js

@@ -2,7 +2,7 @@
  * @typedef {import('@converse/headless').MUCOccupant} MUCOccupant
  */
 import { api } from '@converse/headless';
-import { PRETTY_CHAT_STATUS } from '../constants.js';
+import { PRETTY_CHAT_STATUS } from 'shared/constants.js';
 import { __ } from 'i18n';
 import { html } from 'lit';
 import { until } from 'lit/directives/until.js';

+ 12 - 8
src/plugins/rosterview/templates/roster_filter.js

@@ -3,6 +3,7 @@
  */
 import { html } from "lit";
 import { __ } from 'i18n';
+import { PRETTY_CHAT_STATUS } from "shared/constants";
 
 /**
  * @param {ListFilter} el
@@ -14,12 +15,15 @@ export default (el) => {
     const title_status_filter = __('Filter by status');
     const label_any = __('Any');
     const label_unread_messages = __('Unread');
-    const label_available = __('Available');
-    const label_chatty = __('Chatty');
-    const label_busy = __('Busy');
-    const label_away = __('Away');
-    const label_xa = __('Extended Away');
-    const label_offline = __('Offline');
+
+    const {
+        offline: label_offline,
+        xa: label_xa,
+        away: label_away,
+        dnd: label_dnd,
+        chat: label_chatty,
+        online: label_online,
+    } = PRETTY_CHAT_STATUS;
 
     const chat_state = el.model.get('state');
     const filter_text = el.model.get('text');
@@ -48,9 +52,9 @@ export default (el) => {
                         @change=${ev => el.changeChatStateFilter(ev)}>
                     <option value="">${label_any}</option>
                     <option ?selected=${chat_state === 'unread_messages'} value="unread_messages">${label_unread_messages}</option>
-                    <option ?selected=${chat_state === 'online'} value="online">${label_available}</option>
+                    <option ?selected=${chat_state === 'online'} value="online">${label_online}</option>
                     <option ?selected=${chat_state === 'chat'} value="chat">${label_chatty}</option>
-                    <option ?selected=${chat_state === 'dnd'} value="dnd">${label_busy}</option>
+                    <option ?selected=${chat_state === 'dnd'} value="dnd">${label_dnd}</option>
                     <option ?selected=${chat_state === 'away'} value="away">${label_away}</option>
                     <option ?selected=${chat_state === 'xa'} value="xa">${label_xa}</option>
                     <option ?selected=${chat_state === 'offline'} value="offline">${label_offline}</option>

+ 22 - 0
src/shared/constants.js

@@ -1,3 +1,5 @@
+import { __ } from 'i18n';
+
 // These are all the view-layer plugins.
 //
 // For the full Converse build, this list serves
@@ -26,3 +28,23 @@ export const VIEW_PLUGINS = [
     'converse-rosterview',
     'converse-singleton'
 ];
+
+/**
+ * @typedef {Object} PrettyChatStatus
+ * @property {string} offline
+ * @property {string} unavailable
+ * @property {string} xa
+ * @property {string} away
+ * @property {string} dnd
+ * @property {string} chatty
+ * @property {string} online
+ */
+export const PRETTY_CHAT_STATUS = {
+    offline:      __('Offline'),
+    unavailable:  __('Unavailable'),
+    xa:           __('Extended Away'),
+    away:         __('Away'),
+    dnd:          __('Do not disturb'),
+    chat:         __('Chatty'),
+    online:       __('Online')
+};

+ 16 - 0
src/types/plugins/modal/popover.d.ts

@@ -0,0 +1,16 @@
+export default Popover;
+declare class Popover extends CustomElement {
+    static get properties(): {
+        title: {
+            type: StringConstructor;
+        };
+        text: {
+            type: StringConstructor;
+        };
+    };
+    title: any;
+    text: any;
+    render(): import("lit").TemplateResult<1>;
+}
+import { CustomElement } from "shared/components/element.js";
+//# sourceMappingURL=popover.d.ts.map

+ 18 - 0
src/types/shared/constants.d.ts

@@ -1,2 +1,20 @@
 export const VIEW_PLUGINS: string[];
+export namespace PRETTY_CHAT_STATUS {
+    let offline: any;
+    let unavailable: any;
+    let xa: any;
+    let away: any;
+    let dnd: any;
+    let chat: any;
+    let online: any;
+}
+export type PrettyChatStatus = {
+    offline: string;
+    unavailable: string;
+    xa: string;
+    away: string;
+    dnd: string;
+    chatty: string;
+    online: string;
+};
 //# sourceMappingURL=constants.d.ts.map