Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Having JSON and Array translations at the same time #85

Open
lk77 opened this issue Jun 4, 2019 · 5 comments
Open

Having JSON and Array translations at the same time #85

lk77 opened this issue Jun 4, 2019 · 5 comments

Comments

@lk77
Copy link

lk77 commented Jun 4, 2019

Hello,

i seems that it's not possible to have json translations and array translations at the same time,
when using --multi-locales option.

In Generator.php line 75 :

if ($fileinfo->isDir()) {
                    $local = $this->allocateLocaleArray($fileinfo->getRealPath());
                } else {
                    $local = $this->allocateLocaleJSON($fileinfo->getRealPath());
                    if ($local === null) continue;
                }

if the locale exist as a directory, then the json translation is never applied.

thanks.

@martinlindhe
Copy link
Owner

martinlindhe commented Jun 4, 2019

Could you give an example?

How does your directory structure look, please provide output of tree command.

What is the expected result, versus actual result?

@lk77
Copy link
Author

lk77 commented Jun 4, 2019

There is the tree output :

├── en
│   ├── auth.php
│   ├── pagination.php
│   ├── passwords.php
│   └── validation.php
├── fr
│   ├── auth.php
│   ├── pagination.php
│   ├── passwords.php
│   └── validation.php
└── fr.json

the expected result is the inclusion of the translations in fr.json in the final fr.js generated in resources/assets/js/langs/fr.js, which is not the case.

Only the translations in the *.php files are included.

If i don't use --multi-locales options, translations from fr.js are correctly included

"fr": {
        "I love programming.": "J'aime programmer",
        "pagination": {
            "previous": "« Précédent",
            "next": "Suivant »"
        },
[...]

with --multi-locales option :

"fr": {
        "pagination": {
            "previous": "« Précédent",
            "next": "Suivant »"
        },

@murrant
Copy link
Contributor

murrant commented Oct 23, 2019

This should be fixed by #96

@lk77
Copy link
Author

lk77 commented Oct 24, 2019

Thanks !

@lk77 lk77 closed this as completed Oct 24, 2019
@lk77 lk77 reopened this Feb 27, 2020
@lk77
Copy link
Author

lk77 commented Feb 27, 2020

Hello,

i reopen the issue since #96 was reverted.

@martinlindhe

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants