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

Error "foreach() argument must be of type array|object, int given" when i select language #201

Open
raficopuntiando opened this issue May 12, 2022 · 4 comments

Comments

@raficopuntiando
Copy link

raficopuntiando commented May 12, 2022

Hi, the plugin was working well but I don't know why and when it happed
when I try to select a specific language to edit, I have this error foreach() argument must be of type array|object, int given, see the image.

i have dropped the symbol & form the method getSourceLanguageTranslationsWith() in vendor/joedixon/laravel-translation/src/Drivers/Translation.php. before and the plugin was working well.
but I don't know what is happening.

i have the project in my local environment and its working but in production server it's not working, I copied and pasted all the files from my local to the server and still I have the problem

Any ideas about what is happening?

image

@TSalu
Copy link

TSalu commented Oct 4, 2022

Hi, did you find a solution to this?

I get a similar error when opening translations page.
foreach() argument must be of type array|object, int given
App \ Http\ Middleware\ Localization: 22:handle

@TSalu
Copy link

TSalu commented Oct 19, 2022

Seems like this project is not active anymore

@Yaser1s
Copy link

Yaser1s commented Nov 1, 2023

I have the same problem guys

@timoye
Copy link

timoye commented Jul 30, 2024

There could be a broken file in resources/lang

Easy Fix
Trace the broken file and delete or delete the folder and files in resources/lang and all languages folders in resources/lang/vendor/translation

then run php artisan translation:add-language to add each language again

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

4 participants