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.

adding new language support with Angular2

See original GitHub issue
Overview of the issue

I added support for a new lasnguage - kannada by doing the following steps ~

1Duplicate the src/main/webapp/i18/en folder to src/main/webapp/i18/new_lang (this is where all the front-end translations are stored) 2Translate all files under the folder src/main/webapp/i18/new_lang 3Add the language code new_lang to the LANGUAGES constant defined in src/main/webapp/app/components/language/language.constants.js 4 In the src/main/resources/i18n folder, copy the messages_en.properties file to messages_new_lang.properties (this is where the server-side translations are stored) 5 Translate all keys in the messages_new_lang.properties file 6. Add the new language’s name in the function of filter(‘findLanguageFromKey’) in the src/main/webapp/app/components/language/language.filter.js file But on cleaning and running the app - it is showing a blank screen ; server console is showing no errors;

Motivation for or Use Case

Adding a new language is an important thing = i was trying to add kannada - i found other languages from India - bangalore is the IT capital of India and Kannada is spoken here - but kannada does not find mention in the Jhipster list -

Reproduce the error
Related issues

How do i add kannada to the Jhipster list ?

Suggest a Fix

Add kannada also in the Jhipster list when choosing the language ~ or tell me i shall do it myself .

JHipster Version(s)

jhip 4.0

JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
    {
        "fieldId": 4,
        "fieldName": "costOfCycle",
        "fieldType": "Float",
        "fieldValidateRules": [
            "required"
        ]
    },
    {
        "fieldId": 5,
        "fieldName": "insuranceNo",
        "fieldType": "String",
        "fieldValidateRules": [
            "required"
        ]
    },
            {
        "fieldId": 6,
        "fieldName": "moveStatus",
        "fieldType": "Integer",
        "fieldValidateRules": [
            "required"
        ]
    },
            {
        "fieldId": 7,
        "fieldName": "insuranceStatus",
        "fieldType": "Integer",
        "fieldValidateRules": [
            "required"
        ]
    }



],
"changelogDate": "20170223163335",
"dto": "no",
"service": "serviceImpl",
"entityTableName": "bicycle",
"pagination": "pagination"

}


Employee.json

```yaml
{
    "fluentMethods": true,
    "relationships": [],
    "fields": [
        {
            "fieldName": "name",
            "fieldType": "String",
            "fieldValidateRules": [
                "required",
                "minlength",
                "maxlength"
            ],
            "fieldValidateRulesMinlength": "3",
            "fieldValidateRulesMaxlength": "10"
        },
        {
            "fieldName": "age",
            "fieldType": "Integer",
            "fieldValidateRules": [
                "required"
            ]
        }
    ],
    "changelogDate": "20170222114635",
    "dto": "no",
    "service": "serviceImpl",
    "entityTableName": "employee",
    "pagination": "pagination"
}

MemberMobile.json

{
    "fluentMethods": true,
    "relationships": [],

    "fields": [
        {
            "fieldId": 1,
            "fieldName": "firstName",
            "fieldType": "String",
            "fieldValidateRules": [
                "required"
            ]
        },
        {
            "fieldId": 2,
            "fieldName": "lastName",
            "fieldType": "String",
             "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 3,
            "fieldName": "dateOfBirth",
            "fieldType": "LocalDate",
            "fieldValidateRules": [
                "required"
            ]
        },
        {
            "fieldId": 4,
            "fieldName": "emailId",
            "fieldType": "String",
              "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 5,
            "fieldName": "mobileNo",
            "fieldType": "String",
             "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 6,
            "fieldName": "address1",
            "fieldType": "String",
              "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 7,
            "fieldName": "address2",
            "fieldType": "String",
              "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 8,
            "fieldName": "city",
            "fieldType": "String",
             "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 9,
            "fieldName": "state",
            "fieldType": "String",
              "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 10,
            "fieldName": "zipcode",
            "fieldType": "String",
            "fieldValidateRules": [
                "required"
            ]
        },
        {
            "fieldId": 11,
            "fieldName": "country",
            "fieldType": "String",
            "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 12,
            "fieldName": "photo",
            "fieldType": "byte[]",
            "fieldTypeBlobContent": "image",
            "fieldValidateRules": [

            ]
        },
          {
            "fieldId": 12,
            "fieldName": "photoIDProof",
            "fieldType": "byte[]",
            "fieldTypeBlobContent": "image",
            "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 13,
            "fieldName": "myCurrentRentUnits",
            "fieldType": "Integer",
            "fieldTypeBlobContent": "image",
            "fieldValidateRules": [

            ]
        },

        {
            "fieldId": 14,
            "fieldName": "myChargedRentUnits",
            "fieldType": "Integer",
            "fieldTypeBlobContent": "image",
            "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 15,
            "fieldName": "behaviorStatus",
            "fieldType": "Integer",
            "fieldTypeBlobContent": "image",
            "fieldValidateRules": [

            ]
        },

        {
            "fieldId": 16,
            "fieldName": "myCurrentFineCharges",
            "fieldType": "Integer",
            "fieldTypeBlobContent": "image",
            "fieldValidateRules": [

            ]
        } ,

         {
            "fieldId": 17,
            "fieldName": "dateOfExpiration",
            "fieldType": "LocalDate",
            "fieldValidateRules": [

            ]
        },

         {
            "fieldId": 18,
            "fieldName": "userName",
            "fieldType": "String",
              "fieldValidateRules": [

            ]
        },
        {
            "fieldId": 19,
            "fieldName": "passWord",
            "fieldType": "String",
            "fieldValidateRules": [

            ]
        } ,
                  {
            "fieldId": 20,
            "fieldName": "activated",
            "fieldType": "Boolean",
            "fieldValidateRules": [

            ]
        }



    ],
    "changelogDate": "20170223164859",
    "dto": "no",
    "service": "serviceImpl",
    "entityTableName": "member_mobile",
    "pagination": "infinite-scroll"
}

Browsers and Operating System

java version “1.8.0_102” Java™ SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot™ 64-Bit Server VM (build 25.102-b14, mixed mode)

git version 2.11.1.windows.1

node: v6.9.5

npm: 3.10.10

yeoman: 1.8.5

yarn: 0.20.3

C:\jho>kk.txt

C:\jho>

Browsers and Operating System

CHROME AND FIREFOX

  • [ X ] Checking this box is mandatory (this is just to show you read everything)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pascalgrimaudcommented, Feb 24, 2017

I generated a new app:

  • launch: ./mvnw
  • launch: yarn start
  • go to http://localhost:8080 -> OK
  • launch: yo jhipster:languages
  • add a new one
  • go back to http://localhost:8080 -> OK, the new language is here

So, the sub generator languages works (that’s what I wanted to check)

Then it seems you wanted to add locally a new language. Did you launch yarn start or at least yarn run webpack:build after creating all your new files ?

0reactions
pascalgrimaudcommented, Feb 24, 2017

Oh ok, thanks @deepu105 I didn’t look in details your PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add multi-language support to Angular | Creative Bloq
Open up 'app.component.ts'. Import 'Inject', 'LOCALE_ID' and 'HostBinding' from ''@angular/core''. Then set up the 'HostBinding ...
Read more >
HOW TO IMPLEMENT MULTILANGUAGE SUPPORT IN AN ...
1) Create an Angular Application · 2) Installing ngx-translate package · 3) Creating translation files · 4) Making required changes in other files....
Read more >
Angular Language Service
The Angular Language Service provides code editors with a way to get completions, errors, hints, and navigation inside Angular templates.
Read more >
Implementing multi-language Angular applications rendered ...
This article will teach you what you need to know to successfully implement multi-language Angular applications rendered server-side.
Read more >
Angular 2 - Multilingual Support - Stack Overflow
2 Answers 2 · 1. Install via npm npm install @ngx-translate/core --save · 2. Add TranslateModule in app.module.ts imports import {TranslateModule} from '@ngx- ......
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