diff --git a/changelog.md b/changelog.md index 615a072128..9e562ded0d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,18 @@ # Changelog -## 0.6.32 (upcoming) +## 0.6.110 (upcoming) + +- UBER-526: Live reload on language changes. + + Function translate is updated to pass language, so be aware to use `$themeState.language` to properly use translation. + + ```javascript + function translate(id:string, params: Record, language?:string): Promise { + //... + } + ``` + +## 0.6.32 Tracker: diff --git a/dev/prod/webpack.config.js b/dev/prod/webpack.config.js index 3b87dd7241..a8d3cf0da4 100644 --- a/dev/prod/webpack.config.js +++ b/dev/prod/webpack.config.js @@ -212,6 +212,8 @@ module.exports = { // https://webpack.js.org/configuration/watch/#watchoptionsignored // don't use this pattern, if you have a monorepo with linked packages ignored: /node_modules/, + aggregateTimeout: 500, + poll: 1000 }, devtool: prod ? false : 'inline-source-map', devServer: { diff --git a/packages/platform/src/i18n.ts b/packages/platform/src/i18n.ts index 81ec45310b..f996a5bfdb 100644 --- a/packages/platform/src/i18n.ts +++ b/packages/platform/src/i18n.ts @@ -47,10 +47,13 @@ export function addStringsLoader (plugin: Plugin, loader: Loader): void { * Perform load of all internationalization sources for all plugins available. * @public */ -export async function loadPluginStrings (locale: string): Promise { +export async function loadPluginStrings (locale: string, force: boolean = false): Promise { + if (force) { + cache.clear() + } for (const [plugin] of loaders) { let messages = translations.get(plugin) - if (messages === undefined) { + if (messages === undefined || force) { messages = await loadTranslationsForComponent(plugin, locale) translations.set(plugin, messages) } @@ -100,8 +103,12 @@ async function getTranslation (id: _IdInfo, locale: string): Promise> (message: IntlString

, params: P): Promise { - const locale = getMetadata(platform.metadata.locale) ?? 'en' +export async function translate

> ( + message: IntlString

, + params: P, + language?: string +): Promise { + const locale = language ?? getMetadata(platform.metadata.locale) ?? 'en' const compiled = cache.get(message) if (compiled !== undefined) { diff --git a/packages/presentation/src/components/SpaceMultiBoxList.svelte b/packages/presentation/src/components/SpaceMultiBoxList.svelte index 869996b1fd..406a48b355 100644 --- a/packages/presentation/src/components/SpaceMultiBoxList.svelte +++ b/packages/presentation/src/components/SpaceMultiBoxList.svelte @@ -20,6 +20,7 @@ import { showPopup, Button } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import presentation, { SpacesMultiPopup } from '..' + import { themeStore } from '@hcengineering/ui' export let selectedItems: Ref[] = [] export let _classes: Ref>[] = [] @@ -65,7 +66,7 @@ {#if selectedItems.length > 0}

- {#await translate(presentation.string.NumberSpaces, { count: selectedItems.length }) then text} + {#await translate(presentation.string.NumberSpaces, { count: selectedItems.length }, $themeStore.language) then text} {text} {/await}
diff --git a/packages/presentation/src/configuration.ts b/packages/presentation/src/configuration.ts index 00906a874a..ec3a0e11b5 100644 --- a/packages/presentation/src/configuration.ts +++ b/packages/presentation/src/configuration.ts @@ -15,8 +15,9 @@ import core, { PluginConfiguration, SortingOrder } from '@hcengineering/core' import { Plugin, Resource, getResourcePlugin } from '@hcengineering/platform' -import { writable } from 'svelte/store' +import { get, writable } from 'svelte/store' import { createQuery } from '.' +import { location as platformLocation } from '@hcengineering/ui' /** * @public @@ -41,6 +42,9 @@ export const configurationStore = writable(configuration) const configQuery = createQuery(true) +let hashString = '' +let workspaceId: string = '' + /** * @public */ @@ -52,10 +56,15 @@ configQuery.query( core.class.PluginConfiguration, {}, (res) => { - if (configuration.list.length > 0) { - // Configuration + const newHash = res.map((it) => `${it.pluginId}=${it.enabled ? '+' : '-'}`).join('&') + const wsId = get(platformLocation).path[1] + + if (hashString !== '' && hashString !== newHash && workspaceId !== '' && workspaceId === wsId) { + // Configuration is changed for same workspace. location.reload() } + workspaceId = wsId + hashString = newHash configuration = new ConfigurationManager(res, new Map(res.map((it) => [it.pluginId, it]))) configurationStore.set(configuration) }, diff --git a/packages/text-editor/src/components/CollaboratorEditor.svelte b/packages/text-editor/src/components/CollaboratorEditor.svelte index 8b63039cec..d97961b029 100644 --- a/packages/text-editor/src/components/CollaboratorEditor.svelte +++ b/packages/text-editor/src/components/CollaboratorEditor.svelte @@ -114,7 +114,7 @@ let placeHolderStr: string = '' - $: ph = translate(placeholder, {}).then((r) => { + $: ph = translate(placeholder, {}, $themeStore.language).then((r) => { placeHolderStr = r }) diff --git a/packages/text-editor/src/components/TextEditor.svelte b/packages/text-editor/src/components/TextEditor.svelte index 45968943f7..4b7d24ef67 100644 --- a/packages/text-editor/src/components/TextEditor.svelte +++ b/packages/text-editor/src/components/TextEditor.svelte @@ -25,6 +25,7 @@ import { FormatMode } from '../types' import { defaultExtensions } from './extensions' import { Node as ProseMirrorNode } from '@tiptap/pm/model' + import { themeStore } from '@hcengineering/ui' export let content: string = '' export let placeholder: IntlString = textEditorPlugin.string.EditorPlaceholder @@ -37,7 +38,7 @@ let placeHolderStr: string = '' - $: ph = translate(placeholder, {}).then((r) => { + $: ph = translate(placeholder, {}, $themeStore.language).then((r) => { placeHolderStr = r }) diff --git a/packages/theme/src/Theme.svelte b/packages/theme/src/Theme.svelte index cb991a85ac..7dbe24e74d 100644 --- a/packages/theme/src/Theme.svelte +++ b/packages/theme/src/Theme.svelte @@ -21,38 +21,45 @@ const currentFontSize = getCurrentFontSize() let currentLanguage = getCurrentLanguage() - const setRootColors = (theme: string) => { - document.documentElement.setAttribute('class', `${theme} ${getCurrentFontSize()}`) - themeOptions.set( - new ThemeOptions(getCurrentFontSize() === 'normal-font' ? 16 : 14, getCurrentTheme() === 'theme-dark') - ) + const setOptions = (currentFont: string, theme: string, language: string) => { + themeOptions.set(new ThemeOptions(currentFont === 'normal-font' ? 16 : 14, theme === 'theme-dark', language)) } - const setRootFontSize = (fontsize: string) => { + + const setRootColors = (theme: string, set = true) => { + if (set) { + localStorage.setItem('theme', theme) + } + document.documentElement.setAttribute('class', `${theme} ${getCurrentFontSize()}`) + setOptions(getCurrentFontSize(), theme, getCurrentLanguage()) + } + const setRootFontSize = (fontsize: string, set = true) => { + if (set) { + localStorage.setItem('fontsize', fontsize) + } document.documentElement.setAttribute('class', `${getCurrentTheme()} ${fontsize}`) - themeOptions.set(new ThemeOptions(fontsize === 'normal-font' ? 16 : 14, getCurrentTheme() === 'theme-dark')) + setOptions(fontsize, getCurrentTheme(), getCurrentLanguage()) + } + const setLanguage = async (language: string, set: boolean = true) => { + currentLanguage = language + if (set) { + localStorage.setItem('lang', language) + } + setMetadata(platform.metadata.locale, currentLanguage) + await loadPluginStrings(currentLanguage, set) + setOptions(getCurrentFontSize(), getCurrentTheme(), language) } setContext('theme', { currentTheme, - setTheme: (name: string) => { - localStorage.setItem('theme', name) - setRootColors(name) - } + setTheme: setRootColors }) setContext('fontsize', { currentFontSize, - setFontSize: (fontsize: string) => { - localStorage.setItem('fontsize', fontsize) - setRootFontSize(fontsize) - } + setFontSize: setRootFontSize }) setContext('lang', { currentLanguage, - setLanguage: (lang: string) => { - currentLanguage = lang - localStorage.setItem('lang', lang) - location.reload() - } + setLanguage }) const setDocumentLanguage = (): void => { @@ -60,9 +67,9 @@ } onMount(() => { - setRootColors(currentTheme) - setRootFontSize(currentFontSize) - setMetadata(platform.metadata.locale, currentLanguage) + setRootColors(currentTheme, false) + setRootFontSize(currentFontSize, false) + setLanguage(currentLanguage, false) loadPluginStrings(currentLanguage) setDocumentLanguage() }) diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts index d9fc5e6476..915aa1bf65 100644 --- a/packages/theme/src/index.ts +++ b/packages/theme/src/index.ts @@ -41,8 +41,12 @@ export const getCurrentFontSize = (): string => localStorage.getItem('fontsize') export const getCurrentLanguage = (): string => localStorage.getItem('lang') ?? 'en' export class ThemeOptions { - constructor (readonly fontSize: number, readonly dark: boolean) {} + constructor (readonly fontSize: number, readonly dark: boolean, readonly language: string) {} } export const themeStore = writable( - new ThemeOptions(getCurrentFontSize() === 'normal-font' ? 16 : 14, getCurrentTheme() === 'theme-dark') + new ThemeOptions( + getCurrentFontSize() === 'normal-font' ? 16 : 14, + getCurrentTheme() === 'theme-dark', + getCurrentLanguage() + ) ) diff --git a/packages/ui/src/components/DropdownPopup.svelte b/packages/ui/src/components/DropdownPopup.svelte index a86706ee2c..d4204d64d5 100644 --- a/packages/ui/src/components/DropdownPopup.svelte +++ b/packages/ui/src/components/DropdownPopup.svelte @@ -21,6 +21,7 @@ import type { AnySvelteComponent, ListItem } from '../types' import Icon from './Icon.svelte' import ListView from './ListView.svelte' + import { themeStore } from '@hcengineering/theme' export let icon: Asset | AnySvelteComponent export let placeholder: IntlString = plugin.string.SearchDots @@ -29,7 +30,7 @@ let search: string = '' let phTraslate: string = '' $: if (placeholder) { - translate(placeholder, {}).then((res) => { + translate(placeholder, {}, $themeStore.language).then((res) => { phTraslate = res }) } diff --git a/packages/ui/src/components/EditBox.svelte b/packages/ui/src/components/EditBox.svelte index 9b14126905..a821ecdea3 100644 --- a/packages/ui/src/components/EditBox.svelte +++ b/packages/ui/src/components/EditBox.svelte @@ -23,6 +23,7 @@ import Label from './Label.svelte' import { resizeObserver } from '../resize' import { floorFractionDigits } from '../utils' + import { themeStore } from '@hcengineering/theme' export let label: IntlString | undefined = undefined export let icon: Asset | AnySvelteComponent | undefined = undefined @@ -62,7 +63,7 @@ $: style = `max-width: ${ maxWidth || (parentWidth ? (icon ? `calc(${parentWidth}px - 1.25rem)` : `${parentWidth}px`) : 'max-content') };` - $: translate(placeholder, placeholderParam ?? {}).then((res) => { + $: translate(placeholder, placeholderParam ?? {}, $themeStore.language).then((res) => { phTraslate = res }) diff --git a/packages/ui/src/components/Label.svelte b/packages/ui/src/components/Label.svelte index 18667733a8..2a6ce9dd4f 100644 --- a/packages/ui/src/components/Label.svelte +++ b/packages/ui/src/components/Label.svelte @@ -15,6 +15,7 @@ {#if text} diff --git a/packages/ui/src/components/TextArea.svelte b/packages/ui/src/components/TextArea.svelte index 645acd1126..361a7d31cb 100644 --- a/packages/ui/src/components/TextArea.svelte +++ b/packages/ui/src/components/TextArea.svelte @@ -17,6 +17,7 @@ import { translate } from '@hcengineering/platform' import plugin from '../plugin' import Label from './Label.svelte' + import { themeStore } from '@hcengineering/theme' export let label: IntlString | undefined = undefined export let width: string | undefined = undefined @@ -30,7 +31,7 @@ let input: HTMLTextAreaElement let phTraslate: string = '' - $: translate(placeholder, placeholderParam ?? {}).then((res) => { + $: translate(placeholder, placeholderParam ?? {}, $themeStore.language).then((res) => { phTraslate = res }) diff --git a/packages/ui/src/components/TimeShiftPresenter.svelte b/packages/ui/src/components/TimeShiftPresenter.svelte index 1116f852c0..a225b890f8 100644 --- a/packages/ui/src/components/TimeShiftPresenter.svelte +++ b/packages/ui/src/components/TimeShiftPresenter.svelte @@ -15,6 +15,7 @@ diff --git a/plugins/board-resources/src/components/selectors/StateSelect.svelte b/plugins/board-resources/src/components/selectors/StateSelect.svelte index db24c65425..6a7337a365 100644 --- a/plugins/board-resources/src/components/selectors/StateSelect.svelte +++ b/plugins/board-resources/src/components/selectors/StateSelect.svelte @@ -4,7 +4,7 @@ import { IntlString, translate } from '@hcengineering/platform' import { createQuery } from '@hcengineering/presentation' import task, { State } from '@hcengineering/task' - import { DropdownLabels, DropdownTextItem } from '@hcengineering/ui' + import { DropdownLabels, DropdownTextItem, themeStore } from '@hcengineering/ui' import board from '../../plugin' export let object: Card @@ -23,7 +23,11 @@ ;[{ _id: selected }] = result if (object.space === space) { const index = states.findIndex(({ id }) => id === object.state) - states[index].label = await translate(board.string.Current, { label: states[index].label }) + states[index].label = await translate( + board.string.Current, + { label: states[index].label }, + $themeStore.language + ) selected = object.state } }, diff --git a/plugins/calendar-resources/src/components/DateTimePresenter.svelte b/plugins/calendar-resources/src/components/DateTimePresenter.svelte index 768ad3e223..544428045e 100644 --- a/plugins/calendar-resources/src/components/DateTimePresenter.svelte +++ b/plugins/calendar-resources/src/components/DateTimePresenter.svelte @@ -16,7 +16,7 @@ import { Event } from '@hcengineering/calendar' import { DateRangeMode } from '@hcengineering/core' import { translate } from '@hcengineering/platform' - import { DateRangePresenter } from '@hcengineering/ui' + import { DateRangePresenter, themeStore } from '@hcengineering/ui' import calendar from '../plugin' export let value: Event @@ -45,11 +45,11 @@ let passed = interval if (interval < 0) passed = 0 if (passed < HOUR) { - return await translate(calendar.string.DueMinutes, { minutes: Math.floor(passed / MINUTE) }) + return await translate(calendar.string.DueMinutes, { minutes: Math.floor(passed / MINUTE) }, $themeStore.language) } else if (passed < DAY) { - return await translate(calendar.string.DueHours, { hours: Math.floor(passed / HOUR) }) + return await translate(calendar.string.DueHours, { hours: Math.floor(passed / HOUR) }, $themeStore.language) } else { - return await translate(calendar.string.DueDays, { days: Math.floor(passed / DAY) }) + return await translate(calendar.string.DueDays, { days: Math.floor(passed / DAY) }, $themeStore.language) } } diff --git a/plugins/contact-resources/src/components/ChannelEditor.svelte b/plugins/contact-resources/src/components/ChannelEditor.svelte index f4b44506a7..91f3c9dd55 100644 --- a/plugins/contact-resources/src/components/ChannelEditor.svelte +++ b/plugins/contact-resources/src/components/ChannelEditor.svelte @@ -16,7 +16,7 @@ import type { IntlString } from '@hcengineering/platform' import { translate } from '@hcengineering/platform' import { copyTextToClipboard } from '@hcengineering/presentation' - import type { PopupOptions } from '@hcengineering/ui' + import { PopupOptions, themeStore } from '@hcengineering/ui' import { Button, createFocusManager, @@ -39,10 +39,10 @@ const dispatch = createEventDispatcher() let input: HTMLInputElement let phTraslate: string - $: translate(placeholder, {}).then((tr) => (phTraslate = tr)) + $: translate(placeholder, {}, $themeStore.language).then((tr) => (phTraslate = tr)) let label: IntlString = plugin.string.CopyToClipboard let lTraslate: string - $: translate(label, {}).then((tr) => (lTraslate = tr)) + $: translate(label, {}, $themeStore.language).then((tr) => (lTraslate = tr)) let show: boolean = false const copyChannel = (): void => { diff --git a/plugins/contact-resources/src/components/EmployeeFilter.svelte b/plugins/contact-resources/src/components/EmployeeFilter.svelte index 757c557d26..11aa45f161 100644 --- a/plugins/contact-resources/src/components/EmployeeFilter.svelte +++ b/plugins/contact-resources/src/components/EmployeeFilter.svelte @@ -25,7 +25,8 @@ IconCheck, IconSearch, Loading, - resizeObserver + resizeObserver, + themeStore } from '@hcengineering/ui' import { Filter } from '@hcengineering/view' import { FILTER_DEBOUNCE_MS, FilterRemovedNotification, sortFilterValues } from '@hcengineering/view-resources' @@ -88,9 +89,14 @@ const removed = oldSize - (filter.value.length ?? 0) if (removed > 0) { onChange(filter) - addNotification(await translate(view.string.FilterUpdated, {}), filter.key.label, FilterRemovedNotification, { - description: await translate(view.string.FilterRemoved, { count: removed }) - }) + addNotification( + await translate(view.string.FilterUpdated, {}, $themeStore.language), + filter.key.label, + FilterRemovedNotification, + { + description: await translate(view.string.FilterRemoved, { count: removed }, $themeStore.language) + } + ) } } values = sortFilterValues(values, (v) => isSelected(v, filter.value)) diff --git a/plugins/contact-resources/src/components/MembersPresenter.svelte b/plugins/contact-resources/src/components/MembersPresenter.svelte index 7c3b020bb9..4e9c9f4442 100644 --- a/plugins/contact-resources/src/components/MembersPresenter.svelte +++ b/plugins/contact-resources/src/components/MembersPresenter.svelte @@ -14,7 +14,7 @@ --> {#if integration} diff --git a/plugins/tags-resources/src/components/TagsCategoryPopup.svelte b/plugins/tags-resources/src/components/TagsCategoryPopup.svelte index 42e45c88bc..d7d06c4116 100644 --- a/plugins/tags-resources/src/components/TagsCategoryPopup.svelte +++ b/plugins/tags-resources/src/components/TagsCategoryPopup.svelte @@ -47,7 +47,7 @@ let phTraslate: string = '' $: if (placeholder) { - translate(placeholder, {}).then((res) => { + translate(placeholder, {}, $themeStore.language).then((res) => { phTraslate = res }) } diff --git a/plugins/tags-resources/src/components/TagsDropdownEditor.svelte b/plugins/tags-resources/src/components/TagsDropdownEditor.svelte index 3e87f88774..29ea5d732a 100644 --- a/plugins/tags-resources/src/components/TagsDropdownEditor.svelte +++ b/plugins/tags-resources/src/components/TagsDropdownEditor.svelte @@ -18,7 +18,7 @@ import { KeyedAttribute } from '@hcengineering/presentation' import { TagElement, TagReference } from '@hcengineering/tags' import type { ButtonKind, ButtonSize, TooltipAlignment } from '@hcengineering/ui' - import { Button, showPopup } from '@hcengineering/ui' + import { Button, showPopup, themeStore } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import tags from '../plugin' import TagsPopup from './TagsPopup.svelte' @@ -43,7 +43,7 @@ $: itemLabel = (key.attr.type as Collection).itemLabel - $: translate(itemLabel ?? key.attr.label, {}).then((v) => { + $: translate(itemLabel ?? key.attr.label, {}, $themeStore.language).then((v) => { keyLabel = v }) @@ -90,7 +90,7 @@ {#if items.length > 0} - {#await translate(countLabel, { count: items.length }) then text} + {#await translate(countLabel, { count: items.length }, $themeStore.language) then text} {text} {/await} diff --git a/plugins/tags-resources/src/components/TagsEditor.svelte b/plugins/tags-resources/src/components/TagsEditor.svelte index 55bffd8c95..a92edd69a9 100644 --- a/plugins/tags-resources/src/components/TagsEditor.svelte +++ b/plugins/tags-resources/src/components/TagsEditor.svelte @@ -24,7 +24,8 @@ IconClose, Label, ShowMore, - showPopup + showPopup, + themeStore } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import tags from '../plugin' @@ -45,7 +46,7 @@ $: itemLabel = (key.attr.type as Collection).itemLabel - $: translate(itemLabel ?? key.attr.label, {}).then((v) => { + $: translate(itemLabel ?? key.attr.label, {}, $themeStore.language).then((v) => { keyLabel = v }) diff --git a/plugins/tags-resources/src/components/TagsView.svelte b/plugins/tags-resources/src/components/TagsView.svelte index 5c20a2c206..d5f2ca1942 100644 --- a/plugins/tags-resources/src/components/TagsView.svelte +++ b/plugins/tags-resources/src/components/TagsView.svelte @@ -17,7 +17,7 @@ import { Asset, IntlString, translate } from '@hcengineering/platform' import { createQuery } from '@hcengineering/presentation' import { TagCategory, TagElement } from '@hcengineering/tags' - import { AnySvelteComponent, Button, Label, SearchEdit, showPopup, IconAdd } from '@hcengineering/ui' + import { AnySvelteComponent, Button, Label, SearchEdit, showPopup, IconAdd, themeStore } from '@hcengineering/ui' import { TableBrowser } from '@hcengineering/view-resources' import tags from '../plugin' import CategoryBar from './CategoryBar.svelte' @@ -32,7 +32,7 @@ export let onTag: ((tag: TagElement) => void) | undefined = undefined let keyTitle: string - $: translate(item, {}).then((t) => { + $: translate(item, {}, $themeStore.language).then((t) => { keyTitle = t.toLowerCase() }) diff --git a/plugins/tracker-resources/src/components/ComponentSelector.svelte b/plugins/tracker-resources/src/components/ComponentSelector.svelte index 9b93eea577..dadc749b8c 100644 --- a/plugins/tracker-resources/src/components/ComponentSelector.svelte +++ b/plugins/tracker-resources/src/components/ComponentSelector.svelte @@ -18,7 +18,7 @@ import { createQuery } from '@hcengineering/presentation' import { Component, Project } from '@hcengineering/tracker' import type { ButtonKind, ButtonSize } from '@hcengineering/ui' - import { Button, ButtonShape, Label, SelectPopup, eventToHTMLElement, showPopup } from '@hcengineering/ui' + import { Button, ButtonShape, Label, SelectPopup, eventToHTMLElement, showPopup, themeStore } from '@hcengineering/ui' import tracker from '../plugin' export let value: Ref | null | undefined @@ -57,7 +57,7 @@ $: handleSelectedComponentIdUpdated(value, rawComponents) - $: translate(tracker.string.NoComponent, {}).then((result) => (defaultComponentLabel = result)) + $: translate(tracker.string.NoComponent, {}, $themeStore.language).then((result) => (defaultComponentLabel = result)) $: componentText = shouldShowLabel ? selectedComponent?.label ?? defaultComponentLabel : undefined const handleSelectedComponentIdUpdated = async ( diff --git a/plugins/tracker-resources/src/components/CreateIssue.svelte b/plugins/tracker-resources/src/components/CreateIssue.svelte index 2e0806b04a..f1ba2c71c5 100644 --- a/plugins/tracker-resources/src/components/CreateIssue.svelte +++ b/plugins/tracker-resources/src/components/CreateIssue.svelte @@ -50,7 +50,8 @@ FocusHandler, IconAttachment, Label, - showPopup + showPopup, + themeStore } from '@hcengineering/ui' import { Attachment } from '@hcengineering/attachment' import { AttachmentPresenter } from '@hcengineering/attachment-resources' @@ -417,11 +418,16 @@ ] : [{ parentId: _id, parentTitle: value.title }] await subIssuesComponent.save(parents, _id) - addNotification(await translate(tracker.string.IssueCreated, {}), getTitle(object.title), IssueNotification, { - issueId: _id, - subTitlePostfix: (await translate(tracker.string.CreatedOne, {})).toLowerCase(), - issueUrl: currentProject && generateIssueShortLink(getIssueId(currentProject, value as Issue)) - }) + addNotification( + await translate(tracker.string.IssueCreated, {}, $themeStore.language), + getTitle(object.title), + IssueNotification, + { + issueId: _id, + subTitlePostfix: (await translate(tracker.string.CreatedOne, {}, $themeStore.language)).toLowerCase(), + issueUrl: currentProject && generateIssueShortLink(getIssueId(currentProject, value as Issue)) + } + ) // Create an backlink to document await createBacklinks(client, _id, tracker.class.Issue, _id, object.description) diff --git a/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte b/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte index ab69f48c39..3be115b1c2 100644 --- a/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte +++ b/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte @@ -15,7 +15,7 @@ diff --git a/plugins/tracker-resources/src/components/templates/IssueTemplatesView.svelte b/plugins/tracker-resources/src/components/templates/IssueTemplatesView.svelte index a77b186e87..36b9a74a41 100644 --- a/plugins/tracker-resources/src/components/templates/IssueTemplatesView.svelte +++ b/plugins/tracker-resources/src/components/templates/IssueTemplatesView.svelte @@ -3,7 +3,15 @@ import { IntlString, translate } from '@hcengineering/platform' import { createQuery } from '@hcengineering/presentation' import { IssueTemplate } from '@hcengineering/tracker' - import { Button, IconAdd, IconDetails, IconDetailsFilled, resolvedLocationStore, showPopup } from '@hcengineering/ui' + import { + Button, + IconAdd, + IconDetails, + IconDetailsFilled, + resolvedLocationStore, + showPopup, + themeStore + } from '@hcengineering/ui' import view, { Viewlet } from '@hcengineering/view' import { FilterBar, @@ -59,7 +67,7 @@ $: active = $activeViewlet[key] $: if (!label && title) { - translate(title, {}).then((res) => { + translate(title, {}, $themeStore.language).then((res) => { label = res }) } diff --git a/plugins/tracker-resources/src/components/workflow/StatusInput.svelte b/plugins/tracker-resources/src/components/workflow/StatusInput.svelte index 740c7354c7..0095422153 100644 --- a/plugins/tracker-resources/src/components/workflow/StatusInput.svelte +++ b/plugins/tracker-resources/src/components/workflow/StatusInput.svelte @@ -15,6 +15,7 @@