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 { HttpClient } from '@angular/common/http'; | |
import { | |
TRANSLOCO_LOADER, | |
Translation, | |
TranslocoLoader, | |
TRANSLOCO_CONFIG, | |
translocoConfig, | |
TranslocoModule | |
} from '@ngneat/transloco'; | |
import { Injectable, NgModule } from '@angular/core'; |
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
extends layout | |
block content | |
h1 Welcome to #{title} | |
p Welcome #{t("home.title")} | |
p It's a translation article application | |
a(href='?lng=en') English <br> | |
a(href='?lng=ru') Russian |
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
body { | |
padding: 50px; | |
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; | |
} | |
a { | |
color: #00B7FF; | |
} | |
table { |
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
extends layout | |
block content | |
h1 Welcome to #{title} | |
p Welcome #{t("home.title")} | |
p It's a translation article application | |
a(href='?lng=en') English <br> | |
a(href='?lng=ru') Russian | |
<br> |
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
app.use( | |
middleware.handle(i18next, { | |
ignoreRoutes: ["/foo"], // or function(req, res, options, i18next) { /* return true to ignore */ } | |
removeLngFromUrl: false | |
}) | |
); |
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
{ | |
"home": { | |
"title": "Book shop", | |
"total": "There are {{counter}} books in the list", | |
"buttonText": "Refresh button", | |
"buttonHTML": "<button onClick='window.location.reload();'>$t(buttonText)</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
{ | |
"home": { | |
"title": "Книжный магазин", | |
"total": "Всего в списке {{counter}} книг", | |
"buttonText": "Обновить страницу", | |
"buttonHTML": "<button onClick='window.location.reload();'>$t(buttonText)</button>", | |
}, | |
"Something for Nothing": "Кое что задаром", | |
"Harry Potter and the Philosopher's Stone": "Гарри Поттер и Философский камень" | |
} |
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 express = require('express'); | |
var router = express.Router(); | |
const IndexContoller = require('../controllers/index_controller'); | |
/* GET home page. */ | |
router.get('/', IndexContoller.list); | |
module.exports = router; |
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
extends layout | |
block content | |
h1 Welcome to #{title} | |
p It's a translation article application |
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 express = require('express'); | |
var router = express.Router(); | |
const i18next = require('i18next'); | |
class IndexController { | |
static list(req, res, next) { | |
res.render('index', { title: 'Express'}); | |
} | |
} |