summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-03-05 10:04:09 +0100
committerJulius Härtl <jus@bitgrid.net>2021-06-16 11:42:53 +0200
commitc0474ba3644fc94674788bf21dd3e22d564e019c (patch)
treee4709fae17df27be50696c314ec75cb469b99e26
parent4673b54a2cfcdf7976fcd295b98d72858619ffad (diff)
downloadnextcloud-server-c0474ba3644fc94674788bf21dd3e22d564e019c.tar.gz
nextcloud-server-c0474ba3644fc94674788bf21dd3e22d564e019c.zip
Use product name in places where it is appropriate rather than the instance name
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php3
-rw-r--r--apps/files_sharing/tests/Controller/ShareControllerTest.php13
-rw-r--r--core/Controller/WhatsNewController.php2
-rw-r--r--lib/private/Setup.php4
-rw-r--r--lib/private/Template/JSConfigHelper.php1
-rw-r--r--status.php2
6 files changed, 19 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 4893a693df3..fbee6bf4b77 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -511,7 +511,8 @@ class ShareController extends AuthPublicShareController {
$download = new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']);
$downloadAll = new SimpleMenuAction('download', $this->l10n->t('Download all files'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']);
$directLink = new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', $shareTmpl['previewURL']);
- $externalShare = new ExternalShareMenuAction($this->l10n->t('Add to your Nextcloud'), 'icon-external', $shareTmpl['owner'], $shareTmpl['shareOwner'], $shareTmpl['filename']);
+ // TRANSLATORS The placeholder refers to the software product name as in 'Add to your Nextcloud'
+ $externalShare = new ExternalShareMenuAction($this->l10n->t('Add to your %s', [$this->defaults->getProductName()]), 'icon-external', $shareTmpl['owner'], $shareTmpl['shareOwner'], $shareTmpl['filename']);
$responseComposer = [];
diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php
index 8a9520e2515..07bd845729d 100644
--- a/apps/files_sharing/tests/Controller/ShareControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php
@@ -106,6 +106,8 @@ class ShareControllerTest extends \Test\TestCase {
private $eventDispatcher;
/** @var IL10N */
private $l10n;
+ /** @var Defaults|MockObject */
+ private $defaults;
protected function setUp(): void {
parent::setUp();
@@ -125,6 +127,7 @@ class ShareControllerTest extends \Test\TestCase {
$this->accountManager = $this->createMock(IAccountManager::class);
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
$this->l10n = $this->createMock(IL10N::class);
+ $this->defaults = $this->createMock(Defaults::class);
$this->shareController = new \OCA\Files_Sharing\Controller\ShareController(
$this->appName,
@@ -142,7 +145,7 @@ class ShareControllerTest extends \Test\TestCase {
$this->accountManager,
$this->eventDispatcher,
$this->l10n,
- $this->createMock(Defaults::class)
+ $this->defaults
);
@@ -310,6 +313,10 @@ class ShareControllerTest extends \Test\TestCase {
return vsprintf($text, $parameters);
});
+ $this->defaults->expects(self::any())
+ ->method('getProductName')
+ ->willReturn('Nextcloud');
+
$response = $this->shareController->showShare();
$sharedTmplParams = [
'owner' => 'ownerUID',
@@ -457,6 +464,10 @@ class ShareControllerTest extends \Test\TestCase {
return vsprintf($text, $parameters);
}));
+ $this->defaults->expects(self::any())
+ ->method('getProductName')
+ ->willReturn('Nextcloud');
+
$response = $this->shareController->showShare();
$sharedTmplParams = [
'owner' => '',
diff --git a/core/Controller/WhatsNewController.php b/core/Controller/WhatsNewController.php
index f316c62c973..12024dec030 100644
--- a/core/Controller/WhatsNewController.php
+++ b/core/Controller/WhatsNewController.php
@@ -89,7 +89,7 @@ class WhatsNewController extends OCSController {
$whatsNew = $this->whatsNewService->getChangesForVersion($currentVersion);
$resultData = [
'changelogURL' => $whatsNew['changelogURL'],
- 'product' => $this->defaults->getName(),
+ 'product' => $this->defaults->getProductName(),
'version' => $currentVersion,
];
do {
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index 3475ee3e65b..5234be0bf3e 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -239,7 +239,7 @@ class Setup {
'error' => $this->l10n->t(
'Mac OS X is not supported and %s will not work properly on this platform. ' .
'Use it at your own risk! ',
- [$this->defaults->getName()]
+ [$this->defaults->getProductName()]
),
'hint' => $this->l10n->t('For the best results, please consider using a GNU/Linux server instead.'),
];
@@ -250,7 +250,7 @@ class Setup {
'error' => $this->l10n->t(
'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. ' .
'This will lead to problems with files over 4 GB and is highly discouraged.',
- [$this->defaults->getName()]
+ [$this->defaults->getProductName()]
),
'hint' => $this->l10n->t('Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP.'),
];
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index 1452ccc463f..2cc8f6ca3fd 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -293,6 +293,7 @@ class JSConfigHelper {
"_theme" => json_encode([
'entity' => $this->defaults->getEntity(),
'name' => $this->defaults->getName(),
+ 'productName' => $this->defaults->getProductName(),
'title' => $this->defaults->getTitle(),
'baseUrl' => $this->defaults->getBaseUrl(),
'syncClientUrl' => $this->defaults->getSyncClientUrl(),
diff --git a/status.php b/status.php
index 200f8461f76..62eb978781c 100644
--- a/status.php
+++ b/status.php
@@ -50,7 +50,7 @@ try {
'version' => implode('.', \OCP\Util::getVersion()),
'versionstring' => OC_Util::getVersionString(),
'edition' => '',
- 'productname' => $defaults->getName(),
+ 'productname' => $defaults->getProductName(),
'extendedSupport' => \OCP\Util::hasExtendedSupport()
];
if (OC::$CLI) {