This repository has been archived by the owner on Oct 5, 2023. It is now read-only.
forked from stream-labs/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
549 changed files
with
12,554 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { I18nService } from 'services/i18n'; | ||
|
||
window['eval'] = global.eval = () => { | ||
throw new Error('window.eval() is disabled for security'); | ||
}; | ||
|
@@ -17,12 +19,14 @@ import Raven from 'raven-js'; | |
import RavenVue from 'raven-js/plugins/vue'; | ||
import RavenConsole from 'raven-js/plugins/console'; | ||
import VTooltip from 'v-tooltip'; | ||
import VueI18n from 'vue-i18n'; | ||
|
||
const { ipcRenderer, remote } = electron; | ||
|
||
const slobsVersion = remote.process.env.SLOBS_VERSION; | ||
const isProduction = process.env.NODE_ENV === 'production'; | ||
|
||
|
||
// This is the development DSN | ||
let sentryDsn = 'https://[email protected]/252950'; | ||
|
||
|
@@ -88,6 +92,7 @@ document.addEventListener('DOMContentLoaded', () => { | |
const storePromise = createStore(); | ||
const servicesManager: ServicesManager = ServicesManager.instance; | ||
const windowsService: WindowsService = WindowsService.instance; | ||
const i18nService: I18nService = I18nService.instance; | ||
const obsApiService = ObsApiService.instance; | ||
const windowId = Utils.getCurrentUrlParams().windowId; | ||
|
||
|
@@ -103,16 +108,31 @@ document.addEventListener('DOMContentLoaded', () => { | |
|
||
window['obs'] = obsApiService.nodeObs; | ||
|
||
storePromise.then(store => { | ||
storePromise.then(async store => { | ||
|
||
Vue.use(VueI18n); | ||
|
||
await i18nService.load(); | ||
|
||
const i18n = new VueI18n({ | ||
locale: i18nService.state.locale, | ||
fallbackLocale: i18nService.getFallbackLocale(), | ||
messages: i18nService.getLoadedDictionaries() | ||
}); | ||
|
||
I18nService.setVuei18nInstance(i18n); | ||
|
||
const vm = new Vue({ | ||
el: '#app', | ||
i18n, | ||
store, | ||
render: h => { | ||
const componentName = windowsService.state[windowId].componentName; | ||
|
||
return h(windowsService.components[componentName]); | ||
} | ||
}); | ||
|
||
}); | ||
|
||
// Used for replacing the contents of this window with | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<template> | ||
<div> | ||
<div class="section"> | ||
<br/><br/> | ||
<language-settings/> | ||
</div> | ||
|
||
<!--<div class="section">--> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<div class="section"> | ||
<GenericForm :value="settings" @input="save"></GenericForm> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" src="./LanguageSettings.vue.ts"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Vue from 'vue'; | ||
import { Component } from 'vue-property-decorator'; | ||
import { Inject } from 'util/injector'; | ||
import { $t, I18nServiceApi } from 'services/i18n'; | ||
import GenericForm from 'components/shared/forms/GenericForm.vue'; | ||
import { TFormData } from './shared/forms/Input'; | ||
import electron from 'electron'; | ||
|
||
@Component({ | ||
components: { GenericForm } | ||
}) | ||
export default class LanguageSettings extends Vue { | ||
@Inject() private i18nService: I18nServiceApi; | ||
|
||
settings = this.i18nService.getLocaleFormData(); | ||
|
||
private async save(data: TFormData) { | ||
const choice = electron.remote.dialog.showMessageBox( | ||
electron.remote.getCurrentWindow(), | ||
{ | ||
type: 'question', | ||
buttons: [$t('Yes'), $t('No')], | ||
title: $t('Confirm'), | ||
message: $t('This action will restart the application. Continue?') | ||
}); | ||
|
||
if (choice !== 0) return; | ||
|
||
await this.i18nService.setLocale(data[0].value as string); | ||
this.settings = this.i18nService.getLocaleFormData(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.