-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from jhipster/feature/i18n-client
Feature/i18n client
- Loading branch information
Showing
63 changed files
with
1,111 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Description: | ||
Select languages from a list of available languages. The i18n files will be copied to the /webapp/i18n folder. | ||
|
||
Example: | ||
jhipster languages | ||
|
||
This will create for each selected language: | ||
/webapp/i18n/{lang}/global.json | ||
/webapp/i18n/{lang}/activate.json | ||
/webapp/i18n/{lang}/configuration.json | ||
/webapp/i18n/{lang}/error.json | ||
/webapp/i18n/{lang}/gateway.json | ||
/webapp/i18n/{lang}/health.json | ||
/webapp/i18n/{lang}/home.json | ||
/webapp/i18n/{lang}/login.json | ||
/webapp/i18n/{lang}/logs.json | ||
/webapp/i18n/{lang}/metrics.json | ||
/webapp/i18n/{lang}/password.json | ||
/webapp/i18n/{lang}/register.json | ||
/webapp/i18n/{lang}/reset.json | ||
/webapp/i18n/{lang}/sessions.json | ||
/webapp/i18n/{lang}/settings.json | ||
/webapp/i18n/{lang}/user-management.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* eslint-disable consistent-return */ | ||
const chalk = require('chalk'); | ||
const jhipsterConstants = require('generator-jhipster/generators/generator-constants'); | ||
const LanguagesGenerator = require('generator-jhipster/generators/languages'); | ||
|
||
module.exports = class extends LanguagesGenerator { | ||
constructor(args, opts) { | ||
super(args, Object.assign({ fromBlueprint: true }, opts)); // fromBlueprint variable is important | ||
|
||
const jhLanguagesContext = (this.jhipsterContext = this.options.jhipsterContext); | ||
|
||
if (!jhLanguagesContext) { | ||
this.error(`This is a JHipster blueprint and should be used only like ${chalk.yellow('jhipster --blueprints nodejs')}`); | ||
} | ||
|
||
this.configOptions = jhLanguagesContext.configOptions || {}; | ||
// This sets up options for this sub generator and is being reused from JHipster | ||
jhLanguagesContext.setupServerOptions(this, jhLanguagesContext); | ||
jhLanguagesContext.setupClientOptions(this, jhLanguagesContext); | ||
} | ||
|
||
get initializing() { | ||
const initPhaseFromJHipster = super._initializing(); | ||
const initNodeLanguagesPhaseSteps = { | ||
// avoid logging languages in server side | ||
validateFromCli() { | ||
this.checkInvocationFromCLI(); | ||
this.skipServer = true; | ||
} | ||
}; | ||
return Object.assign(initPhaseFromJHipster, initNodeLanguagesPhaseSteps); | ||
|
||
// Here we are not overriding this phase and hence its being handled by JHipster | ||
// return super._initializing(); | ||
} | ||
|
||
get default() { | ||
const defaultPhaseFromJHipster = super._default(); | ||
const defaultNodeLanguagesPhaseSteps = { | ||
// disable languages translation in server side | ||
disableLanguagesForJHipsterServer() { | ||
this.skipServer = true; | ||
this.skipUserManagement = true; | ||
} | ||
}; | ||
return Object.assign(defaultPhaseFromJHipster, defaultNodeLanguagesPhaseSteps); | ||
|
||
// Here we are not overriding this phase and hence its being handled by JHipster | ||
// return super._default(); | ||
} | ||
|
||
get writing() { | ||
const phaseFromJHipster = super._writing(); | ||
const jhipsterNodeLanguagesPhaseSteps = { | ||
// overwrite home.json file | ||
writeHomeJSON() { | ||
this.languagesToApply.forEach(language => { | ||
const path = `${jhipsterConstants.CLIENT_MAIN_SRC_DIR}i18n/${language}/home.json`; | ||
this.template(path, path); | ||
}); | ||
} | ||
}; | ||
return Object.assign(phaseFromJHipster, jhipsterNodeLanguagesPhaseSteps); | ||
} | ||
}; |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/al/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "Mirëseerdhët në, Java Hipster!", | ||
"subtitle": "Ky është kreu juaj", | ||
"logged": { | ||
"message": "Ju jeni futur si \"{{username}}\"." | ||
}, | ||
"question": "Në qoftë se keni ndonjë pyetje rreth JHipster:", | ||
"link": { | ||
"homepage": "Kreu i JHipster", | ||
"stackoverflow": "JHipster tek Stack Overflow", | ||
"bugtracker": "JHipster bug tracker", | ||
"chat": "JHipster dhoma e chatit publik", | ||
"follow": "ndiq @jhipster në Twitter" | ||
}, | ||
"like": "Në qoftë se ju pëlqen JHipster, mos harroni të na jepni një yll në", | ||
"github": "GitHub" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/ar-ly/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "أهلا وسهلا بك، جافا هبستر!", | ||
"subtitle": "هذه صفحتك الرئيسية", | ||
"logged": { | ||
"message": "قمت بتسجيل الدخول كمستخدم \"{{username}}\"." | ||
}, | ||
"question": "إذا كان لديك أي سؤال حول JHipster:", | ||
"link": { | ||
"homepage": "JHipster homepage", | ||
"stackoverflow": "JHipster on Stack Overflow", | ||
"bugtracker": "JHipster bug tracker", | ||
"chat": "JHipster public chat room", | ||
"follow": "follow @jhipster on Twitter" | ||
}, | ||
"like": "إذا كنت تحب JHipster، لا تنسى أن تعطي لنا نجم على", | ||
"github": "GitHub" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/bn/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "স্বাগতম, জাভা হিপ্সটার", | ||
"subtitle": "এটা আপনার হোম পেইজ", | ||
"logged": { | ||
"message": "আপনি লগ ইন করেছেন এই ইউজারনেম দিয়েঃ \"{{username}}\"." | ||
}, | ||
"question": "JHipster নিয়ে প্রশ্ন থাকলে:", | ||
"link": { | ||
"homepage": "JHipster হোম পেইজ", | ||
"stackoverflow": "Stack Overflow তে JHipster", | ||
"bugtracker": "JHipster বাগ ট্র্যাকার", | ||
"chat": "JHipster পাবলিক চ্যাট রুম", | ||
"follow": "টুইটার এ ফলো করুন @jhipster" | ||
}, | ||
"like": "JHipster ভাল লেগে থাকলে স্টার দিতে ভুলবেন না", | ||
"github": "GitHub" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/by/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "Сардэчна запрашаем, Java Hipster!", | ||
"subtitle": "Гэта ваша дамашняя старонка", | ||
"logged": { | ||
"message": "Вы ўвайшлі як карыстальнік \"{{username}}\"." | ||
}, | ||
"question": "Калі ў Вас з'явіліся пытанні па JHipster:", | ||
"link": { | ||
"homepage": "JHipster дамашняя старонка", | ||
"stackoverflow": "JHipster на Stack Overflow", | ||
"bugtracker": "JHipster баг трекер", | ||
"chat": "JHipster public chat room", | ||
"follow": "карыстальнік @jhipster в Twitter" | ||
}, | ||
"like": "Калі вам падабаецца JHipster, не забудзьце даць нам зорачку на", | ||
"github": "GitHub" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/ca/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "Benvingut, Java Hipster!", | ||
"subtitle": "Aquesta és la pàgina principal", | ||
"logged": { | ||
"message": "S'ha connectat amb l'usuari \"{{username}}\"." | ||
}, | ||
"question": "Si tens qualsevol pregunta sobre JHipster:", | ||
"link": { | ||
"homepage": "Pàgina preincipal de JHipster", | ||
"stackoverflow": "JHipster a Stack Overflow", | ||
"bugtracker": "JHipster seguiment d'incidencies", | ||
"chat": "JHipster public chat room", | ||
"follow": "Contacte @jhipster a Twitter" | ||
}, | ||
"like": "Si li agrada JHipster, no oblidi donar-nos una estrella", | ||
"github": "GitHub" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/cs/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "Vítejte, Java Hipster!", | ||
"subtitle": "Toto je vaše domovská stránka", | ||
"logged": { | ||
"message": "Jste přihlášen jako \"{{username}}\"." | ||
}, | ||
"question": "Pokud máte nějaké dotazy týkající se JHipster:", | ||
"link": { | ||
"homepage": "Domovská stránka JHipster", | ||
"stackoverflow": "JHipster ve službě Stack Overflow", | ||
"bugtracker": "Nahlašování chyb JHipster", | ||
"chat": "Veřejná chatovací místnost JHipster", | ||
"follow": "Sledovat @jhipster ve službě Twitter" | ||
}, | ||
"like": "Pokud se vám JHipster líbí, nezapomeňte nám dát hvězdičku ve službě", | ||
"github": "GitHub" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/da/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "Velkommen, Java Hipster!", | ||
"subtitle": "Dette er din startside", | ||
"logged": { | ||
"message": "Du er logget ind som bruger \"{{username}}\"." | ||
}, | ||
"question": "Hvis du har spørgsmål om JHipster:", | ||
"link": { | ||
"homepage": "JHipster homepage", | ||
"stackoverflow": "JHipster på Stack Overflow", | ||
"bugtracker": "JHipster bug tracker", | ||
"chat": "JHipster public chat room", | ||
"follow": "Kontakt @jhipster på Twitter" | ||
}, | ||
"like": "Hvis du kan lide JHipster, så husk at give os en stjerne på", | ||
"github": "GitHub" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/de/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "Willkommen, Java Hipster!", | ||
"subtitle": "Dies ist Ihre Hauptseite", | ||
"logged": { | ||
"message": "Sie sind als Benutzer \"{{username}}\" angemeldet." | ||
}, | ||
"question": "Wenn Sie Fragen zu JHipster haben:", | ||
"link": { | ||
"homepage": "JHipster Hauptseite", | ||
"stackoverflow": "JHipster auf Stack Overflow", | ||
"bugtracker": "JHipster Fehlereinträge", | ||
"chat": "JHipster Chat", | ||
"follow": "kontaktieren Sie uns mit @jhipster auf Twitter" | ||
}, | ||
"like": "Wenn Sie JHipster mögen, vergessen Sie nicht uns einen Stern zu geben auf", | ||
"github": "GitHub" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
generators/languages/templates/src/main/webapp/i18n/el/home.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"home": { | ||
"title": "Καλός όρισες, Java Hipster!", | ||
"subtitle": "Αυτή είναι η αρχική σου σελίδα", | ||
"logged": { | ||
"message": "Είστε συνδεμένος με τον χρηστη \"{{username}}\"." | ||
}, | ||
"question": "Αν έχετε ερωτήσεις σχετικά με το JHipster:", | ||
"link": { | ||
"homepage": "Αρχική σελίδα του JHipster", | ||
"stackoverflow": "Το JHipster στο Stack Overflow", | ||
"bugtracker": "JHipster bug tracker", | ||
"chat": "JHipster chat room για το κοινό", | ||
"follow": "Ακολουθείστε @jhipster στο Twitter" | ||
}, | ||
"like": "Άμα σας αρέσει το JHipster, μην ξεχάσετε να μας δώσετε ένα αστέρι", | ||
"github": "GitHub" | ||
} | ||
} |
Oops, something went wrong.