Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
b4cf8429
Unverified
Commit
b4cf8429
authored
Oct 10, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making the response message translatable
parent
e7a5effc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
MoveMediaController.php
Modules/Media/Http/Controllers/Api/MoveMediaController.php
+14
-1
media.php
Modules/Translation/Resources/lang/media/en/media.php
+2
-0
media.php
Modules/Translation/Resources/lang/media/fr/media.php
+2
-0
media.php
Modules/Translation/Resources/lang/media/nl/media.php
+2
-0
No files found.
Modules/Media/Http/Controllers/Api/MoveMediaController.php
View file @
b4cf8429
...
...
@@ -44,8 +44,21 @@ class MoveMediaController extends Controller
return
response
()
->
json
([
'errors'
=>
$failedMoves
>
0
,
'message'
=>
$
failedMoves
>
0
?
'Some files were not moved'
:
'Files moved successfully'
,
'message'
=>
$
this
->
getResponseMessage
(
$failedMoves
)
,
'folder_id'
=>
$destination
->
id
,
]);
}
/**
* @param int $failedMoves
* @return string
*/
protected
function
getResponseMessage
(
int
$failedMoves
)
:
string
{
if
(
$failedMoves
>
0
)
{
return
trans
(
'media::media.some files not moved'
);
}
return
trans
(
'media::media.files moved successfully'
);
}
}
Modules/Translation/Resources/lang/media/en/media.php
View file @
b4cf8429
...
...
@@ -39,4 +39,6 @@ return [
'edit resource'
=>
'Edit media'
,
'destroy resource'
=>
'Delete media'
,
'file too large'
=>
'File is too large. Must be below :size MB.'
,
'some files not moved'
=>
'Some files were not moved'
,
'files moved successfully'
=>
'Files moved successfully'
,
];
Modules/Translation/Resources/lang/media/fr/media.php
View file @
b4cf8429
...
...
@@ -34,4 +34,6 @@ return [
'Browse'
=>
'Parcourir...'
,
'upload file'
=>
'Uploadez un fichier'
,
'remove media'
=>
'Supprimez le fichier'
,
'some files not moved'
=>
'Certains fichiers n\'ont pas été déplacés'
,
'files moved successfully'
=>
'Fichiers déplacés avec succès'
,
];
Modules/Translation/Resources/lang/media/nl/media.php
View file @
b4cf8429
...
...
@@ -34,4 +34,6 @@ return [
'Browse'
=>
'Bladeren ...'
,
'upload file'
=>
'File uploaded'
,
'remove media'
=>
'File verwijderen'
,
'some files not moved'
=>
'Sommige bestanden zijn niet verplaatst'
,
'files moved successfully'
=>
'Bestanden zijn succesvol verplaatst'
,
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment