mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
UBER-318: Allow to configure default language (#3342)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
d0d98f286c
commit
b6f9dba84a
@ -99,6 +99,7 @@ services:
|
||||
- MINIO_ACCESS_KEY=minioadmin
|
||||
- MINIO_SECRET_KEY=minioadmin
|
||||
- TITLE=DevPlatform
|
||||
- DEFAULT_LANGUAGE=ru
|
||||
restart: unless-stopped
|
||||
# tracker-front:
|
||||
# image: hardcoreeng/tracker-front
|
||||
|
@ -78,6 +78,7 @@ import presentation, { presentationId } from '@hcengineering/presentation'
|
||||
import { textEditorId } from '@hcengineering/text-editor'
|
||||
|
||||
import { setMetadata } from '@hcengineering/platform'
|
||||
import { setDefaultLanguage } from '@hcengineering/theme'
|
||||
|
||||
interface Config {
|
||||
ACCOUNTS_URL: string
|
||||
@ -88,6 +89,7 @@ interface Config {
|
||||
TELEGRAM_URL: string
|
||||
GMAIL_URL: string
|
||||
TITLE?: string
|
||||
DEFAULT_LANGUAGE?: string
|
||||
}
|
||||
|
||||
const devConfig = process.env.CLIENT_TYPE === 'dev-production'
|
||||
@ -163,4 +165,5 @@ export async function configurePlatform() {
|
||||
setMetadata(client.metadata.UseProtocolCompression, true)
|
||||
|
||||
setMetadata(workbench.metadata.PlatformTitle, config.TITLE ?? 'Platform')
|
||||
setDefaultLanguage(config.DEFAULT_LANGUAGE ?? 'en')
|
||||
}
|
||||
|
@ -18,6 +18,15 @@ import { writable } from 'svelte/store'
|
||||
|
||||
export { default as Theme } from './Theme.svelte'
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const setDefaultLanguage = (language: string): void => {
|
||||
if (localStorage.getItem('lang') === null) {
|
||||
localStorage.setItem('lang', language)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
|
@ -41,6 +41,7 @@
|
||||
"NoLimit": "No limit",
|
||||
"AlreadyJoined": "Already joined?",
|
||||
"ConfirmationSent": "A message has been sent to your email containing a link to confirm the your address.",
|
||||
"ConfirmationSent2": "Please follow the link to complete your sign up."
|
||||
"ConfirmationSent2": "Please follow the link to complete your sign up.",
|
||||
"Slogan": "A unique place to manage all of your work\nWelcome to the Platform"
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@
|
||||
"NoLimit": "Без предела использований",
|
||||
"AlreadyJoined": "Уже подключены?",
|
||||
"ConfirmationSent": "На Вашу почту отправлено сообщение, c ссылкой для подтверждения email.",
|
||||
"ConfirmationSent2": "Пожалуйста, перейдите по ссылке для завершения регистрации."
|
||||
"ConfirmationSent2": "Пожалуйста, перейдите по ссылке для завершения регистрации.",
|
||||
"Slogan": "Уникальное место для организации всей вашей работы\nДобро пожаловать в Платформу"
|
||||
}
|
||||
}
|
||||
|
@ -14,10 +14,21 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { translate } from '@hcengineering/platform'
|
||||
import { deviceOptionsStore as deviceInfo } from '@hcengineering/ui'
|
||||
|
||||
import plugin from '../plugin'
|
||||
export let landscape: boolean = false
|
||||
export let mini: boolean = false
|
||||
|
||||
let slogan = ''
|
||||
|
||||
translate(plugin.string.Slogan, {})
|
||||
.then((r) => {
|
||||
slogan = r
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="intro" class:landscape class:mini>
|
||||
@ -25,8 +36,11 @@
|
||||
<div class="logo {$deviceInfo.theme === 'theme-light' ? 'dark' : 'light'}" />
|
||||
</div>
|
||||
<div class="slogan">
|
||||
<p>A unique place to manage all of your work</p>
|
||||
<p>Welcome to the Platform</p>
|
||||
{#each slogan.split('\n') as p}
|
||||
<p>
|
||||
{p}
|
||||
</p>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -58,6 +58,7 @@ export default mergeIds(loginId, login, {
|
||||
GetLink: '' as IntlString,
|
||||
AlreadyJoined: '' as IntlString,
|
||||
ConfirmationSent: '' as IntlString,
|
||||
ConfirmationSent2: '' as IntlString
|
||||
ConfirmationSent2: '' as IntlString,
|
||||
Slogan: '' as IntlString
|
||||
}
|
||||
})
|
||||
|
@ -17,7 +17,7 @@
|
||||
export let workspace: string
|
||||
</script>
|
||||
|
||||
<div class="antiLogo red" class:mini>{workspace.toUpperCase()[0]}</div>
|
||||
<div class="antiLogo red" class:mini>{workspace?.toUpperCase()?.[0]}</div>
|
||||
|
||||
<style lang="scss">
|
||||
.antiLogo {
|
||||
|
@ -19,6 +19,7 @@ import { setMetadata } from '@hcengineering/platform'
|
||||
import serverToken from '@hcengineering/server-token'
|
||||
import { start } from '.'
|
||||
|
||||
const defaultLanguage = process.env.DEFAULT_LANGUAGE ?? 'en'
|
||||
const SERVER_PORT = parseInt(process.env.SERVER_PORT ?? '8080')
|
||||
|
||||
const transactorEndpoint = process.env.TRANSACTOR_URL
|
||||
@ -122,7 +123,8 @@ const config = {
|
||||
gmailUrl,
|
||||
telegramUrl,
|
||||
rekoniUrl,
|
||||
title
|
||||
title,
|
||||
defaultLanguage
|
||||
}
|
||||
console.log('Starting Front service with', config)
|
||||
const shutdown = start(config, SERVER_PORT)
|
||||
|
@ -141,6 +141,7 @@ export function start (
|
||||
telegramUrl: string
|
||||
gmailUrl: string
|
||||
title?: string
|
||||
defaultLanguage: string
|
||||
},
|
||||
port: number
|
||||
): () => void {
|
||||
@ -177,7 +178,8 @@ export function start (
|
||||
REKONI_URL: config.rekoniUrl,
|
||||
TELEGRAM_URL: config.telegramUrl,
|
||||
GMAIL_URL: config.gmailUrl,
|
||||
TITLE: config.title
|
||||
TITLE: config.title,
|
||||
DEFAULT_LANGUAGE: config.defaultLanguage
|
||||
})
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user