Giter Site home page Giter Site logo

Comments (4)

voicecode-bv avatar voicecode-bv commented on September 14, 2024

@satoved Can you please send me some example sql files I can import? I can't replicate this on my side. I think it's because you're missing some database records for some locales.

from laravel-nova-translation-manager.

satoved avatar satoved commented on September 14, 2024

Thanks for the quick fixes, the package is really helpful.

Figured it out.

Let's say that the first locale in the settings is 'en'

And /voicecode/nova-translation-manager/locales returns:

["en","es","de","ru"]

Then it takes the first locale ("en") as a key value here https://github.com/voicecode-bv/laravel-nova-translation-manager/blob/master/resources/js/components/Tool.vue#L61

But if we don't have an english translation for certain key in json file, e.g.:

/voicecode/nova-translation-manager/translations/_json returns:

{
   "1X2 Tip":{
      "pt":{
         "id":1867,
         "status":0,
         "locale":"pt",
         "group":"_json",
         "key":"1X2 Tip",
         "value":"Dica 1X2",
      },
      "de":{
         "id":627,
         "status":0,
         "locale":"de",
         "group":"_json",
         "key":"1X2 Tip",
         "value":"Tipp f\u00fcr 3-Weg-Wette",
      }
   }
}

It tries to do:

translation[locales[0]].key

When there is no translation for "en", and as a result it fails getting .key of null.

The solution can be using the key from json response:

image

Instead of the key for the first location returned.

from laravel-nova-translation-manager.

voicecode-bv avatar voicecode-bv commented on September 14, 2024

@satoved Thanks! Iā€™m working on a fix for this.

from laravel-nova-translation-manager.

voicecode-bv avatar voicecode-bv commented on September 14, 2024

@satoved I've got it working using the 0.0.6 release. Can you confirm this?

from laravel-nova-translation-manager.

Related Issues (2)

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.