diff --git a/database/readme.txt b/database/readme.txt
new file mode 100644
index 0000000..a932bed
--- /dev/null
+++ b/database/readme.txt
@@ -0,0 +1 @@
+Postal codes is pulled from https://download.geonames.org/export/zip/
\ No newline at end of file
diff --git a/src/Client/angular.json b/src/Client/angular.json
index c593301..8f7203e 100644
--- a/src/Client/angular.json
+++ b/src/Client/angular.json
@@ -19,7 +19,7 @@
"assets": [
{
"glob": "**/*",
- "input": "public"
+ "input": "src/assets"
}
],
"styles": [
diff --git a/src/Client/src/app/app.ts b/src/Client/src/app/app.ts
index 5048ec6..96bd7ad 100644
--- a/src/Client/src/app/app.ts
+++ b/src/Client/src/app/app.ts
@@ -4,6 +4,7 @@ import { Authentication } from './services/Authentication';
import { CommonModule, Location } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { isDevMode } from '@angular/core';
+import { TranslationService } from './services/translations';
@Component({
selector: 'app-root',
@@ -16,7 +17,8 @@ export class App {
devMode: boolean = false;
loginToken: string | null = null;
- constructor( private http: HttpClient, public auth: Authentication, private router: Router, private route: ActivatedRoute, private location: Location){
+ constructor( private http: HttpClient, public auth: Authentication, private router: Router, private route: ActivatedRoute, private location: Location, public strings: TranslationService){
+ strings.setLanguage("en");
this.devMode = isDevMode();
this.route.queryParams.subscribe(params => {
this.loginToken = params['LoginToken'];
diff --git a/src/Client/src/app/pages/applicationviewer/appviewer.component.html b/src/Client/src/app/pages/applicationviewer/appviewer.component.html
index 487c6ff..8fbcf0d 100644
--- a/src/Client/src/app/pages/applicationviewer/appviewer.component.html
+++ b/src/Client/src/app/pages/applicationviewer/appviewer.component.html
@@ -7,9 +7,9 @@
{{ application.rating }}
{{ application.responseStatus }}
- Date Applied:
{{ application.dateApplied }}
+ {{ strings.translate("application/viewer", "s Date Applied") }}
{{ application.dateApplied }}
-
+
}
\ No newline at end of file
diff --git a/src/Client/src/app/pages/applicationviewer/appviewer.component.ts b/src/Client/src/app/pages/applicationviewer/appviewer.component.ts
index 6de59ae..5607a9e 100644
--- a/src/Client/src/app/pages/applicationviewer/appviewer.component.ts
+++ b/src/Client/src/app/pages/applicationviewer/appviewer.component.ts
@@ -6,6 +6,7 @@ import { Title } from '@angular/platform-browser';
import { CommonModule } from '@angular/common';
import { Authentication } from 'app/services/Authentication';
import { Application } from 'app/models/Application';
+import { TranslationService } from 'app/services/translations';
@Component({
selector: 'App-Viewer',
@@ -18,7 +19,7 @@ export class AppViewerComponent {
public List: Application[] = [];
- constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
+ constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication, public strings: TranslationService ) {
this.title.setTitle("Applications | BoredCareers");
if (!auth.isLoggedIn){
router.navigate(["/"]);
diff --git a/src/Client/src/app/pages/company/company.component.html b/src/Client/src/app/pages/company/company.component.html
index a22e49b..456916f 100644
--- a/src/Client/src/app/pages/company/company.component.html
+++ b/src/Client/src/app/pages/company/company.component.html
@@ -46,7 +46,7 @@
{{ listing.title }}
-
+
diff --git a/src/Client/src/app/pages/home/home.component.html b/src/Client/src/app/pages/home/home.component.html
index fa7c930..60d5e6e 100644
--- a/src/Client/src/app/pages/home/home.component.html
+++ b/src/Client/src/app/pages/home/home.component.html
@@ -2,7 +2,7 @@
Bored Careers
- The Anti-AI Job Board
+ {{ strings.translate("home", "s subTitle") }}
diff --git a/src/Client/src/app/pages/home/home.component.ts b/src/Client/src/app/pages/home/home.component.ts
index 478962e..db8136c 100644
--- a/src/Client/src/app/pages/home/home.component.ts
+++ b/src/Client/src/app/pages/home/home.component.ts
@@ -4,6 +4,8 @@ import { FormsModule } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
import { Title } from '@angular/platform-browser';
import { CommonModule } from '@angular/common';
+import { TranslationService } from 'app/services/translations';
+import { Observable } from 'rxjs';
@Component({
selector: 'main-home',
@@ -13,8 +15,12 @@ import { CommonModule } from '@angular/common';
})
export class HomeComponent {
- constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title ) {
+ Loaded$: Observable;
+
+ constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public strings: TranslationService ) {
this.title.setTitle("Home | BoredCareers");
+ this.Loaded$ = this.strings.changed$;
+
};
}
\ No newline at end of file
diff --git a/src/Client/src/app/services/translations.ts b/src/Client/src/app/services/translations.ts
new file mode 100644
index 0000000..b3b82e8
--- /dev/null
+++ b/src/Client/src/app/services/translations.ts
@@ -0,0 +1,38 @@
+import { Injectable } from '@angular/core';
+import { HttpClient, HttpErrorResponse } from '@angular/common/http';
+import { BehaviorSubject, firstValueFrom, Observable } from 'rxjs';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class TranslationService {
+
+ private _translations: any = {};
+ private _translationsLoaded: BehaviorSubject = new BehaviorSubject(false);
+
+ constructor(private http: HttpClient) {}
+
+ // Change language dynamically
+ setLanguage(lang: string) {
+ this.http.get(`/lang/${lang}.json`).subscribe({
+ next: data => {
+ this._translations = data;
+ this._translationsLoaded.next(true);
+ },
+ error: err => {
+ this._translations = [];
+ this._translationsLoaded.next(true);
+ }
+ })
+ }
+
+ // Observable for checking if language is loaded
+ get changed$(): Observable {
+ return this._translationsLoaded.asObservable();
+ }
+
+ // Get a specific translation
+ translate(page: string, key: string): string {
+ return this._translations[page][key] || key;
+ }
+}
\ No newline at end of file
diff --git a/src/Client/src/assets/lang/en.json b/src/Client/src/assets/lang/en.json
new file mode 100644
index 0000000..840e6fc
--- /dev/null
+++ b/src/Client/src/assets/lang/en.json
@@ -0,0 +1,16 @@
+{
+ "home": {
+ "s subTitle": "The Anti AI Job Board",
+ "emailPlaceholder": "Enter your email",
+ "passwordPlaceholder": "Enter your password",
+ "loginButton": "Login"
+ },
+ "application/viewer": {
+ "s Date Applied": "Date Applied: ",
+ "b View Resume": "VIEW RESUME"
+ },
+ "profile": {
+ "pageTitle": "Your Profile",
+ "editButton": "Edit Profile"
+ }
+}
\ No newline at end of file