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

move some hard coded texts to lang file #954

Merged
merged 3 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all 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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/assets/admin/js/chunk-common.3dca7536.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/assets/admin/js/chunk-common.f7f117f9.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/assets/admin/js/main-form.196dbf07.js

This file was deleted.

1 change: 1 addition & 0 deletions dist/assets/admin/js/main-form.24eae687.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/assets/admin/js/main-listing.43aa6674.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/assets/admin/js/main-listing.54a3c8e0.js

This file was deleted.

16 changes: 8 additions & 8 deletions dist/assets/admin/twill-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
"Inter-MediumItalic.woff2": "/assets/admin/fonts/Inter-MediumItalic.7a7fd735.woff2",
"Inter-Regular.woff": "/assets/admin/fonts/Inter-Regular.aebfbb3c.woff",
"Inter-Regular.woff2": "/assets/admin/fonts/Inter-Regular.bffaed79.woff2",
"chunk-common.css": "/assets/admin/css/chunk-common.fec10329.css",
"chunk-common.js": "/assets/admin/js/chunk-common.f7f117f9.js",
"chunk-common.css": "/assets/admin/css/chunk-common.7060ca02.css",
"chunk-common.js": "/assets/admin/js/chunk-common.3dca7536.js",
"chunk-vendors.css": "/assets/admin/css/chunk-vendors.e0f3ef32.css",
"chunk-vendors.js": "/assets/admin/js/chunk-vendors.750de529.js",
"icons-files.svg": "/assets/admin/icons/icons-files.3cdbddfb2725088d.svg",
"icons-wysiwyg.svg": "/assets/admin/icons/icons-wysiwyg.63f0e2d625dc615e.svg",
"icons.svg": "/assets/admin/icons/icons.0ee79e71b68bc72f.svg",
"main-buckets.css": "/assets/admin/css/main-buckets.b3760912.css",
"main-buckets.js": "/assets/admin/js/main-buckets.38d7b5bc.js",
"main-buckets.js": "/assets/admin/js/main-buckets.37495295.js",
"main-dashboard.css": "/assets/admin/css/main-dashboard.7e178125.css",
"main-dashboard.js": "/assets/admin/js/main-dashboard.258f0385.js",
"main-form.css": "/assets/admin/css/main-form.d15c3c53.css",
"main-form.js": "/assets/admin/js/main-form.196dbf07.js",
"main-dashboard.js": "/assets/admin/js/main-dashboard.361826d7.js",
"main-form.css": "/assets/admin/css/main-form.34549069.css",
"main-form.js": "/assets/admin/js/main-form.24eae687.js",
"main-free.js": "/assets/admin/js/main-free.75070804.js",
"main-listing.css": "/assets/admin/css/main-listing.66c1fdf3.css",
"main-listing.js": "/assets/admin/js/main-listing.54a3c8e0.js"
"main-listing.css": "/assets/admin/css/main-listing.32e2c205.css",
"main-listing.js": "/assets/admin/js/main-listing.43aa6674.js"
}
6 changes: 3 additions & 3 deletions frontend/js/components/MediaField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@

<!-- Metadatas options -->
<div class="media__metadatas--options" :class="{ 's--active' : metadatas.active }" v-if="hasMedia && withAddInfo">
<a17-mediametadata :name='metadataName' label="Alt Text" id="altText" :media="media" :maxlength="altTextMaxLength" @change="updateMetadata"/>
<a17-mediametadata v-if="withCaption" :name='metadataName' label="Caption" id="caption" :media="media" :maxlength="captionMaxLength" @change="updateMetadata"/>
<a17-mediametadata v-if="withVideoUrl" :name='metadataName' label="Video URL (optional)" id="video" :media="media" @change="updateMetadata"/>
<a17-mediametadata :name='metadataName' :label="$trans('fields.medias.alt-text', 'Alt Text')" id="altText" :media="media" :maxlength="altTextMaxLength" @change="updateMetadata"/>
<a17-mediametadata v-if="withCaption" :name='metadataName' :label="$trans('fields.medias.caption', 'Caption')" id="caption" :media="media" :maxlength="captionMaxLength" @change="updateMetadata"/>
<a17-mediametadata v-if="withVideoUrl" :name='metadataName' :label="$trans('fields.medias.video-url', 'Video URL (optional)')" id="video" :media="media" @change="updateMetadata"/>
<template v-for="field in extraMetadatas">
<a17-mediametadata v-if="extraMetadatas.length > 0"
:key="field.name"
Expand Down
4 changes: 2 additions & 2 deletions frontend/js/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
</a>
</li>
<li class="search__no-result" v-show="loading">
Loading…
{{ $trans('dashboard.search.loading', 'Loading…') }}
</li>
<li class="search__no-result" v-show="readyToShowResult && !searchResults.length && !loading">
No results found.
{{ $trans('dashboard.search.no-result', 'No results found.') }}
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/js/components/editor/EditorPreview.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="editorPreview" :editorPreviewClass="editorPreviewClass" @mousedown="unselectBlock">
<div class="editorPreview__empty" v-if="!blocks.length">
<b>Drag and drop content from the left navigation</b>
<b>{{ $trans('previewer.drag-and-drop', 'Drag and drop content from the left navigation') }}</b>
</div>
<draggable class="editorPreview__content" v-model="blocks" :options="{ group: 'editorBlocks', handle: handle }" @add="onAdd" @update="onUpdate">
<div class="editorPreview__item" :class="{ 'editorPreview__item--active' : isBlockActive(block.id), 'editorPreview__item--hover' : activeItem === index }" v-for="(block, index) in blocks" :ref="block.id" :key="block.id" @mousedown.stop >
Expand Down
13 changes: 11 additions & 2 deletions frontend/js/components/media-library/MediaLibrary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,17 @@
return this.modalTitlePrefix
},
btnLabel: function () {
if (this.indexToReplace > -1) return this.btnLabelUpdate + ' ' + this.type
return (this.selectedMedias.length > 1 ? this.btnLabelMulti + ' ' + this.type + 's' : this.btnLabelSingle + ' ' + this.type)
let type = this.$trans('media-library.types.single.' + this.type, this.type)

if (this.indexToReplace > -1) {
return this.btnLabelUpdate + ' ' + type
} else {
if (this.selectedMedias.length > 1) {
type = this.$trans('media-library.types.multiple.' + this.type, this.type)
}

return this.btnLabelSingle + ' ' + type
}
},
usedMedias: function () {
return this.selected[this.connector] || []
Expand Down
19 changes: 15 additions & 4 deletions frontend/js/components/media-library/MediaSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<a17-vselect v-if="!fieldsRemovedFromBulkEditing.includes('tags')" :label="$trans('media-library.sidebar.tags')"
:key="firstMedia.id + '-' + medias.length" name="tags" :multiple="true"
:selected="hasMultipleMedias ? sharedTags : firstMedia.tags" :searchable="true"
emptyText="Sorry, no tags found." :taggable="true" :pushTags="true" size="small"
:emptyText="$trans('media-library.no-tags-found', 'Sorry, no tags found.')" :taggable="true" :pushTags="true" size="small"
:endpoint="type.tagsEndpoint" @change="save" maxHeight="175px"/>
<span
v-if="extraMetadatas.length && isImage && hasMultipleMedias && !fieldsRemovedFromBulkEditing.includes('tags')"
Expand Down Expand Up @@ -108,7 +108,7 @@
</template>

<a17-modal class="modal--tiny modal--form modal--withintro" ref="warningDelete" title="Warning Delete">
<p class="modal--tiny-title"><strong>Are you sure ?</strong></p>
<p class="modal--tiny-title"><strong>{{ $trans('media-library.dialogs.delete.title', 'Are you sure ?') }}</strong></p>
<p>{{ warningDeleteMessage }}</p>
<a17-inputframe>
<a17-button variant="validate" @click="deleteSelectedMedias">Delete ({{ mediasIdsToDelete.length }})
Expand Down Expand Up @@ -230,8 +230,19 @@
}))
},
warningDeleteMessage: function () {
const prefix = this.hasMultipleMedias ? this.allowDelete ? 'Some files are' : 'This files are' : 'This file is'
return this.allowDelete ? prefix + ' used and can\'t be deleted. Do you want to delete the others ?' : prefix + ' used and can\'t be deleted.'
if (this.allowDelete) {
if (this.hasMultipleMedias) {
return this.$trans('media-library.dialogs.delete.allow-delete-multiple-medias', 'Some files are used and can\'t be deleted. Do you want to delete the others ?')
} else {
return this.$trans('media-library.dialogs.delete.allow-delete-one-media', 'This file is used and can\'t be deleted. Do you want to delete the others ?')
}
} else {
if (this.hasMultipleMedias) {
return this.$trans('media-library.dialogs.delete.dont-allow-delete-multiple-medias', 'This files are used and can\'t be deleted.')
} else {
return this.$trans('media-library.dialogs.delete.dont-allow-delete-one-media', 'This file is used and can\'t be deleted.')
}
}
},
containerClasses: function () {
return {
Expand Down
4 changes: 3 additions & 1 deletion frontend/js/components/table/BulkEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<div class="bulkEditor">
<div class="bulkEditor__inner" v-if="bulkIds.length">
<div class="container">
<p class="bulkEditor__infos">{{ bulkIds.length }} item{{ bulkIds.length > 1 ? 's' : '' }} selected</p>
<p class="bulkEditor__infos">
{{ bulkIds.length }} {{ bulkIds.length > 1 ? $trans('listing.bulk-selected-items') : $trans('listing.bulk-selected-item') }}
</p>
<div class="bulkEditor__dropdown">
<a17-dropdown ref="bulkActionsDown" position="bottom-left" width="full" :offset="0">
<a17-button variant="dropdown" size="small" @click="$refs.bulkActionsDown.toggle()">{{ $trans('listing.bulk-actions') }}</a17-button>
Expand Down
20 changes: 10 additions & 10 deletions lang/cs/lang.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
/*
|--------------------------------------------------------------------------
| 5 Steps to Contribute a New Twill Localization at Ease
|--------------------------------------------------------------------------
| 1. Find the "lang.csv" under "lang" directory.
| 2. Import the csv file into a blank Google Sheet.
| 3. Each column is a language, enter the translation for a column. (tips: feel free to freeze rows and columns).
| 4. Download the Google Sheet as CSV, replace the original "lang/lang.csv" with the new one.
| 5. Run the command "php artisan twill:lang" to sync all lang files.
*/
/*
|--------------------------------------------------------------------------
| 5 Steps to Contribute a New Twill Localization at Ease
|--------------------------------------------------------------------------
| 1. Find the "lang.csv" under "lang" directory.
| 2. Import the csv file into a blank Google Sheet.
| 3. Each column is a language, enter the translation for a column. (tips: feel free to freeze rows and columns).
| 4. Download the Google Sheet as CSV, replace the original "lang/lang.csv" with the new one.
| 5. Run the command "php artisan twill:lang" to sync all lang files.
*/


return [
Expand Down
2 changes: 1 addition & 1 deletion lang/de/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
'destroy' => 'Vernichten',
'duplicate' => 'Duplizieren',
'edit' => 'Bearbeiten',
'feature' => 'Hervorheben',
'publish' => 'Veröffentlichen',
'feature' => 'Hervorheben',
'restore' => 'Wiederherstellen',
'unfeature' => 'Hervorhebung aufheben',
'unpublish' => 'Veröffentlichung aufheben',
Expand Down
127 changes: 108 additions & 19 deletions lang/en/lang.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php
/*
|--------------------------------------------------------------------------
| 5 Steps to Contribute a New Twill Localization at Ease
|--------------------------------------------------------------------------
| 1. Find the "lang.csv" under "lang" directory.
| 2. Import the csv file into a blank Google Sheet.
| 3. Each column is a language, enter the translation for a column. (tips: feel free to freeze rows and columns).
| 4. Download the Google Sheet as CSV, replace the original "lang/lang.csv" with the new one.
| 5. Run the command "php artisan twill:lang" to sync all lang files.
*/
/*
|--------------------------------------------------------------------------
| 5 Steps to Contribute a New Twill Localization at Ease
|--------------------------------------------------------------------------
| 1. Find the "lang.csv" under "lang" directory.
| 2. Import the csv file into a blank Google Sheet.
| 3. Each column is a language, enter the translation for a column. (tips: feel free to freeze rows and columns).
| 4. Download the Google Sheet as CSV, replace the original "lang/lang.csv" with the new one.
| 5. Run the command "php artisan twill:lang" to sync all lang files.
*/


return [
'auth' => [
Expand Down Expand Up @@ -41,6 +42,11 @@
'my-drafts' => 'My drafts',
'search-placeholder' => 'Search everything...',
'statitics' => 'Statistics',
'search' => [
'loading' => 'Loading…',
'no-result' => 'No results found.',
'last-edit' => 'Last edited',
],
'activities' => [
'created' => 'Created',
'updated' => 'Updated',
Expand Down Expand Up @@ -76,14 +82,14 @@
'fields' => [
'block-editor' => [
'add-content' => 'Add content',
'add-item' => 'Add item',
'collapse-all' => 'Collapse all',
'create-another' => 'Create another',
'delete' => 'Delete',
'expand-all' => 'Expand all',
'loading' => 'Loading',
'open-in-editor' => 'Open in editor',
'preview' => 'Preview',
'add-item' => 'Add item',
],
'browser' => [
'add-label' => 'Add',
Expand All @@ -110,6 +116,9 @@
'edit-close' => 'Close info',
'edit-info' => 'Edit info',
'original-dimensions' => 'Original',
'alt-text' => 'Alt Text',
'caption' => 'Caption',
'video-url' => 'Video URL (optional)',
],
],
'filter' => [
Expand Down Expand Up @@ -169,8 +178,8 @@
'destroy' => 'Destroy',
'duplicate' => 'Duplicate',
'edit' => 'Edit',
'feature' => 'Feature',
'publish' => 'Publish',
'feature' => 'Feature',
'restore' => 'Restore',
'unfeature' => 'Unfeature',
'unpublish' => 'Unpublish',
Expand All @@ -187,6 +196,55 @@
'paginate' => [
'rows-per-page' => 'Rows per page:',
],
'bulk-selected-item' => 'item selected',
'bulk-selected-items' => 'items selected',
'reorder' => [
'success' => ':modelTitle order changed!',
'error' => ':modelTitle order was not changed. Something wrong happened!',
],
'restore' => [
'success' => ':modelTitle restored!',
'error' => ':modelTitle was not restored. Something wrong happened!',
],
'bulk-restore' => [
'success' => ':modelTitle items restored!',
'error' => ':modelTitle items were not restored. Something wrong happened!',
],
'force-delete' => [
'success' => ':modelTitle destroyed!',
'error' => ':modelTitle was not destroyed. Something wrong happened!',
],
'bulk-force-delete' => [
'success' => ':modelTitle items destroyed!',
'error' => ':modelTitle items were not destroyed. Something wrong happened!',
],
'delete' => [
'success' => ':modelTitle moved to trash!',
'error' => ':modelTitle was not moved to trash. Something wrong happened!',
],
'bulk-delete' => [
'success' => ':modelTitle items moved to trash!',
'error' => ':modelTitle items were not moved to trash. Something wrong happened!',
],
'duplicate' => [
'success' => ':modelTitle duplicated with Success!',
'error' => ':modelTitle was not duplicated. Something wrong happened!',
],
'publish' => [
'unpublished' => ':modelTitle unpublished!',
'published' => ':modelTitle published!',
'error' => ':modelTitle was not published. Something wrong happened!',
],
'featured' => [
'unfeatured' => ':modelTitle unfeatured!',
'featured' => ':modelTitle featured!',
'error' => ':modelTitle was not featured. Something wrong happened!',
],
'bulk-featured' => [
'unfeatured' => ':modelTitle items unfeatured!',
'featured' => ':modelTitle items featured!',
'error' => ':modelTitle items were not featured. Something wrong happened!',
],
],
'main' => [
'create' => 'Create',
Expand All @@ -212,6 +270,36 @@
'title' => 'Media Library',
'update' => 'Update',
'unused-filter-label' => 'Show unused only',
'no-tags-found' => 'Sorry, no tags found.',
'dialogs' => [
'delete' => [
'delete-media-title' => 'Delete media',
'delete-media-desc' => 'Are you sure ?<br />This change can\'t be undone.',
'delete-media-confirm' => 'Delete',
'title' => 'Are you sure ?',
'allow-delete-multiple-medias' => 'Some files are used and can\'t be deleted. Do you want to delete the others ?',
'allow-delete-one-media' => 'This file is used and can\'t be deleted. Do you want to delete the others ?',
'dont-allow-delete-multiple-medias' => 'This files are used and can\'t be deleted.',
'dont-allow-delete-one-media' => 'This file is used and can\'t be deleted.',
],
'replace' => [
'replace-media-title' => 'Replace media',
'replace-media-desc' => 'Are you sure ?<br />This change can\'t be undone.',
'replace-media-confirm' => 'Replace',
],
],
'types' => [
'single' => [
'image' => 'image',
'video' => 'video',
'file' => 'file',
],
'multiple' => [
'image' => 'images',
'video' => 'videos',
'file' => 'files',
],
],
],
'modal' => [
'create' => [
Expand All @@ -237,22 +325,17 @@
'settings' => 'Settings',
'close-menu' => 'Close menu',
],
'settings' => [
'update' => 'Update',
'cancel' => 'Cancel',
'fieldset-label' => 'Edit settings',
],
'notifications' => [
'reset' => [
'subject' => ':appName | Reset password',
'action' => 'Reset password',
'content' => 'You are receiving this email because we received a password reset. If you did not request a password reset, no further action is required.',
'subject' => ':appName | Reset password',
],
'welcome' => [
'subject' => ':appName | Welcome',
'action' => 'Choose your own password',
'content' => 'You are receiving this email because an account was created for you on :name.',
'title' => 'Welcome',
'subject' => ':appName | Welcome',
],
],
'overlay' => [
Expand All @@ -269,6 +352,7 @@
'single-view' => 'Single view',
'title' => 'Preview changes',
'unsaved' => 'Previewing with your unsaved changes',
'drag-and-drop' => 'Drag and drop content from the left navigation',
],
'publisher' => [
'cancel' => 'Cancel',
Expand Down Expand Up @@ -345,4 +429,9 @@
'user-image' => 'Image',
'users' => 'Users',
],
'settings' => [
'update' => 'Update',
'cancel' => 'Cancel',
'fieldset-label' => 'Edit settings',
],
];
2 changes: 1 addition & 1 deletion lang/es/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
'destroy' => 'Destruir',
'duplicate' => 'Duplicar',
'edit' => 'Editar',
'feature' => 'Destacar',
'publish' => 'Publicar',
'feature' => 'Destacar',
'restore' => 'Restaurar',
'unfeature' => 'Unfeature',
'unpublish' => 'Despublicar',
Expand Down
Loading