question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After publish file takes another array format

See original GitHub issue

I mean i have in files lines like so:

    'account.user' => '/user',
    'account.user.step.two' => '/user-step-2',
    'account.user.step.three' => '/user-step-3',

In DB all lines are stored. But after publish it the file looks like:

   'account' => [
        'user' => [
            'step' => [
                'two' => '/user-step-2',
                'three' => '/user-step-3'
            ]
        ]
    ],

And in this time my first line goes lost. Is there any config that do the thing and export/publish key-value from DB in another format? #

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vschcommented, May 19, 2017

@gerardreches, the dot notation by convention is used to separate arrays. The issue is that on publishing the dot convention is always interpreted as array convention. The code to ignore the array convention when a key has a value assigned that would be overwritten by an array gets to be convoluted.

Would it be possible for you to use another delimiter than a period . so it does not conflict with the translation array notation, for example a dash - would do the trick.

0reactions
gerardrechescommented, May 18, 2017

@vsch I’m in the same problem right now.

I have some translations for routes. One of these routes (/services) is for a services page, so I called the string routes.services. The thing is that the services page is a top level for the different services:

/services/testimonials /services/transactions /services/estate and more… So the strings are routes.services.testimonials, routes.services.transactions, routes.services.estate, and so on.

When I publish the routes group, it shows me

Incorrect use of dot convention for translation keys (value will be overwritten with an array of child values): routes:: services

and my laravel project shows a trim() error until I delete the generated translations.

I know that this is logic, because there are two equal keys with different values: one contains a string, and the other contains an array.

Is there some workaround for this? Or the only option is to rename the routes.services key?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Populating another array from array - Javascript - Stack Overflow
Very simple thing I am trying to do in JS (assign the values of one array to another), but ...
Read more >
PHP | $_FILES Array (HTTP File Upload variables)
After we are done with uploading a file, in the script we will check the request method of the server, if it is...
Read more >
POST method uploads - Manual - PHP
This function deals with whatever dimension of upload metadata. I kept the code extremely simple, it doesn't validate anything in $_FILES, etc... AND...
Read more >
Arrays - Learn web development | MDN
In the final article of this module, we'll look at arrays — a neat way of storing a list of data items under...
Read more >
Importing Image Data into NumPy Arrays | Pluralsight
Here the function takes the path and the file name where we want to save the image data in NumPy array format. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found