TranslationController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 48
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getLanguageStrings() 0 25 1
1
<?php
2
/**
3
 * Nextcloud - NextNote
4
 *
5
 *
6
 * @copyright Copyright (c) 2017, Sander Brand ([email protected])
7
 * @license GNU AGPL version 3 or any later version
8
 *
9
 * This program is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License as
11
 * published by the Free Software Foundation, either version 3 of the
12
 * License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU Affero General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Affero General Public License
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 *
22
 */
23
24
namespace OCA\NextNote\Controller;
25
26
27
use \OCP\AppFramework\ApiController;
28
use OCP\AppFramework\Http\JSONResponse;
29
use OCP\IL10N;
30
use \OCP\IRequest;
31
32
class TranslationController extends ApiController {
33
34
	private $trans;
35
36
	public function __construct($AppName,
37
								IRequest $request,
38
								IL10N $trans
39
	) {
40
		parent::__construct(
41
			$AppName,
42
			$request,
43
			'GET, POST, DELETE, PUT, PATCH, OPTIONS',
44
			'Authorization, Content-Type, Accept',
45
			86400);
46
		$this->trans = $trans;
47
	}
48
49
	/**
50
	 * @NoAdminRequired
51
	 * @NoCSRFRequired
52
	 * @PublicPage
53
	 */
54
	public function getLanguageStrings() {
55
		$translations = array(
56
			//'create.notebook' =>  $this->trans->t('Generating sharing keys ( %s / 2)','%step'),
57
			'new.notebook' =>  $this->trans->t('New notebook'),
58
			'not.grouped' =>  $this->trans->t('Not in notebook'),
59
			'notebook.name' =>  $this->trans->t('Notebook name'),
60
			'deleted.notes' =>  $this->trans->t('Deleted notes'),
61
			'all' =>  $this->trans->t('all'),
62
			'new' =>  $this->trans->t('new'),
63
			'save' =>  $this->trans->t('save'),
64
			'back' =>  $this->trans->t('back'),
65
			'create' =>  $this->trans->t('create'),
66
			'cancel' =>  $this->trans->t('cancel'),
67
			'name' =>  $this->trans->t('name'),
68
			'modified' =>  $this->trans->t('modified'),
69
			'delete.note' =>  $this->trans->t('Delete note'),
70
			'restore.note' =>  $this->trans->t('Restore note'),
71
			'untitled.note' => $this->trans->t('Untitled note'),
72
			'edit.note' =>  $this->trans->t('Edit note'),
73
			'share.note' =>  $this->trans->t('Share note'),
74
			'sharedwith' =>  $this->trans->t('Shared with you by %s', '%name'),
75
			'no.edit.perm' =>  $this->trans->t('You don\'t have permissions to edit this note'),
76
		);
77
		return new JSONResponse($translations);
78
	}
79
}
80