diff --git a/apps/web-mzima-client/src/app/core/enums/icons.ts b/apps/web-mzima-client/src/app/core/enums/icons.ts
index 28bc3415fe..4c59be5e77 100644
--- a/apps/web-mzima-client/src/app/core/enums/icons.ts
+++ b/apps/web-mzima-client/src/app/core/enums/icons.ts
@@ -75,4 +75,5 @@ export enum Icons {
thumbUp = 'thumb-up',
ellipses = 'ellipses',
lock = 'lock',
+ translate = 'translate',
}
diff --git a/apps/web-mzima-client/src/app/core/services/event-bus.service.ts b/apps/web-mzima-client/src/app/core/services/event-bus.service.ts
index bd908a6542..0e2dc5e557 100644
--- a/apps/web-mzima-client/src/app/core/services/event-bus.service.ts
+++ b/apps/web-mzima-client/src/app/core/services/event-bus.service.ts
@@ -22,6 +22,7 @@ export const enum EventType {
RefreshSurveysCounters = 'REFRESH_SURVEYS_COUNTERS',
StopExportPolling = 'STOP_EXPORT_POLLING',
ExportDone = 'EXPORT_DONE',
+ DisplayTranslatedPost = 'DISPLAY_TRANSLATED_POST',
StatusChange = 'STATUS_CHANGE',
}
diff --git a/apps/web-mzima-client/src/app/core/services/language.service.ts b/apps/web-mzima-client/src/app/core/services/language.service.ts
index cbd54c874b..6ab674cfc5 100644
--- a/apps/web-mzima-client/src/app/core/services/language.service.ts
+++ b/apps/web-mzima-client/src/app/core/services/language.service.ts
@@ -4,6 +4,7 @@ import { TranslateService } from '@ngx-translate/core';
import { BehaviorSubject } from 'rxjs';
import { LanguageInterface } from '@mzima-client/sdk';
import LangJSON from '../../../assets/locales/languages.json';
+import entityLanguages from '../../../assets/locales/entity-languages.json';
import { SessionService } from './session.service';
@Injectable({
@@ -41,6 +42,9 @@ export class LanguageService {
private set initialLanguage(value: string) {
localStorage.setItem(this.languageKey, value);
}
+ getEntityLanguages() {
+ return entityLanguages;
+ }
getLanguages(): LanguageInterface[] {
if (LangJSON.languages && LangJSON.languages.length > 0) {
diff --git a/apps/web-mzima-client/src/app/post/post-details/post-details.component.html b/apps/web-mzima-client/src/app/post/post-details/post-details.component.html
index 67bfece381..0c1aae326f 100644
--- a/apps/web-mzima-client/src/app/post/post-details/post-details.component.html
+++ b/apps/web-mzima-client/src/app/post/post-details/post-details.component.html
@@ -17,28 +17,43 @@
[deleteable]="post.allowed_privileges.includes('delete')"
(statusChanged)="statusChangedHandle()"
(deleted)="deletedHandle()"
+ (openTranslationModal)="openTranslatePost()"
>
-
+
{{ post.form.description }}
+{{ post.form.translations[displayLanguage]?.description || post.form.description }}
-
{{ field.value.value || '-' }}
++ {{ + field.value.translations[displayLanguage]?.value || field.value.value || '-' + }} +
{{ field.value.value || '-' }}
+ {{
+ field.value.translations[displayLanguage]?.value || field.value.value || '-'
+ }}
{{ 'translations.available_languages' | translate }}
++ {{ 'translations.viewing_translated' | translate }} +
+