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
var createError = require('http-errors'); | |
var express = require('express'); | |
var path = require('path'); | |
var cookieParser = require('cookie-parser'); | |
var logger = require('morgan'); | |
var indexRouter = require('./routes/index'); | |
var usersRouter = require('./routes/users'); | |
var app = express(); |
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
i18next | |
.use(Backend) | |
.use(i18nextMiddleware.LanguageDetector) | |
.init({ | |
backend: { | |
loadPath: __dirname + '/locales/{{lng}}/{{ns}}.json', | |
}, | |
detection: { | |
order: ['querystring', 'cookie'], | |
caches: ['cookie'] |
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
application 'application' has | |
transport :kafka do | |
addresses: ['10.10.20.10', '10.10.20.11'] | |
credentials: '123123123' | |
end | |
architecture :eventide | |
collection 'accounts' with |
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
<div translate="john" [translateParams]="{applesCount: applesCount}">123</div> | |
<button [(ngModel)]='applesCount' (click)='applesCount=applesCount+1'>+</button> |
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
import { TranslateCompiler, TranslateModule } from '@ngx-translate/core'; | |
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; | |
@NgModule({ | |
imports: [ | |
... | |
TranslateModule.forRoot({ | |
compiler: { | |
provide: TranslateCompiler, | |
useClass: TranslateMessageFormatCompiler | |
}, |
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
{ | |
"welcomeScreen": { | |
"greeting": "Hello my dear friend {{name}}" | |
} | |
} |
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
<div translate="Menu"></div> | |
<div [translate]="'Menu'"></div> | |
<div translate [translateParams]="{value: 'world'}">greetings</div> |
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
greetings: string = ''; | |
constructor(private translateService: TranslateService) { | |
this.translateService.setTranslation('en', { | |
'about.header': 'About', | |
'about.greetings': 'Hello fellow translator {{name}}' | |
}); | |
this.translateService.get('about.greetings', {name: 'Roman'}).subscribe((res: string) => { | |
this.greetings = res; |
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
... | |
dark = false; | |
name = 'Roman'; | |
constructor( | |
... |