Skip to content

Commit

Permalink
[5.x] Improve the dynamic upload folder help text (#10903)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Varga <jason@pixelfear.com>
  • Loading branch information
jackmcdade and jasonvarga authored Oct 21, 2024
1 parent d4eb5bf commit 97b36cd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div
v-if="hasPendingDynamicFolder"
class="py-3 px-4 text-sm w-full rounded-md border border-dashed text-gray-700 dark:text-dark-175 dark:border-dark-200"
v-html="__('statamic::fieldtypes.assets.dynamic_folder_pending', {field: `<code>${config.dynamic}</code>`})"
v-html="pendingText"
/>

<uploader
Expand Down Expand Up @@ -438,6 +438,12 @@ export default {
return ! this.hasPendingDynamicFolder;
},
pendingText() {
return this.config.dynamic === 'id'
? __('statamic::fieldtypes.assets.dynamic_folder_pending_save')
: __('statamic::fieldtypes.assets.dynamic_folder_pending_field', {field: `<code>${this.config.dynamic}</code>`});
}
},
events: {
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/de/fieldtypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'assets.config.restrict' => 'Verhindern, dass Benutzer:innen zu anderen Ordnern navigieren können.',
'assets.config.show_filename' => 'Dateiname neben dem Vorschaubild anzeigen.',
'assets.config.show_set_alt' => 'Einen Link zum Erfassen des Alt-Texts bei allen Bildern anzeigen.',
'assets.dynamic_folder_pending' => 'Dieser Upload-Ordner wird verfügbar sein, sobald :field festgelegt ist.',
'assets.dynamic_folder_pending_field' => 'Dieser Upload-Ordner wird verfügbar sein, sobald :field festgelegt ist.',
'assets.title' => 'Dateien',
'bard.config.allow_source' => 'Ermöglicht beim Schreiben das Anzeigen des HTML-Quellcodes.',
'bard.config.always_show_set_button' => 'Ermöglicht das ständige Anzeigen des „Set hinzufügen“-Buttons.',
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/de_CH/fieldtypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'assets.config.restrict' => 'Verhindern, dass Benutzer:innen zu anderen Ordnern navigieren können.',
'assets.config.show_filename' => 'Dateiname neben dem Vorschaubild anzeigen.',
'assets.config.show_set_alt' => 'Einen Link zum Erfassen des Alt-Texts bei allen Bildern anzeigen.',
'assets.dynamic_folder_pending' => 'Dieser Upload-Ordner wird verfügbar sein, sobald :field festgelegt ist.',
'assets.dynamic_folder_pending_field' => 'Dieser Upload-Ordner wird verfügbar sein, sobald :field festgelegt ist.',
'assets.title' => 'Dateien',
'bard.config.allow_source' => 'Ermöglicht beim Schreiben das Anzeigen des HTML-Quellcodes.',
'bard.config.always_show_set_button' => 'Ermöglicht das ständige Anzeigen des «Set hinzufügen»-Buttons.',
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/en/fieldtypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
'assets.config.show_filename' => 'Show the filename next to the preview image.',
'assets.config.show_set_alt' => 'Show a link to set the Alt Text of any images.',
'assets.config.query_scopes' => 'Choose which query scopes should be applied when retrieving selectable assets.',
'assets.dynamic_folder_pending' => 'This upload folder will be available once :field is set.',
'assets.dynamic_folder_pending_field' => 'This field will be available once :field is set.',
'assets.dynamic_folder_pending_save' => 'This field will be available after saving.',
'assets.title' => 'Assets',
'bard.config.allow_source' => 'Enable to view the HTML source code while writing.',
'bard.config.always_show_set_button' => 'Enable to always show the "Add Set" button.',
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/fr/fieldtypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'assets.config.restrict' => 'Empêchez les utilisateurs de naviguer vers d’autres dossiers.',
'assets.config.show_filename' => 'Affichez le nom du fichier à côté de l’image de prévisualisation.',
'assets.config.show_set_alt' => 'Affichez un lien afin de définir le texte alternatif pour n’importe quelle image.',
'assets.dynamic_folder_pending' => 'Ce dossier de téléchargement sera disponible dès que :field sera défini.',
'assets.dynamic_folder_pending_field' => 'Ce dossier de téléchargement sera disponible dès que :field sera défini.',
'assets.title' => 'Assets',
'bard.config.allow_source' => 'Activez l’option pour afficher le code source HTML pendant l’écriture.',
'bard.config.always_show_set_button' => 'Activez l’option pour toujours afficher le bouton "Ajouter un ensemble".',
Expand Down

2 comments on commit 97b36cd

@ebeauchamps
Copy link
Contributor

Choose a reason for hiding this comment

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

Hum....In the German and French versions, the translation was directly copied from "assets.dynamic_folder_pending" to "assets.dynamic_folder_pending_field", keeping the translation of "upload folder".

While in the English version, "Upload folder" has been removed: "This upload folder will be available once :field is set." has been changed to "This field will be available once :field is set."

There is either a problem in the English file, or the translations should not have been copied.

@jasonvarga
Copy link
Member

Choose a reason for hiding this comment

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

dynamic_folder_pending was renamed to dynamic_folder_pending_field and the wording was slightly changed. The old translation would still make sense there.

Feel free to update it to be a direct translation of the updated English phrase.

Please sign in to comment.