Skip to content

Commit

Permalink
Added translation API call
Browse files Browse the repository at this point in the history
Signed-off-by: cnmicha <[email protected]>
  • Loading branch information
cnmicha committed Dec 27, 2020
1 parent 0b60573 commit 2df7840
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
16 changes: 13 additions & 3 deletions js/photos-filesbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -18178,7 +18178,13 @@ var render = function() {
attrs: { icon: "icon-picture" },
on: { click: _vm.openPhotosApp }
},
[_vm._v("\n\t\t\t\tShow in photos\n\t\t\t")]
[
_vm._v(
"\n\t\t\t\t" +
_vm._s(_vm.t("photos", "Show in photos")) +
"\n\t\t\t"
)
]
)
],
1
Expand Down Expand Up @@ -27024,6 +27030,8 @@ __webpack_require__.r(__webpack_exports__);
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.runtime.esm.js");
/* harmony import */ var _FilesButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FilesButton */ "./src/FilesButton.vue");
/* harmony import */ var _nextcloud_l10n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @nextcloud/l10n */ "./node_modules/@nextcloud/l10n/dist/index.js");
/* harmony import */ var _nextcloud_l10n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_2__);
/**
* @copyright Copyright (c) 2020 cnmicha <[email protected]>
*
Expand All @@ -27047,6 +27055,7 @@ __webpack_require__.r(__webpack_exports__);
*/



/**
* Adds a button to the files app that opens the current directory in the photos app.
*/
Expand All @@ -27056,7 +27065,8 @@ __webpack_require__.r(__webpack_exports__);
// Create Vue.js root in DOM
var vueRoot = document.createElement('div');
vueRoot.id = 'open-in-photos-button-root';
document.getElementById('showgridview').insertAdjacentElement('beforebegin', vueRoot); // Create Vue.js instance
document.getElementById('showgridview').insertAdjacentElement('beforebegin', vueRoot);
vue__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.t = _nextcloud_l10n__WEBPACK_IMPORTED_MODULE_2__["translate"]; // Create Vue.js instance
// eslint-disable-next-line no-new

new vue__WEBPACK_IMPORTED_MODULE_0__["default"]({
Expand All @@ -27073,4 +27083,4 @@ __webpack_require__.r(__webpack_exports__);
/***/ })

/******/ });
//# sourceMappingURL=photos-filesbutton.js.map?v=46352b128bd47392aba3
//# sourceMappingURL=photos-filesbutton.js.map?v=d7ba2670caab7c6e10a3
2 changes: 1 addition & 1 deletion js/photos-filesbutton.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/FilesButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ActionButton
icon="icon-picture"
@click="openPhotosApp">
Show in photos
{{ t('photos', 'Show in photos') }}
</ActionButton>
</Actions>
<div v-if="photosAppLoading"
Expand Down
3 changes: 3 additions & 0 deletions src/filesbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import Vue from 'vue'
import FilesButton from './FilesButton'
import { translate } from '@nextcloud/l10n'

/**
* Adds a button to the files app that opens the current directory in the photos app.
Expand All @@ -33,6 +34,8 @@ import FilesButton from './FilesButton'
vueRoot.id = 'open-in-photos-button-root'
document.getElementById('showgridview').insertAdjacentElement('beforebegin', vueRoot)

Vue.prototype.t = translate

// Create Vue.js instance
// eslint-disable-next-line no-new
new Vue({
Expand Down

0 comments on commit 2df7840

Please sign in to comment.