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

add i18n client #121

Closed
wants to merge 10 commits into from
Closed

add i18n client #121

wants to merge 10 commits into from

Conversation

Aragonbn90
Copy link
Contributor

I've completed issues #45 and #59.

@Aragonbn90 Aragonbn90 changed the title temp add i18n client Apr 11, 2020
@ghost
Copy link

ghost commented Apr 11, 2020

Please attention to update/create new generator tests :)

generators/app/index.js Outdated Show resolved Hide resolved
generators/languages/USAGE Show resolved Hide resolved
generators/languages/index.js Outdated Show resolved Hide resolved
generators/languages/index.js Outdated Show resolved Hide resolved
generators/languages/index.js Outdated Show resolved Hide resolved
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Aragonbn90
Copy link
Contributor Author

@amanganiello90 I've completed this task.
I just change home.json and global.json, replace "JHipster" by "NHipster".
Please help me to check. Thank you.

@ghost ghost self-requested a review May 4, 2020 13:26
@ghost
Copy link

ghost commented May 4, 2020

Hi Ed!! Thanks for the good job!...but only a thing of patience.
Maybe I have not been good to explain the thing, sorry for this :)
Well, you have done too much work, the only thing required is overwritten home.json file (not global or others), according the client customization: https://github.com/jhipster/generator-jhipster-nodejs/blob/master/generators/client/templates/angular/home/home.component.html.ejs
(check the home.title and the others tag that contains NHipster word).
Besides, we shouldn't lose the other json Hipster client files for every language: https://github.com/jhipster/generator-jhipster/tree/master/generators/languages/templates/src/main/webapp/i18n/en

@ghost
Copy link

ghost commented May 4, 2020

A little tip: In the NHipster language index.js file, the one thing that you have to do it's to merge the writing phase and add your new writing home.json method(precisely the https://github.com/jhipster/generator-jhipster/blob/a8205cfa5b5e40dcf8c6fd6730d176c7a62002cb/generators/languages/index.js#L228 method):

 get writing() {
        const phaseFromJHipster = super._writing();
        const myCustomPhaseSteps = {
            writeNHipsterHomeFiles() {
             // write your write function algorithm to write home.json per language
            },
           write() {  // overwrite standard jhipster function to avoid server language files
           if (!this.skipClient) {
                    this.updateLanguagesInLanguagePipe(this.languages);
                    this.updateLanguagesInLanguageConstantNG2(this.languages);
                    this.updateLanguagesInWebpack(this.languages);
                    if (this.clientFramework === ANGULAR) {
                        this.updateLanguagesInMomentWebpackNgx(this.languages);
                    }
                    if (this.clientFramework === REACT) {
                        this.updateLanguagesInMomentWebpackReact(this.languages);
                    }
                }
            },
        };
      
        return Object.assign(phaseFromJHipster, myCustomPhaseSteps);
    }


@ghost
Copy link

ghost commented Aug 13, 2020

Resolved with feedback in #160 . Thanks for the support!

@ghost ghost closed this Aug 13, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants