fix(i18n): load locales from file system, instead of http-backend

This commit is contained in:
Amruth Pillai
2022-03-05 10:08:28 +01:00
parent 7c73685759
commit a4983ac6bc
74 changed files with 105 additions and 142 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

View File

View File

View File

@ -19,9 +19,6 @@ import { User } from '@/users/entities/user.entity';
database: configService.get<string>('postgres.database'),
synchronize: true,
entities: [User, Resume],
ssl: {
ca: configService.get<string>('postgres.certificate'),
},
}),
}),
],

View File

@ -27,10 +27,12 @@ const bootstrap = async () => {
app.setViewEngine('hbs');
const configService = app.get(ConfigService);
const serverUrl = configService.get<number>('app.serverUrl');
const port = configService.get<number>('app.port');
await app.listen(port);
Logger.log(`🚀 Server is running on: http://localhost:${port}/${globalPrefix}`);
Logger.log(`🚀 Server is running on: ${serverUrl}/${globalPrefix}`);
};
bootstrap();

View File

@ -6,7 +6,7 @@ const sampleData: Partial<Resume> = {
email: 'alexis.jones@gmail.com',
phone: '+1 800 1200 3820',
photo: {
url: `${process.env.APP_URL}/images/sample-photo.jpg`,
url: `/images/sample-photo.jpg`,
filters: {
size: 128,
shape: 'rounded-square',

View File

@ -31,10 +31,9 @@ export class ResumeService {
async create(createResumeDto: CreateResumeDto, userId: number) {
try {
const user = await this.usersService.findById(userId);
const serverUrl = this.configService.get<string>('app.serverUrl');
const shortId = nanoid(SHORT_ID_LENGTH);
const image = `${serverUrl}/covers/${sample(covers)}`;
const image = `/images/covers/${sample(covers)}`;
const resume = this.resumeRepository.create({
...defaultState,
@ -67,10 +66,9 @@ export class ResumeService {
async import(importResumeDto: Partial<ResumeSchema>, userId: number) {
try {
const user = await this.usersService.findById(userId);
const serverUrl = this.configService.get<string>('app.serverUrl');
const shortId = nanoid(SHORT_ID_LENGTH);
const image = `${serverUrl}/covers/${sample(covers)}`;
const image = `/images/covers/${sample(covers)}`;
const resume = this.resumeRepository.create({
...defaultState,
@ -168,10 +166,9 @@ export class ResumeService {
async duplicate(id: number, userId: number) {
try {
const originalResume = await this.findOne(id, userId);
const serverUrl = this.configService.get<string>('app.serverUrl');
const shortId = nanoid(SHORT_ID_LENGTH);
const image = `${serverUrl}/covers/${sample(covers)}`;
const image = `/images/covers/${sample(covers)}`;
const duplicatedResume: Partial<Resume> = {
...pick(originalResume, ['name', 'slug', 'basics', 'metadata', 'sections', 'public']),