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

Add placeholder for filename without extension #1833

Closed
wants to merge 1 commit into from

Conversation

perosb
Copy link
Contributor

@perosb perosb commented Dec 9, 2024

Add a placeholder containing the filename without the extension.

Fixes #1828

Checklist for Pull Requests


@perosb perosb requested a review from drakkan as a code owner December 9, 2024 12:22
@CLAassistant
Copy link

CLAassistant commented Dec 9, 2024

CLA assistant check
All committers have signed the CLA.

@@ -796,6 +796,7 @@ func (p *EventParams) getStringReplacements(addObjectData, jsonEscaped bool) []s
"{{VirtualTargetPath}}", p.getStringReplacement(p.VirtualTargetPath, jsonEscaped),
"{{FsTargetPath}}", p.getStringReplacement(p.FsTargetPath, jsonEscaped),
"{{ObjectName}}", p.getStringReplacement(p.ObjectName, jsonEscaped),
"{{ObjectBaseName}}", p.getStringReplacement(strings.TrimSuffix(path.Base(p.ObjectName), path.Ext(p.ObjectName)), jsonEscaped),
Copy link
Owner

Choose a reason for hiding this comment

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

p.ObjectName is already the path.Base of the virtual path. path.Ext is already computed as p.Extension

@@ -921,6 +921,9 @@ <h3 data-i18n="actions.placeholders_modal_title" class="modal-title">Supported p
<p>
<span class="shortcut">{{`{{ObjectName}}`}}</span> => <span data-i18n="actions.placeholders_modal.object_name">File/directory name, for example "afile.txt" or provider object name.</span>
</p>
<p>
<span class="shortcut">{{`{{ObjectBaseName}}`}}</span> => <span data-i18n="actions.placeholders_modal.object_basename">Filename without extension, for example "afile" if the filename is "afile.txt".</span>
Copy link
Owner

Choose a reason for hiding this comment

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

the translation must be added to the language files

@drakkan drakkan closed this in dee3f3f Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EventManager: placeholder for filename without extension
3 participants