Skip to content

Commit c0474ba

Browse files
committed
Use product name in places where it is appropriate rather than the instance name
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 4673b54 commit c0474ba

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

apps/files_sharing/lib/Controller/ShareController.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ public function showShare($path = ''): TemplateResponse {
511511
$download = new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']);
512512
$downloadAll = new SimpleMenuAction('download', $this->l10n->t('Download all files'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']);
513513
$directLink = new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', $shareTmpl['previewURL']);
514-
$externalShare = new ExternalShareMenuAction($this->l10n->t('Add to your Nextcloud'), 'icon-external', $shareTmpl['owner'], $shareTmpl['shareOwner'], $shareTmpl['filename']);
514+
// TRANSLATORS The placeholder refers to the software product name as in 'Add to your Nextcloud'
515+
$externalShare = new ExternalShareMenuAction($this->l10n->t('Add to your %s', [$this->defaults->getProductName()]), 'icon-external', $shareTmpl['owner'], $shareTmpl['shareOwner'], $shareTmpl['filename']);
515516

516517
$responseComposer = [];
517518

apps/files_sharing/tests/Controller/ShareControllerTest.php

+12-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ class ShareControllerTest extends \Test\TestCase {
106106
private $eventDispatcher;
107107
/** @var IL10N */
108108
private $l10n;
109+
/** @var Defaults|MockObject */
110+
private $defaults;
109111

110112
protected function setUp(): void {
111113
parent::setUp();
@@ -125,6 +127,7 @@ protected function setUp(): void {
125127
$this->accountManager = $this->createMock(IAccountManager::class);
126128
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
127129
$this->l10n = $this->createMock(IL10N::class);
130+
$this->defaults = $this->createMock(Defaults::class);
128131

129132
$this->shareController = new \OCA\Files_Sharing\Controller\ShareController(
130133
$this->appName,
@@ -142,7 +145,7 @@ protected function setUp(): void {
142145
$this->accountManager,
143146
$this->eventDispatcher,
144147
$this->l10n,
145-
$this->createMock(Defaults::class)
148+
$this->defaults
146149
);
147150

148151

@@ -310,6 +313,10 @@ public function testShowShare() {
310313
return vsprintf($text, $parameters);
311314
});
312315

316+
$this->defaults->expects(self::any())
317+
->method('getProductName')
318+
->willReturn('Nextcloud');
319+
313320
$response = $this->shareController->showShare();
314321
$sharedTmplParams = [
315322
'owner' => 'ownerUID',
@@ -457,6 +464,10 @@ public function testShowShareWithPrivateName() {
457464
return vsprintf($text, $parameters);
458465
}));
459466

467+
$this->defaults->expects(self::any())
468+
->method('getProductName')
469+
->willReturn('Nextcloud');
470+
460471
$response = $this->shareController->showShare();
461472
$sharedTmplParams = [
462473
'owner' => '',

core/Controller/WhatsNewController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function get():DataResponse {
8989
$whatsNew = $this->whatsNewService->getChangesForVersion($currentVersion);
9090
$resultData = [
9191
'changelogURL' => $whatsNew['changelogURL'],
92-
'product' => $this->defaults->getName(),
92+
'product' => $this->defaults->getProductName(),
9393
'version' => $currentVersion,
9494
];
9595
do {

lib/private/Setup.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function getSystemInfo($allowAllDatabases = false) {
239239
'error' => $this->l10n->t(
240240
'Mac OS X is not supported and %s will not work properly on this platform. ' .
241241
'Use it at your own risk! ',
242-
[$this->defaults->getName()]
242+
[$this->defaults->getProductName()]
243243
),
244244
'hint' => $this->l10n->t('For the best results, please consider using a GNU/Linux server instead.'),
245245
];
@@ -250,7 +250,7 @@ public function getSystemInfo($allowAllDatabases = false) {
250250
'error' => $this->l10n->t(
251251
'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. ' .
252252
'This will lead to problems with files over 4 GB and is highly discouraged.',
253-
[$this->defaults->getName()]
253+
[$this->defaults->getProductName()]
254254
),
255255
'hint' => $this->l10n->t('Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP.'),
256256
];

lib/private/Template/JSConfigHelper.php

+1
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ public function getConfig() {
293293
"_theme" => json_encode([
294294
'entity' => $this->defaults->getEntity(),
295295
'name' => $this->defaults->getName(),
296+
'productName' => $this->defaults->getProductName(),
296297
'title' => $this->defaults->getTitle(),
297298
'baseUrl' => $this->defaults->getBaseUrl(),
298299
'syncClientUrl' => $this->defaults->getSyncClientUrl(),

status.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
'version' => implode('.', \OCP\Util::getVersion()),
5151
'versionstring' => OC_Util::getVersionString(),
5252
'edition' => '',
53-
'productname' => $defaults->getName(),
53+
'productname' => $defaults->getProductName(),
5454
'extendedSupport' => \OCP\Util::hasExtendedSupport()
5555
];
5656
if (OC::$CLI) {

0 commit comments

Comments
 (0)