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

[BUG] only index items are translated in export #53

Open
3 tasks done
dakira opened this issue May 17, 2019 · 1 comment
Open
3 tasks done

[BUG] only index items are translated in export #53

dakira opened this issue May 17, 2019 · 1 comment

Comments

@dakira
Copy link

dakira commented May 17, 2019

Prerequisites

  • Able to reproduce the behaviour outside of your code, the problem is isolated to Laravel Excel.
  • Checked that your issue isn't already filed.
  • Checked if no PR was submitted that fixes this problem.

Versions

  • PHP version: 7.3
  • Laravel version: 5.8.17
  • Nova version: 2.0.5
  • Package version: 3.1.13 and 1.1.4

Description

The export picks up on translated fields like this:

public function fields(Request $request)
{
    return [
        Text::make(__('Company'), 'company'),
        Text::make(__('Lastname'), 'lastname')->sortable()
            ->rules('required', 'max:255'),
        Text::make(__('Firstname'), 'firstname')
    ]
}

They show up translated in the excel file, but only when they are on the index. For fields that are excluded from the index no translation is shown.

@patrickbrouwers
Copy link
Member

Hey @dakira can you show the code you have for the export action?

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

No branches or pull requests

2 participants