Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using default keyed translations #105

Open
samsch opened this issue Aug 9, 2017 · 9 comments
Open

Using default keyed translations #105

samsch opened this issue Aug 9, 2017 · 9 comments

Comments

@samsch
Copy link

samsch commented Aug 9, 2017

It appears that translations in a resources/lang/en.json file (used for translations keyed by the default text) are ignored by the generator.

@rmariuzzo
Copy link
Owner

We don't yet support JSON files yet 😞 . Planning to add for version 1.5.

@okaufmann
Copy link
Contributor

okaufmann commented Oct 17, 2017

Are there any Ideas yet, how to integrate? I need this and would add a PR.

@okaufmann
Copy link
Contributor

I started with a experimental version here: #116

@maxalmonte14
Copy link

Is this feature not available yet? This is an indispensable feature for whose working with Laravel 5.4 and above.

@rmariuzzo
Copy link
Owner

Will take a look and address this soon.

@mojtabaahn
Copy link

Hi I noticed an experimental version merged into develop, is it going to be released soon?

@TheNewSound
Copy link

I don't know if I understand the problem correctly but maybe #147 is also a fix for this?

@samsch
Copy link
Author

samsch commented Apr 21, 2020

My test case (and personal context/knowledge) for this is long gone with a previous job at this point, but maybe someone else who ran into this can verify?

@blaab2
Copy link

blaab2 commented Nov 8, 2020

Hi everybody, I found out that the keyed translation strings are actually stored in the messages.js file. The only problem is that they are not found properly by Lang.get.

A quick fix is to use this snipped.

export default class myLang {
    static get(key){
        if (Lang.has('strings.' + key))
            return Lang.get('strings.' + key);
        else
            return key;
    }
}

and use for example
myLang.get('Dashboard'),

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

No branches or pull requests

7 participants