Giter VIP home page Giter VIP logo

Comments (4)

SiteEffect avatar SiteEffect commented on August 17, 2024

What is the value in general, having files named with multiple extensions? For me most of the js.php are more like php.js comparing the code size of each language.

from worldopole.

Obihoernchen avatar Obihoernchen commented on August 17, 2024

Yeah but your webserver wouldn't execute php.js as php ;) Its basically a PHP file building a js file.
Actually I think it would be a good idea to change the locales loader to return json output so we can just use .js files and Ajax load the returned json and use it inside the js code.

We could cache the generated translation json for a few hours for each user. This would lower server load (locales loader isn't executed with every request anymore) and we wouldn't have these strange .js.php files anymore. And we could switch to on the fly client-side translations easier in the future.

@PoUpA is this actually a valid idea?

from worldopole.

friscoMad avatar friscoMad commented on August 17, 2024

Yup this can be done, but not sure if it will be enough to remove all php.js as I think some use variables also.
locale.loader could be a mix returning the locale as json if called or definining the variables if imported.
Caching is just a matter of setting the correct headers.

from worldopole.

Obihoernchen avatar Obihoernchen commented on August 17, 2024

aru.php can output locale and pokemon json now 👍
I'm replacing all *.js.php files with *.js files + caching + ajax locale load.

from worldopole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.