Skip to content

Commit

Permalink
Don't rely on Vue.prototype.t
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Sep 10, 2021
1 parent b46a4cb commit 9024527
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 0 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ import Avatar from '@nextcloud/vue/dist/Components/Avatar'
Some components require Nextcloud functionality to work, so it is currently recommended to extend Vue with the following:

```js static
Vue.prototype.t = window.t
Vue.prototype.n = window.n
Vue.prototype.OC = window.OC
Vue.prototype.OCA = window.OCA
```
Expand Down
2 changes: 2 additions & 0 deletions src/components/AppNavigationItem/InputConfirmCancel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
</div>
</template>
<script>
import { t } from '../../l10n'
import ArrowRight from 'vue-material-design-icons/ArrowRight'
import Close from 'vue-material-design-icons/Close'
Expand Down
2 changes: 2 additions & 0 deletions src/components/AppSettingsDialog/AppSettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export default {
<script>
import Modal from '../Modal'
import isMobile from '../../mixins/isMobile'
import { t } from '../../l10n'
import debounce from 'debounce'
export default {
Expand Down
4 changes: 4 additions & 0 deletions src/components/DatetimePicker/DatetimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ import DatePicker from 'vue2-datepicker'
import Popover from '../Popover/index'
import TimezonePicker from '../TimezonePicker'
import l10n from '../../mixins/l10n'
export default {
name: 'DatetimePicker',
Expand All @@ -159,6 +161,8 @@ export default {
TimezonePicker,
},
mixins: [l10n],
inheritAttrs: false,
props: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/RichContenteditable/RichContenteditable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ import Tribute from 'tributejs/dist/tribute.esm'
import debounce from 'debounce'
import stringLength from 'string-length'
import { t } from '../../l10n.js'
import { t } from '../../l10n'
import AutoCompleteResult from './AutoCompleteResult'
import richEditor from '../../mixins/richEditor/index'
Expand Down
2 changes: 2 additions & 0 deletions src/components/SettingsSelectGroup/SettingsSelectGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import GenRandomId from '../../utils/GenRandomId'
import { generateOcsUrl } from '@nextcloud/router'
import { showError } from '@nextcloud/dialogs'
import l10n from '../../mixins/l10n'
import { t } from '../../l10n'
export default {
name: 'SettingsSelectGroup',
components: {
Expand Down
3 changes: 0 additions & 3 deletions styleguide/global.requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ window.OC = {
window.OCA = {}
window.appName = 'nextcloud-vue'

window.t = (app, text) => text

Vue.prototype.t = window.t
Vue.prototype.OC = window.OC
Vue.prototype.OCA = window.OCA

Expand Down

0 comments on commit 9024527

Please sign in to comment.