Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Angular/src/app/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,44 @@ export class DataService {
});
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods will be updated over the weekend to actually implement reading from PO files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakobh7 Nice, would the PO files stored at the frontend or have to make a request from RESTful API?
kobh7 Do we need to think about what default values for those strings are? Could be English for example or leave it blank?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PO files on the front end shouldn't have to make requests to the RESTful API. I was thinking the default values for the strings would be English, but that's just because that's the common language we're writing in currently.

getLanguageListHeader(){
return "Language List";
}
getLanguageListAddLanguage(){
return "Add a New Language";
}
getLanguageAddHeaderWord(){
return "Add A Language";
}
getLanguageAddPlaceholderWord(){
return "Language Name";
}
getParadigmListHeaderWord(){
return "Paradigm List";
}
getParadigmListNewParadigmWord(){
return "Add a New Paradigm";
}
getParadigmAddHeaderWord(){
return "Add New Paradigm";
}
getParadigmAddParadigmNamePlaceholderWord(){
return "Paradigm Name";
}
getParadigmAddInputPlaceholderWord(){
return "Slot list separated by commas e.g. slot1,slot2,slot3"
}
getParadigmEditHeaderOneWord(){
return "Root Words";
}
getParadigmEditHeaderTwoWord(){
return "Word Forms";
}
getParadigmEditHeaderThreeWord(){
return "Paradigm Forms";
}
getParadigmEditAddRootWord(){
return "Add a New Root";
}

}
6 changes: 3 additions & 3 deletions Angular/src/app/language-add/language-add.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<i class="material-icons">arrow_back</i>
</button>

<h1> Add A Language </h1>
<input class ="input-text" [(ngModel)]="languageName" placeholder="Language Name">
<h1> {{getHeaderWord()}} </h1>
<input class ="input-text" [(ngModel)]="languageName" placeholder={{getPlaceholderWord()}}>
<a routerLink=".." (click)="addLanguage()" title="Add Language '{{languageName}}'">
<i class="material-icons">add_circle_outline</i>
</a>
</a>
7 changes: 7 additions & 0 deletions Angular/src/app/language-add/language-add.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export class LanguageAddComponent implements OnInit {
);
}

getHeaderWord(){
return this.data.getLanguageAddHeaderWord();
}
getPlaceholderWord(){
return this.data.getLanguageAddPlaceholderWord();
}

goBack(): void {
this.location.back();
}
Expand Down
6 changes: 3 additions & 3 deletions Angular/src/app/language-list/language-list.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>Language List</h1>
<h1>{{getHeader()}}</h1>

<ul>
<li *ngFor="let language of languages$ ">
Expand All @@ -7,7 +7,7 @@ <h1>Language List</h1>
<li>
<a routerLink="/language-add">
<i class="material-icons">add_circle_outline</i>
Add a New Language
{{getAddLanguage()}}
</a>
</li>
</ul>
</ul>
7 changes: 7 additions & 0 deletions Angular/src/app/language-list/language-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ export class LanguageListComponent implements OnInit {
data => this.languages$ = data["languages"]
);
}

getHeader(){
return this.data.getLanguageListHeader();
}
getAddLanguage(){
return this.data.getLanguageListAddLanguage();
}
}
8 changes: 4 additions & 4 deletions Angular/src/app/paradigm-add/paradigm-add.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
</button>

<h1>
Add New Paradigm
{{getHeaderWord()}}
</h1>


<div class="mat-card">

<div class="mat-card-title">
<mat-form-field>
<input matInput placeholder="Paradigm Name" [(ngModel)]="paradigmName">
<input matInput placeholder={{getParadigmNamePlaceholderWord()}} [(ngModel)]="paradigmName">
</mat-form-field>
</div>
<div class="mat-card-content">
<mat-form-field>
<input matInput placeholder="Slot list separated by commas e.g. slot1,slot2,slot3" [(ngModel)]="slotRawList">
<input matInput placeholder={{getInputPlaceholderWord()}} [(ngModel)]="slotRawList">
</mat-form-field>
</div>

Expand All @@ -26,4 +26,4 @@ <h1>
</button>
</div>

</div>
</div>
14 changes: 12 additions & 2 deletions Angular/src/app/paradigm-add/paradigm-add.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export class ParadigmAddComponent implements OnInit {
paradigmName: string;
slotRawList: string;
constructor(
private data: DataService,
private router: Router,
private data: DataService,
private router: Router,
private location: Location
) {}

Expand All @@ -30,4 +30,14 @@ export class ParadigmAddComponent implements OnInit {
goBack(): void {
this.location.back();
}

getHeaderWord(){
return this.data.getParadigmAddHeaderWord();
}
getParadigmNamePlaceholderWord(){
return this.data.getParadigmAddParadigmNamePlaceholderWord();
}
getInputPlaceholderWord(){
return this.data.getParadigmAddInputPlaceholderWord();
}
}
21 changes: 10 additions & 11 deletions Angular/src/app/paradigm-edit/paradigm-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ <h1>
</h1>

<div class="column-container">
<div class="root-column">
<h2> Root Words </h2>
<div class="root-column">
<h2> {{getHeaderOneWord()}} </h2>
<ul>
<li *ngFor="let root of roots$; let index = index" class="root-item-container">
<div (click)="onSelect(index)" class="root-item clickable-cursor">
<a>{{ root }}</a>
</div>
<a>{{ root }}</a>
</div>
<div (click)="deleteWord(index)" class="root-delete">
<a>
<i class="material-icons">delete</i>
Expand All @@ -31,17 +31,17 @@ <h2> Root Words </h2>
</li>
<li>
<a (click)="onSelectNew()" class="clickable-cursor">
<i class="material-icons">add_circle_outline</i>
Add a New Root
<i class="material-icons">add_circle_outline</i>
{{getAddRootWord()}}
</a>
</li>
</ul>
</div>
<div class="forms-column">
<div class="forms-column">
<div class="column-container">
<div class="word-column"><h2> Word Forms </h2></div>
<div class="word-column"><h2> {{getHeaderTwoWord()}} </h2></div>
<div class="paradigm-column column-container">
<h2 class = "two-column"> Paradigm Forms </h2>
<h2 class = "two-column"> {{getHeaderThreeWord()}} </h2>
<div class="right-align">
<button (click)="onSave()" class="button" title="Save Word">
<i class="material-icons">save</i>
Expand All @@ -52,11 +52,10 @@ <h2 class = "two-column"> Paradigm Forms </h2>
<div>
<ul>
<li *ngFor="let slot of slots$; let index = index" class="column-container">
<input class ="input-text word-column" [(ngModel)]="forms$[slot]" placeholder="{{forms$[slot]}}">
<input class ="input-text word-column" [(ngModel)]="forms$[slot]" placeholder="{{forms$[slot]}}">
<a class="paradigm-column">{{ slot }}</a>
</li>
</ul>
</div>
</div>
</div>

15 changes: 14 additions & 1 deletion Angular/src/app/paradigm-edit/paradigm-edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ParadigmEditComponent implements OnInit {
this.forms$ = [];
this.roots$ = [];
}

getParadigmSlots(): void{
this.data.getParadigmSlots(this.paradigm_name).subscribe(
data => this.slots$ = data["paradigm_slots"]);
Expand Down Expand Up @@ -93,4 +93,17 @@ export class ParadigmEditComponent implements OnInit {
this.data.deleteParadigm(this.paradigm_name).subscribe();
}
}

getHeaderOneWord(){
return this.data.getParadigmEditHeaderOneWord();
}
getHeaderTwoWord(){
return this.data.getParadigmEditHeaderTwoWord();
}
getHeaderThreeWord(){
return this.data.getParadigmEditHeaderThreeWord();
}
getAddRootWord(){
return this.data.getParadigmEditAddRootWord();
}
}
4 changes: 2 additions & 2 deletions Angular/src/app/paradigm-list/paradigm-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
</div>

<h1> {{language_name}}: Paradigm List </h1>
<h1> {{language_name}}: {{getHeaderWord()}} </h1>

<ul>
<li *ngFor="let paradigm of paradigms$">
Expand All @@ -28,7 +28,7 @@ <h1> {{language_name}}: Paradigm List </h1>
<li>
<a routerLink="./paradigm-add">
<i class="material-icons">add_circle_outline</i>
Add a New Paradigm
{{getNewParadigmWord()}}
</a>
</li>
</ul>
9 changes: 8 additions & 1 deletion Angular/src/app/paradigm-list/paradigm-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export class ParadigmListComponent implements OnInit {
this.location.back();
}

getHeaderWord(){
return this.data.getParadigmListHeaderWord();
}
getNewParadigmWord(){
return this.data.getParadigmListNewParadigmWord();
}

deleteLanguage(){
if (confirm("Are you sure you want to delete language: " + this.language_name + "?")){
this.data.deleteLanguage(this.language_name).subscribe();
Expand All @@ -45,7 +52,7 @@ export class ParadigmListComponent implements OnInit {
var fileContents= data;
this.saveTextAsFile(fileContents, this.language_name + ".aff");
x.style.display = "none";
});
});
}

// code adapted from https://codepen.io/sandeep821/pen/JKaYZq
Expand Down