Giter VIP home page Giter VIP logo

resonance's People

Contributors

david-d-h avatar gurachek avatar malzag avatar mcharytoniuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

resonance's Issues

(Already loaded) translation data gets overridden by other files that get loaded after it.

An issue I've discovered is that when loading translations, only the last file (in alphabetical order) gets loaded. If previously loaded data existed it will be replaced every time a new translation file is loaded. As an example, assume the following file structure.

# lang/en/website.ini
[error]
bad_request = "Bad request"
# lang/en/z.ini
# this is empty on purpose

Now because the letter z obviously comes after the letter w, it will be loaded after website.ini. Which because of this issue means that there are no translations at all.

dump of TranslatorBridge->translations after every individual load of a translation file.
// website.ini gets loaded

object(Ds\Map)#298 (1) {
  [0]=>
  object(Ds\Pair)#755 (2) {
    ["key"]=>
    string(2) "en"
    ["value"]=>
    object(Ds\Map)#757 (1) {
      [0]=>
      object(Ds\Pair)#763 (2) {
        ["key"]=>
        string(17) "error.bad_request"
        ["value"]=>
        string(11) "Bad request"
      }
    }
  }
}

// z.ini gets loaded

object(Ds\Map)#298 (1) {
  [0]=>
  object(Ds\Pair)#757 (2) {
    ["key"]=>
    string(2) "en"
    ["value"]=>
    object(Ds\Map)#763 (0) {
    }
  }
}

I've also noticed that in the documentation for translations, each file gets their own kind of "namespace" of translations. So with this file:

# lang/en/website.ini
greeting = "Hello"

You should translate greeting by doing TranslatorBridge::trans($request, 'website.greeting'); however this does not work, the translation is simply stored as 'greeting' without any reference to the original website "namespace".

The reason I included this in the issue, is because this "namespacing" could be a solution to both problems.

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.