Completed
Push — master ( 221bcc...580d20 )
by Sander
15s queued 13s
created

TranslationController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getLanguageStrings() 0 23 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
use OCA\NextNote\Db\Notebook;
27
use OCA\NextNote\Db\Note;
28
use OCA\NextNote\Fixtures\ShareFix;
29
use OCA\NextNote\Service\NotebookService;
30
use OCA\NextNote\Service\NoteService;
31
use OCA\NextNote\ShareBackend\NextNoteShareBackend;
32
use OCA\NextNote\Utility\NotFoundJSONResponse;
33
use OCA\NextNote\Utility\UnauthorizedJSONResponse;
34
use OCA\NextNote\Utility\Utils;
35
use \OCP\AppFramework\ApiController;
36
use OCP\AppFramework\Http\JSONResponse;
37
use OCP\Constants;
38
use OCP\IConfig;
39
use OCP\IL10N;
40
use OCP\ILogger;
41
use \OCP\IRequest;
42
use OCP\IUserManager;
43
use OCP\Share;
44
45
46
class TranslationController extends ApiController {
47
48
	private $trans;
49
50
	public function __construct($AppName,
51
								IRequest $request,
52
								IL10N $trans
53
	) {
54
		parent::__construct(
55
			$AppName,
56
			$request,
57
			'GET, POST, DELETE, PUT, PATCH, OPTIONS',
58
			'Authorization, Content-Type, Accept',
59
			86400);
60
		$this->trans = $trans;
61
	}
62
63
	public function getLanguageStrings() {
64
		$translations = array(
65
			//'create.notebook' =>  $this->trans->t('Generating sharing keys ( %s / 2)','%step'),
66
			'new.notebook' =>  $this->trans->t('New notebook'),
67
			'not.grouped' =>  $this->trans->t('Not in notebook'),
68
			'deleted.notes' =>  $this->trans->t('Deleted notes'),
69
			'all' =>  $this->trans->t('all'),
70
			'new' =>  $this->trans->t('new'),
71
			'save' =>  $this->trans->t('save'),
72
			'back' =>  $this->trans->t('back'),
73
			'create' =>  $this->trans->t('create'),
74
			'cancel' =>  $this->trans->t('cancel'),
75
			'name' =>  $this->trans->t('name'),
76
			'modified' =>  $this->trans->t('modified'),
77
			'delete.note' =>  $this->trans->t('Delete note'),
78
			'restore.note' =>  $this->trans->t('Restore note'),
79
			'edit.note' =>  $this->trans->t('Edit note'),
80
			'share.note' =>  $this->trans->t('Share note'),
81
			'sharedwith' =>  $this->trans->t('Shared with you by %s', '%name'),
82
			'no.edit.perm' =>  $this->trans->t('You don\'t have permissions to edit this note'),
83
		);
84
		return new JSONResponse($translations);
85
	}
86
}
87