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

fix: Allow file fields to be non translatable #2529

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

zeezo887
Copy link
Collaborator

@zeezo887 zeezo887 commented Mar 8, 2024

Description

This addresses the issue where setting the translatable(false) method on a file field does not affect the field (i.e. Always translated) by adding a new disableTranslate() method on the file field.

Usage:

Files::make()
    ->name('single_file')
    ->label(twillTrans('Single file'))
    ->disableTranslate();

Related Issues

Fixes #1712

@Tofandel
Copy link
Contributor

Tofandel commented Apr 1, 2024

Why create a new disableTranslate when there is already translatable(false)?

Lets not make the API more confusing shall we

@ifox
Copy link
Member

ifox commented May 23, 2024

Let me clarify this. We can agree this is not pretty, but it is temporary to avoid a breaking change.

In #2525 I asked @zeezo887 to add a new option to work around the current situation with the translate prop on medias field that isn't working because of the global configuration option. Similarly, the files field currently forces translations without any ability to control it globally or at the field level.

To avoid breaking changes in Twill 3 while enabling the missing functionality we introduce these temporary methods. In a future breaking release we will fix the behavior of the translate prop and translatable method, remove the global configuration option for medias fields, as well as these unnecessary methods.

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.

Allow file fields to be non translatable
3 participants