Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0][com_media] RTL: adapting media manager to rtl + some #24043

Merged
merged 6 commits into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<li class="name">{{ translate('COM_MEDIA_MEDIA_NAME') }}</li>
<li class="size">{{ translate('COM_MEDIA_MEDIA_SIZE') }}</li>
<li class="dimension">{{ translate('COM_MEDIA_MEDIA_DIMENSION') }}</li>
<li class="created">{{ translate('COM_MEDIA_MEDIA_CREATED_AT') }}</li>
<li class="modified">{{ translate('COM_MEDIA_MEDIA_MODIFIED_AT') }}</li>
<li class="created">{{ translate('COM_MEDIA_MEDIA_DATE_CREATED') }}</li>
<li class="modified">{{ translate('COM_MEDIA_MEDIA_DATE_MODIFIED') }}</li>
</ul>
</div>
<media-browser-item v-for="item in items" :key="item.path" :item="item"></media-browser-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<dt>{{ translate('COM_MEDIA_MEDIA_TYPE') }}</dt>
<dd>{{ item.type || '-' }}</dd>

<dt>{{ translate('COM_MEDIA_MEDIA_CREATED_AT') }}</dt>
<dt>{{ translate('COM_MEDIA_MEDIA_DATE_CREATED') }}</dt>
<dd>{{ item.create_date_formatted }}</dd>

<dt>{{ translate('COM_MEDIA_MEDIA_MODIFIED_AT') }}</dt>
<dt>{{ translate('COM_MEDIA_MEDIA_DATE_MODIFIED') }}</dt>
<dd>{{ item.modified_date_formatted }}</dd>

<dt>{{ translate('COM_MEDIA_MEDIA_DIMENSION') }}</dt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,32 @@
.breadcrumb-item + .breadcrumb-item::before {
display: none;
}

/* RTL override */

html[dir=rtl] .media-breadcrumb {
margin: 0 0 0 auto;
}

html[dir=rtl] .media-breadcrumb-item::after, .media-breadcrumb-item::before {
right: 100%;
border-right: 10px solid transparent;
border-left: 0;
}

html[dir=rtl] .media-breadcrumb-item {
padding: 0 22px 0 8px;
}

html[dir=rtl] .media-breadcrumb-item::before {
border-right-color: #fafafa;
}

html[dir=rtl] .media-breadcrumb-item:first-of-type {
padding-right: 16px;
padding-left: 0;
}

html[dir=rtl] .media-breadcrumb-item:last-of-type::after {
border-right: 10px solid #fff;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
background-color: $info-bg;
border-left: 1px solid $border-color;
h2 {
padding: 10px ($gutter-width + 30px) 10px $gutter-width;
padding: 20px ($gutter-width + 15px) 10px ($gutter-width - 5px);
margin: (-$gutter-width) (-$gutter-width) $gutter-width;
font-weight: normal;
line-height: $info-title-height;
Expand Down Expand Up @@ -66,3 +66,23 @@
border: 2px solid #ccc;
border-radius: 50%;
}

/* RTL override */

html[dir=rtl] .media-infobar {
left: 0;
right: auto;
}

html[dir=rtl] .infobar-close {
left: 0;
right: auto;
}

html[dir=rtl] .media-infobar dd {
margin-right: 0;
margin-left: auto;
}
html[dir=rtl] .media-infobar h2 {
padding: 20px $gutter-width 10px 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,35 @@ ul.media-tree {
vertical-align: middle;
}

/* RTL override */

.media-tree-item.active > a .item-name {
font-weight: bold;
}

html[dir=rtl] .media-tree-item::after, .media-tree-item::before {
left: 0;
right: 15px;
}

html[dir=rtl] .media-tree-item::before {
margin: 0;
}

html[dir=rtl] .media-browser-table .dimension, .media-browser-table .size {
direction: ltr;
}

html[dir=rtl] .media-browser-table .created, .media-browser-table .modified {
direction: ltr;
}

html[dir=rtl] .media-tree-item .item-icon {
padding-left: 2px;
padding-right: 24px;
}

html[dir=rtl] ul.media-tree ul {
margin-right: 24px;
}

32 changes: 16 additions & 16 deletions administrator/components/com_media/tmpl/media/default_texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,34 @@

use Joomla\CMS\Language\Text;

Text::script('COM_MEDIA_ACTION_RENAME', true);
Text::script('COM_MEDIA_ACTION_DELETE', true);
Text::script('COM_MEDIA_ACTION_EDIT', true);
Text::script('COM_MEDIA_ACTION_PREVIEW', true);
Text::script('COM_MEDIA_ACTION_RENAME', true);
Text::script('COM_MEDIA_ACTION_SHARE', true);
Text::script('COM_MEDIA_BREADCRUMB_LABEL', true);
Text::script('COM_MEDIA_CONFIRM_DELETE_MODEL', true);
Text::script('COM_MEDIA_CONFIRM_DELETE_MODEL_DESC', true);
Text::script('COM_MEDIA_CONFIRM_DELETE_MODEL_HEADING', true);
Text::script('COM_MEDIA_CREATE_NEW_FOLDER', true);
Text::script('COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS', true);
Text::script('COM_MEDIA_CREATE_NEW_FOLDER_ERROR', true);
Text::script('COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS', true);
Text::script('COM_MEDIA_DECREASE_GRID', true);
Text::script('COM_MEDIA_DELETE_ERROR', true);
Text::script('COM_MEDIA_DELETE_SUCCESS', true);
Text::script('COM_MEDIA_CONFIRM_DELETE_MODEL_DESC', true);
Text::script('COM_MEDIA_CONFIRM_DELETE_MODEL_HEADING', true);
Text::script('COM_MEDIA_CONFIRM_DELETE_MODEL', true);
Text::script('COM_MEDIA_ERROR', true);
Text::script('COM_MEDIA_ERROR_NOT_AUTHENTICATED', true);
Text::script('COM_MEDIA_ERROR_NOT_AUTHORIZED', true);
Text::script('COM_MEDIA_ERROR_NOT_FOUND', true);
Text::script('COM_MEDIA_FILE_EXISTS_AND_OVERRIDE', true);
Text::script('COM_MEDIA_FOLDER', true);
Text::script('COM_MEDIA_FOLDER_NAME', true);
Text::script('COM_MEDIA_INCREASE_GRID', true);
Text::script('COM_MEDIA_MEDIA_CREATED_AT', true);
Text::script('COM_MEDIA_MEDIA_DATE_CREATED', true);
Text::script('COM_MEDIA_MEDIA_DATE_MODIFIED', true);
Text::script('COM_MEDIA_MEDIA_DIMENSION', true);
Text::script('COM_MEDIA_MEDIA_EXTENSION', true);
Text::script('COM_MEDIA_MEDIA_MIME_TYPE', true);
Text::script('COM_MEDIA_MEDIA_MODIFIED_AT', true);
Text::script('COM_MEDIA_MEDIA_NAME', true);
Text::script('COM_MEDIA_MEDIA_SIZE', true);
Text::script('COM_MEDIA_MEDIA_TYPE', true);
Expand All @@ -47,18 +50,15 @@
Text::script('COM_MEDIA_SEARCH', true);
Text::script('COM_MEDIA_SELECT_ALL', true);
Text::script('COM_MEDIA_SERVER_ERROR', true);
Text::script('COM_MEDIA_SHARE', true);
Text::script('COM_MEDIA_SHARE_COPY_FAILED_ERROR', true);
Text::script('COM_MEDIA_SHARE_DESC', true);
Text::script('COM_MEDIA_TOGGLE_INFO', true);
Text::script('COM_MEDIA_TOGGLE_LIST_VIEW', true);
Text::script('COM_MEDIA_TOGGLE_SELECT_ITEM', true);
Text::script('COM_MEDIA_TOOLBAR_LABEL', true);
Text::script('COM_MEDIA_UPLOAD_SUCCESS', true);
Text::script('JCANCEL', true);
Text::script('JAPPLY', true);
Text::script('JACTION_CREATE', true);
Text::script('JAPPLY', true);
Text::script('JCANCEL', true);
Text::script('JLIB_FORM_FIELD_REQUIRED_VALUE', true);
Text::script('COM_MEDIA_FILE_EXISTS_AND_OVERRIDE', true);
Text::script('COM_MEDIA_SHARE', true);
Text::script('COM_MEDIA_SHARE_DESC', true);
Text::script('COM_MEDIA_ACTION_SHARE', true);
Text::script('COM_MEDIA_SHARE_COPY_FAILED_ERROR', true);
Text::script('COM_MEDIA_TOOLBAR_LABEL', true);
Text::script('COM_MEDIA_BREADCRUMB_LABEL', true);
11 changes: 6 additions & 5 deletions administrator/language/en-GB/en-GB.com_media.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ COM_MEDIA_ACTION_RENAME="Rename item"
COM_MEDIA_ACTION_SHARE="Get a sharable link"
COM_MEDIA_BREADCRUMB_LABEL="Breadcrumb"
COM_MEDIA_CONFIGURATION="Media: Options"
COM_MEDIA_CONFIRM_DELETE_MODEL="Delete"
COM_MEDIA_CONFIRM_DELETE_MODEL_DESC="Are you sure you want to delete this item?"
COM_MEDIA_CONFIRM_DELETE_MODEL_HEADING="Confirm Delete"
COM_MEDIA_CONFIRM_DELETE_MODEL="Delete"
COM_MEDIA_CREATE_NEW_FOLDER="Create New Folder"
COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS="Folder created."
COM_MEDIA_CREATE_NEW_FOLDER_ERROR="Error creating folder."
COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS="Folder created."
COM_MEDIA_DECREASE_GRID="Decrease grid size"
COM_MEDIA_DELETE_ERROR="Error deleting the item."
COM_MEDIA_DELETE_SUCCESS="Item deleted."
Expand Down Expand Up @@ -52,11 +52,12 @@ COM_MEDIA_FOLDER="Folder"
COM_MEDIA_FOLDER_NAME="Folder Name"
COM_MEDIA_FOLDERS="Media Folders"
COM_MEDIA_FOLDERS_PATH_LABEL="<strong>Warning! Path Folder</strong><br>Changing the 'Path to files folder' from the default of 'images' may break your links.<br>The 'Path to images' folder has to be the same or a subfolder of 'Path to files'."
COM_MEDIA_MEDIA_CREATED_AT="Created at"
COM_MEDIA_INCREASE_GRID="Increase grid size"
COM_MEDIA_MEDIA_DATE_CREATED="Date created"
COM_MEDIA_MEDIA_DATE_MODIFIED="Date modified"
COM_MEDIA_MEDIA_DIMENSION="Dimensions"
COM_MEDIA_MEDIA_EXTENSION="Extension"
COM_MEDIA_MEDIA_MIME_TYPE="MIME Type"
COM_MEDIA_MEDIA_MODIFIED_AT="Modified at"
COM_MEDIA_MEDIA_NAME="Name"
COM_MEDIA_MEDIA_SIZE="Size"
COM_MEDIA_MEDIA_TYPE="Type"
Expand All @@ -71,8 +72,8 @@ COM_MEDIA_SEARCH="Search..."
COM_MEDIA_SELECT_ALL="Toggle select all"
COM_MEDIA_SERVER_ERROR="Internal server error"
COM_MEDIA_SHARE="Share the file"
COM_MEDIA_SHARE_DESC="Share the file with others. Anyone with link can view the file"
COM_MEDIA_SHARE_COPY_FAILED_ERROR="Error copying to clipboard"
COM_MEDIA_SHARE_DESC="Share the file with others. Anyone with link can view the file"
COM_MEDIA_TOGGLE_INFO="Toggle item info"
COM_MEDIA_TOGGLE_LIST_VIEW="Toggle between grid and table views"
COM_MEDIA_TOGGLE_SELECT_ITEM="Toggle select item"
Expand Down
38 changes: 36 additions & 2 deletions language/en-GB/en-GB.com_media.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,43 @@
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

COM_MEDIA="Media"
COM_MEDIA_ACTION_DELETE="Delete item"
COM_MEDIA_ACTION_EDIT="Edit item"
COM_MEDIA_ACTION_PREVIEW="Preview item"
COM_MEDIA_ACTION_RENAME="Rename item"
COM_MEDIA_ACTION_SHARE="Get a sharable link"
COM_MEDIA_ALIGN="Image Float"
COM_MEDIA_ALIGN_DESC="This will apply the classes 'float-left', 'pull-center' or 'float-right' to the '<figure>' or '<img>' element."
COM_MEDIA_BREADCRUMB_LABEL="Breadcrumb"
COM_MEDIA_BROWSE_FILES="Browse Files"
COM_MEDIA_CAPTION="Caption"
COM_MEDIA_CAPTION_CLASS_DESC="This will apply the entered class to the '<figcaption>' element. For example: 'text-left', 'text-right', 'text-center'."
COM_MEDIA_CAPTION_CLASS_LABEL="Caption Class"
COM_MEDIA_CLEAR_LIST="Clear List"
COM_MEDIA_CONFIGURATION="Media: Options"
COM_MEDIA_CONFIRM_DELETE_MODEL="Delete"
COM_MEDIA_CONFIRM_DELETE_MODEL_DESC="Are you sure you want to delete this item?"
COM_MEDIA_CONFIRM_DELETE_MODEL_HEADING="Confirm Delete"
COM_MEDIA_CREATE_FOLDER="Create Folder"
COM_MEDIA_CREATE_NEW_FOLDER="Create New Folder"
COM_MEDIA_CREATE_NEW_FOLDER_ERROR="Error creating folder."
COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS="Folder created."
COM_MEDIA_CURRENT_PROGRESS="Current progress"
COM_MEDIA_DECREASE_GRID="Decrease grid size"
COM_MEDIA_DELETE_ERROR="Error deleting the item."
COM_MEDIA_DELETE_SUCCESS="Item deleted."
COM_MEDIA_DESCFTP="To upload, change and delete media files, Joomla! will most likely need your FTP account details. Please enter them in the form fields below."
COM_MEDIA_DESCFTPTITLE="FTP Login Details"
COM_MEDIA_DETAIL_VIEW="Detail View"
COM_MEDIA_DIRECTORY="Folder"
COM_MEDIA_DIRECTORY_UP="Folder Up"
COM_MEDIA_ERROR="An error occurred."
COM_MEDIA_ERROR_BAD_REQUEST="Bad Request"
COM_MEDIA_ERROR_FILE_EXISTS="File already exists."
COM_MEDIA_ERROR_NOT_AUTHENTICATED="You are not authenticated. Please login."
COM_MEDIA_ERROR_NOT_AUTHORIZED="You are not authorized"
COM_MEDIA_ERROR_NOT_FOUND="File or Folder not found"
COM_MEDIA_ERROR_UNABLE_TO_BROWSE_FOLDER_WARNDIRNAME="Unable to browse:&#160;%s. Folder name must only have alphanumeric characters and no spaces."
COM_MEDIA_ERROR_UNABLE_TO_CREATE_FOLDER_WARNDIRNAME="Unable to create folder. Folder name must only have alphanumeric characters and no spaces."
COM_MEDIA_ERROR_UNABLE_TO_DELETE="Unable to delete:&#160;"
Expand Down Expand Up @@ -55,34 +69,54 @@ COM_MEDIA_FIELD_PATH_IMAGE_FOLDER_DESC="Enter the path to the image folder relat
COM_MEDIA_FIELD_PATH_IMAGE_FOLDER_LABEL="Path to Image Folder"
COM_MEDIA_FIELD_RESTRICT_UPLOADS_DESC="Restrict uploads for lower than manager users to images if Fileinfo or MIME Magic isn't installed."
COM_MEDIA_FIELD_RESTRICT_UPLOADS_LABEL="Restrict Uploads"
COM_MEDIA_FILE_EXISTS_AND_OVERRIDE="%s already exists. Do you want to replace it?"
COM_MEDIA_FILES="Files"
COM_MEDIA_FILESIZE="File size"
COM_MEDIA_FOLDER="Folder"
COM_MEDIA_FOLDER_NAME="Folder Name"
COM_MEDIA_FOLDERS="Folders"
COM_MEDIA_IMAGE_DESCRIPTION="Image Description"
COM_MEDIA_IMAGE_URL="Image URL"
COM_MEDIA_INCREASE_GRID="Increase grid size"
COM_MEDIA_INCREASE_GRID="Increase grid size"
COM_MEDIA_INSERT="Insert"
COM_MEDIA_INSERT_IMAGE="Insert Image"
COM_MEDIA_MAXIMUM_SIZE="Maximum Size"
COM_MEDIA_MEDIA="Media"
COM_MEDIA_MEDIA_DATE_CREATED="Date created"
COM_MEDIA_MEDIA_DATE_MODIFIED="Date modified"
COM_MEDIA_MEDIA_DIMENSION="Dimensions"
COM_MEDIA_MEDIA_EXTENSION="Extension"
COM_MEDIA_MEDIA_MIME_TYPE="MIME Type"
COM_MEDIA_MEDIA_NAME="Name"
COM_MEDIA_MEDIA_SIZE="Size"
COM_MEDIA_MEDIA_TYPE="Type"
COM_MEDIA_NAME="Image Name"
COM_MEDIA_NO_IMAGES_FOUND="No Images Found"
COM_MEDIA_NOT_SET="Not Set"
COM_MEDIA_OPEN_ITEM_ACTIONS="Open item actions"
COM_MEDIA_OVERALL_PROGRESS="Overall Progress"
COM_MEDIA_PIXEL_DIMENSIONS="Pixel Dimensions (w x h)"
COM_MEDIA_PLEASE_SELECT_ITEM="Please select item."
COM_MEDIA_RENAME="Rename"
COM_MEDIA_RENAME_ERROR="Error renaming item."
COM_MEDIA_RENAME_SUCCESS="Item renamed."
COM_MEDIA_SEARCH="Search..."
COM_MEDIA_SELECT_ALL="Toggle select all"
COM_MEDIA_SERVER_ERROR="Internal server error"
COM_MEDIA_SHARE="Share the file"
COM_MEDIA_SHARE_COPY_FAILED_ERROR="Error copying to clipboard"
COM_MEDIA_SHARE_DESC="Share the file with others. Anyone with link can view the file"
COM_MEDIA_START_UPLOAD="Start Upload"
COM_MEDIA_THUMBNAIL_VIEW="Thumbnail View"
COM_MEDIA_TITLE="Image Title"
COM_MEDIA_TOGGLE_INFO="Toggle item info"
COM_MEDIA_TOGGLE_LIST_VIEW="Toggle between grid and table views"
COM_MEDIA_TOGGLE_SELECT_ITEM="Toggle select item"
COM_MEDIA_TOOLBAR_LABEL="Media Manager"
COM_MEDIA_UP="Up"
COM_MEDIA_UPLOAD="Upload"
COM_MEDIA_UPLOAD_COMPLETE="Upload Complete"
COM_MEDIA_UPLOAD_FILE="Upload file"
COM_MEDIA_UPLOAD_SUCCESS="Item uploaded."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the fullstop (.) at the end?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not corrected various existing lang strings.
We do have already
COM_MEDIA_DELETE_SUCCESS="Item deleted." for example.
or
COM_MEDIA_ERROR="An error occurred."
I think such messages should end with a period.

As you can see the capitals and periods for these are not consequent.
I can though modify them on the model of
COM_CATEGORIES_SAVE_SUCCESS="Category saved." etc.

In this case, we should have I guess

COM_MEDIA_UPLOAD_COMPLETE="Upload complete."
COM_MEDIA_UPLOAD_FILE="Upload file"
COM_MEDIA_UPLOAD_SUCCESS="Item uploaded."

I guess these can be modified later on by specialists in a specific PR, to not interfere with this PR.
What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks also that
COM_MEDIA_UPLOAD_FILE is not used at all in 4.0

These ini will have to be drastically cleaned up when media manager gets more stable.

COM_MEDIA_UPLOAD_SUCCESSFUL="Upload Successful"
COM_MEDIA_SHARE="Share the file"
COM_MEDIA_SHARE_DESC="Share the file with others. Anyone with link can view the file"
5 changes: 3 additions & 2 deletions plugins/filesystem/local/Adapter/LocalAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Helper\MediaHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Uri\Uri;
Expand Down Expand Up @@ -344,9 +345,9 @@ private function getPathInformation(string $path): \stdClass

// Dates
$obj->create_date = $createDate->format('c', true);
$obj->create_date_formatted = $createDate->format(Text::_('DATE_FORMAT_LC5'), true);
$obj->create_date_formatted = HTMLHelper::_('date', $createDate, Text::_('DATE_FORMAT_LC5'));
$obj->modified_date = $modifiedDate->format('c', true);
$obj->modified_date_formatted = $modifiedDate->format(Text::_('DATE_FORMAT_LC5'), true);
$obj->modified_date_formatted = HTMLHelper::_('date', $modifiedDate, Text::_('DATE_FORMAT_LC5'));

if (MediaHelper::isImage($obj->name))
{
Expand Down