joedixon / laravel-translation

Translation management for your Laravel application.
MIT License
698 stars 231 forks source link

Issue saving translations in Laravel6 #113

Closed Ash-raf10 closed 2 years ago

Ash-raf10 commented 4 years ago

When I try to update the translation file,It throws an error showing the requested url is not found. Everything else seems to work fine expect for updating the translations. The requested url does not point to my project root while updating translations.

The expected url is localhost/my_project/languages/{language},but I got localhost/languages/{language} Screenshots are attached.

Desktop:

Screenshot (136)

pitbulk commented 4 years ago

The root of your site is

localhost/hrpro

and I believe that path is generating the issue.

If you serve it locally, with no path it should work

Ash-raf10 commented 4 years ago

I had to solve it by hard coding the path 'hrpro' at line 4094 in the app.js file . But I guess this is not the best possible solution.

pitbulk commented 3 years ago

I solved it in line 566 adding the pathname dinamycally, with

        if (window.location.pathname.indexOf(e.url) !== 0) {
            e.url = "/"+window.location.pathname.split('/')[1]+"/"+e.url;
        }
    s.prototype.request = function (e)
    {

        "string" == typeof e && (e = i.merge(
        {
            url: arguments[0]
        }, arguments[1])), (e = i.merge(r,
        {
            method: "get"
        }, this.defaults, e)).method = e.method.toLowerCase();
        if (window.location.pathname.indexOf(e.url) !== 0) {
            e.url = "/"+window.location.pathname.split('/')[1]+"/"+e.url;
        }
        var t = [a, void 0],
            n = Promise.resolve(e);

@joedixon what do you think?

anushkadeshan commented 3 years ago

@pitbulk What is the files should be edited ?

officialmmt commented 3 years ago

I solved it in line 566 adding the pathname dinamycally, with

        if (window.location.pathname.indexOf(e.url) !== 0) {
            e.url = "/"+window.location.pathname.split('/')[1]+"/"+e.url;
        }
    s.prototype.request = function (e)
    {

        "string" == typeof e && (e = i.merge(
        {
            url: arguments[0]
        }, arguments[1])), (e = i.merge(r,
        {
            method: "get"
        }, this.defaults, e)).method = e.method.toLowerCase();
        if (window.location.pathname.indexOf(e.url) !== 0) {
            e.url = "/"+window.location.pathname.split('/')[1]+"/"+e.url;
        }
        var t = [a, void 0],
            n = Promise.resolve(e);

@joedixon what do you think?

Which file man?!

Jobinjose01 commented 3 years ago

app.js