JHipster translation not found - jhipster

I created a brandnew jhipster project. In it I also created some entity components which I would like to reuse as nested component. When I create a new module and inside a new component and try to use the entity as nested component, the translation is not working:
I am using the entity component in the new module/component as follows (jhi-pet is the selector of the entity component):
<mat-card>
<h1>Main Content....</h1>
<jhi-pet></jhi-pet>
As seen in the picture the entity list gets displayed in the new component but translation does not work.
Another option would be link to the entity as a route (as follows)
{
path: 'pet', component: PetComponent
}
Same issue here. The entity list gets displayed but no translation.
If I go directly to the entity page like /pets then translation works...
Here is my jhipster configuration:
"generator-jhipster": {
"promptValues": {
"packageName": "com.rem.app",
"nativeLanguage": "tr"
},
"jhipsterVersion": "5.2.1",
"applicationType": "monolith",
"baseName": "REM",
"packageName": "com.rem.app",
"packageFolder": "com/rem/app",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": "elasticsearch",
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSwaggerCodegen": false,
"jwtSecretKey": "replaced-by-jhipster-info",
"clientFramework": "angularX",
"useSass": true,
"clientPackageManager": "yarn",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "tr",
"languages": [
"tr",
"en",
"de"
Any idea how I can use the proper translation?
Thank you for your help.

Found the answert!
In the new module which uses the entity as nested component add this to the constructor
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
this.languageHelper.language.subscribe((languageKey: string) => {
if (languageKey !== undefined) {
this.languageService.changeLanguage(languageKey);
}
});
}

Related

Unable to migrate link where Link of type System.LinkTypes.Hierarchy-Forward

I used Azure DevOps Migration Tools to migrate all types of a work items from two azure projects in the same organization
I search a lot and went through all documents but I not getting a robust solution on how to migrate parent-child link items to the destination project. I make the LinkMigrationSaveEachAsAdded flag true/false but it did not work.
My configuration file,
{
"Version": "12.0",
"LogLevel": "Verbose",
"workaroundForQuerySOAPBugEnabled": false,
"Source": {
"$type": "TfsTeamProjectConfig",
"Collection": "https://dev.azure.com/MyNameOrg/",
"Project": "SourceProject",
"ReflectedWorkItemIDFieldName": "TfsMigrationTool.ReflectedWorkItemId",
"AuthenticationMode": "AccessToken",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": "MyTokenHidden",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Target": {
"$type": "TfsTeamProjectConfig",
"Collection": "https://dev.azure.com/MyNameOrg/",
"Project": "DestinationProject",
"ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
"AuthenticationMode": "AccessToken",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": "MyTokenHidden",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"FieldMaps": [
{
"$type": "TreeToTagMapConfig",
"WorkItemTypeName": "*",
"toSkip": 3,
"timeTravel": 1
}
],
"WorkItemTypeDefinition": {
"sourceWorkItemTypeName": "targetWorkItemTypeName"
},
"GitRepoMapping": null,
"Processors": [
{
"$type": "WorkItemMigrationConfig",
"Enabled": true,
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"WIQLQueryBit": " AND [Custom.ReqID] contains 'CR' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
"WIQLOrderBit": "[System.ChangedDate] desc",
"LinkMigration": true,
"AttachmentMigration": true,
"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": false,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": false,
"PauseAfterEachWorkItem": false,
"AttachmentMaxSize": 480000000,
"AttachRevisionHistory": false,
"LinkMigrationSaveEachAsAdded": true,
"GenerateMigrationComment": false,
"WorkItemIDs": null,
"MaxRevisions": 0,
"NodeStructureEnricherEnabled": true,
"UseCommonNodeStructureEnricherConfig": false,
"NodeBasePaths": [],
"AreaMaps": {},
"IterationMaps": {},
"MaxGracefulFailures": 0
}
]
}
[SKIP] Unable to migrate link where Link of type System.LinkTypes.Hierarchy-Forward where wiSourceL=182, wiSourceR=222, wiTargetL=189, wiTargetR=222 as target WI has not been migrated #1335
Given the configuration file in question, it works for all types of migration such as parent to child, attachments such as pdf, images, docs, xls, etc.
The problem in the above file is on line
"WIQLQueryBit": " AND [Custom.ReqID] contains 'CR' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
Custom.ReqID field should be required in every epic, feature, user story, bug, and task and the field value should start with the words CR.

How can I resolve error - Invalid "extends" configuration value - could not require "tslint-angular"

I have angular 12 application. When i run ng lint--fix the linter is working.
In our company we use another library where we are having some reusable components.
When the version is 3.0.0 the linter is working.
When I set the version in my package.json file to 3.1.0 - because some bug fixes were done in mean time, I get error when i try to lint my application.
The error is:
[error] FatalError: Failed to load C:\xecm-test-two\xecm\xecm-webapp-angular\src\tslint.json: Invalid "extends" configuration value - could not require "tslint-angular". Review the Node lookup algorithm (https://nodejs.org/api/modules.html#modules_all_together) for the approximate method TSLint uses to find the referenced configuration file.
at new FatalError (C:\xecm-test-two\xecm\xecm-webapp-angular\node_modules\tslint\lib\error.js:28:28)
at Object.findConfiguration (C:\xecm-test-two\xecm\xecm-webapp-angular\node_modules\tslint\lib\configuration.js:58:15)
at _lint (C:\xecm-test-two\xecm\xecm-webapp-angular\node_modules\#angular-devkit\build-angular\src\tslint\index.js:151:40)
at _run (C:\xecm-test-two\xecm\xecm-webapp-angular\node_modules\#angular-devkit\build-angular\src\tslint\index.js:70:35)
So the folder structure is xecm-test-two => xecm => xecm-webapp-angular ( this is angular 12 app )
My tslint in src folder looks like this
{
"extends": "../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"xecm",
"camelCase"
],
"component-selector": [
true,
"element",
"xecm",
"kebab-case"
]
}
}
and the tsline.json file looks like this - this is the file which is extended
{
"extends": "company-linter-tslint/tslint",
"rules": {
"prettier": false,
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"ter-indent": [
true,
4,
{
"SwitchCase": 1
}
],
"indent": [
true,
"spaces",
4
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
250
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"no-output-on-prefix": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"max-classes-per-file": [true, 5]
}
}
I really can't understand why I get this error only after I increase some version of my company library.
How can I debug and find where is the error ?

Node, typeorm - I need to connect to Oracle without credentials

I am working with typeorm and Oracle with typescript, but I have the following problem when I want to connect.
Basically I want to use externalAuth but it tells me that the variable is read only, how can I solve it??
Cannot assign to 'externalAuth' because it is a read-only
import { DataSource } from "typeorm"
import { Empleado } from "./entity/Empleado"
import * as oracledb from "oracledb";
oracledb.externalAuth = true;
oracledb.initOracleClient({ libDir: 'C:\\instantclient_19_12' });
export const AppDataSource = new DataSource({
type: "oracle",
connectString: "xxxxx",
database: "xxxx",
synchronize: false,
logging: true,
entities: [Empleado],
migrations: [],
subscribers: [],
})```
From a quick test with the TypeORM sample app, setting externalAuth using the extra attribute in the project's ormconfig.json file like this seems to pass through the correct settings to node-oracledb:
{
"type": "oracle",
"connectString": "localhost/orclpdb1",
"synchronize": true,
"logging": false,
"extra" : {
"externalAuth": true
},
"entities": [
"src/entity/**/*.ts"
],
"migrations": [
"src/migration/**/*.ts"
],
"subscribers": [
"src/subscriber/**/*.ts"
],
"cli": {
"entitiesDir": "src/entity",
"migrationsDir": "src/migration",
"subscribersDir": "src/subscriber"
}
}

How to debug a TSLint error?

I'm using webstorm, and an Angular 2 app. Something has changed and it appears tslint doesn't like my tslint.json file.
TSLint: TypeError: Cannot read property '1' of undefined
I have no idea how to begin debugging it as the error isn't indicating (that i can see) where in the tslint file is the problem.
BTW, I've taken the default tslint file coming with the project, i haven't made any changes.
Is there a validation command i can run on my tslint file that will show me where errors are?
Node: 7.8
TSLint: 5.1
TSLINT BELOW:
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"import-blacklist": [true, "rxjs"],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
"static-before-instance",
"variables-before-functions"
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [true, "ignore-params"],
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"typeof-compare": true,
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [true, "attribute", "app", "camelCase"],
"component-selector": [true, "element", "app", "kebab-case"],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"no-access-missing-member": true,
"templates-use-public": true,
"invoke-injectable": true
}
}
You can run ng lint command on your terminal and it will exactly show you line in which line number of file it has this error . Also it depends on how you've set your package.json.
In node_modules/tslint/lib/linter.js find applyRule definition and replace line:
error_1.showWarningOnce("Warning: " + error.message);
with:
error_1.showWarningOnce("Warning: " + error.message + " " + error.stack);
I submitted the issue.

Connection timeout on Sublime Text 3 SFTP

I'm trying to map a local directory to a folder on my hosting provider, but I get a connection timeout error.
I've tried logging on from different ISP's, but I still get the same error. And I use these same credentials successfully in Filezilla.
Here is my config file:
{
// sftp, ftp or ftps
"type": "sftp",
"save_before_upload": true,
"upload_on_save": false,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "mydomain.com",
"user": "myusername",
"password": "mypassword",
// "port": "22",
"remote_path": "/",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}

Resources