Skip to content

Commit

Permalink
Merge pull request #3 from gongalf/v4-translations
Browse files Browse the repository at this point in the history
V4 translations
  • Loading branch information
andalugeek authored Feb 4, 2025
2 parents 96c2743 + 6c03994 commit 09ff1d1
Show file tree
Hide file tree
Showing 83 changed files with 3,608 additions and 373 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="app_name">Paisaje Andalûh</string>
<string name="title_activity_main">Paisaje Andalûh</string>
<string name="app_name">Paisaje Andaluz</string>
<string name="title_activity_main">Paisaje Andaluz</string>
<string name="package_name">es.andaluh.paisaje</string>
<string name="custom_url_scheme">es.andaluh.paisaje</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-content class="main ion-padding">
<ion-img class="img" src="assets/images/coming-soon.svg"></ion-img>
<ion-text>Toabía andamô currando en la Bîtta de Âttibiá. Próççimamente Dîpponible.</ion-text>
<ion-text>{{ fieldAppMessages('activity_page_work_in_progress') }}</ion-text>
</ion-content>
<app-menu></app-menu>
2 changes: 2 additions & 0 deletions apps/mobile-mzima-client/src/app/activity/activity.page.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Location } from '@angular/common';
import { Component } from '@angular/core';
import { fieldAppMessages } from '@helpers';

@Component({
selector: 'app-activity',
templateUrl: 'activity.page.html',
styleUrls: ['activity.page.scss'],
})
export class ActivityPage {
public fieldAppMessages = fieldAppMessages;
constructor(private location: Location) {}

public back(): void {
Expand Down
14 changes: 14 additions & 0 deletions apps/mobile-mzima-client/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ const routes: Routes = [
loadChildren: () =>
import('./privacy-policy/privacy-policy.module').then((m) => m.PrivacyPolicyPageModule),
},
{
path: 'select-spelling-proposal',
loadChildren: () =>
import('./select-spelling-proposal/select-spelling-proposal.module').then(
(m) => m.SelectSpellingProposalPageModule,
),
},
{
path: 'walkthrough-select-spelling-proposal',
loadChildren: () =>
import(
'./walkthrough-select-spelling-proposal/walkthrough-select-spelling-proposal.module'
).then((m) => m.WalkthroughSelectSpellingProposalPageModule),
},
{
path: 'activity',
loadChildren: () => import('./activity/activity.module').then((m) => m.ActivityPageModule),
Expand Down
14 changes: 9 additions & 5 deletions apps/mobile-mzima-client/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { UploadFileHelper } from './post/helpers';
import { Location } from '@angular/common';
import { LanguageInterface } from '@mzima-client/sdk';
import { TranslateService } from '@ngx-translate/core';
import { fieldAppMessages } from '@helpers';

@UntilDestroy()
@Component({
Expand Down Expand Up @@ -123,7 +124,8 @@ export class AppComponent extends BaseComponent {
return this.collectionsService.getCollections(params).pipe(
tap(async (response) => {
await this.dataBaseService.set(STORAGE_KEYS.COLLECTIONS, response);
if (isToast) this.toastMessage$.next('Colêççionê âttualiçâh');
if (isToast)
this.toastMessage$.next(fieldAppMessages('app_component_get_collections_text'));
}),
);
}
Expand All @@ -138,14 +140,15 @@ export class AppComponent extends BaseComponent {
.pipe(
tap(async (response) => {
await this.dataBaseService.set(STORAGE_KEYS.SURVEYS, response.results);
if (isToast) this.toastMessage$.next('Datô de la Encuêtta Âttualiçaô');
if (isToast) this.toastMessage$.next(fieldAppMessages('app_component_get_surveys_text'));
}),
);
}

async checkPendingPosts(): Promise<boolean> {
const posts: any[] = await this.dataBaseService.get(STORAGE_KEYS.PENDING_POST_KEY);
if (posts?.length) this.toastMessage$.next('Publicaçionê pendientê encontrâh');
if (posts?.length)
this.toastMessage$.next(fieldAppMessages('app_component_check_pending_posts_text'));
return !!posts?.length;
}

Expand Down Expand Up @@ -173,7 +176,8 @@ export class AppComponent extends BaseComponent {

async checkPendingCollections(): Promise<boolean> {
const coll: any[] = await this.dataBaseService.get(STORAGE_KEYS.PENDING_COLLECTIONS);
if (coll?.length) this.toastMessage$.next('Âttualiçando la colêççión de publicaçionê...');
if (coll?.length)
this.toastMessage$.next(fieldAppMessages('app_component_check_pending_collections_text'));
return !!coll?.length;
}

Expand All @@ -190,7 +194,7 @@ export class AppComponent extends BaseComponent {
});
forkJoin(observables).subscribe({
next: async () => {
this.toastMessage$.next('Toâ lâ colêççionê pendientê fueron âttualiçâh');
this.toastMessage$.next(fieldAppMessages('app_component_upload_pending_collections_text'));
await this.dataBaseService.set(STORAGE_KEYS.PENDING_COLLECTIONS, []);
},
error: ({ error }) => {
Expand Down
8 changes: 6 additions & 2 deletions apps/mobile-mzima-client/src/app/auth/auth.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

<ion-tabs class="auth-tabs">
<ion-tab-bar slot="top" *ngIf="isSignupActive" selectedTab="login">
<ion-tab-button tab="login">Âççedêh</ion-tab-button>
<ion-tab-button tab="signup">Rehîttrarçe</ion-tab-button>
<ion-tab-button tab="login"
>{{ fieldAppMessages('auth_page_access_tab_button_tag') }}</ion-tab-button
>
<ion-tab-button tab="signup"
>{{ fieldAppMessages('auth_page_signup_tab_button_tag') }}</ion-tab-button
>
</ion-tab-bar>
</ion-tabs>
2 changes: 2 additions & 0 deletions apps/mobile-mzima-client/src/app/auth/auth.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Platform } from '@ionic/angular';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { SessionService, NetworkService, ToastService } from '@services';
import { fieldAppMessages } from '@helpers';

@UntilDestroy()
@Component({
Expand All @@ -13,6 +14,7 @@ import { SessionService, NetworkService, ToastService } from '@services';
export class AuthPage {
public isKeyboardOpen = false;
public isSignupActive = false;
public fieldAppMessages = fieldAppMessages;

constructor(
private platform: Platform,
Expand Down
39 changes: 21 additions & 18 deletions apps/mobile-mzima-client/src/app/auth/login/login.page.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<ion-content class="page ion-padding-vertical" [fullscreen]="true">
<div class="page-head ion-padding-horizontal ion-text-center ion-margin-bottom">
<ion-title class="page-title" *ngIf="!isPrivate; else loginToPrivateDeployment">
¡Te damô la biembenía!
{{ fieldAppMessages('login_signup_pages_welcome_text') }}
</ion-title>
<ng-template #loginToPrivateDeployment>
<ion-title class="page-title"> Âççedêh ar dêppliege pribao </ion-title>
<ion-title class="page-title">
{{ fieldAppMessages('login_page_login_to_private_deployment_title') }}
</ion-title>
<ion-text class="page-head__info">
Ar fabôh d'introduçîh tu uçuario y contraçeña pa âççedêh ar dêppliege. O contâtta al Admin
{{ fieldAppMessages('login_page_login_to_private_deployment_head_info') }}
<a href="mailto:{{ adminEmail }}">{{ adminEmail }}</a>
</ion-text>
</ng-template>
Expand All @@ -20,17 +22,17 @@
label="Email"
[required]="true"
formControlName="email"
placeholder="Mete tu correo elêttrónico"
[placeholder]="fieldAppMessages('signup_form_email_placeholder')"
[errors]="fieldErrorMessages(form.controls['email'], 'email')"
>
</app-form-control>
<app-form-control
type="password"
label="Contraçeña"
[label]="fieldAppMessages('signup_form_password_label')"
[required]="true"
[togglePassword]="true"
formControlName="password"
placeholder="Mete tu contraçeña"
[placeholder]="fieldAppMessages('signup_form_password_placeholder')"
[errors]="fieldErrorMessages(form.controls['password'], 'password')"
>
<div class="forgot-password-button" button>
Expand All @@ -40,7 +42,7 @@
expand="inline"
size="small"
>
¿Te ça orbiao la contraçeña?
{{ fieldAppMessages('login_page_forgot_password_button_tag') }}
</app-button>
</div>
</app-form-control>
Expand All @@ -50,15 +52,17 @@
</div>

<div class="bottom-panel">
<app-button type="submit" [disabled]="form.invalid || form.disabled"> Âççedêh </app-button>
<app-button type="submit" [disabled]="form.invalid || form.disabled">
{{ fieldAppMessages('login_page_access_button_tag') }}
</app-button>
<app-button
fill="clear"
color="medium"
routerLink="/"
*ngIf="!isPrivate; else cancelButton"
class="ion-margin-top"
>
Çartarçe êtto de momento
{{ fieldAppMessages('login_page_skip_button_tag') }}
</app-button>
<ng-template #cancelButton>
<app-button
Expand All @@ -67,7 +71,7 @@
class="ion-margin-top"
(buttonClick)="chooseDeployment()"
>
Cançelâh
{{ fieldAppMessages('login_page_cancel_button_tag') }}
</app-button>
</ng-template>
</div>
Expand All @@ -78,15 +82,14 @@
<app-modal
class="forgot-password-modal"
[isOpen]="isForgotPasswordModalOpen"
title="Recuperâh Contraçeña"
[title]="fieldAppMessages('login_page_forgot_password_modal_title')"
(modalClose)="forgotPasswordModalCloseHandle()"
>
<div class="forgot-password-modal__info">
<ion-text class="forgot-password-modal__title">¿Te çe orbió la contraçeña?</ion-text>
<p>
¡No te preocupê! Mete tu correo elêttrónico y reçibirâh un correo de la plataforma Ushahidi
con un enlaçe pa rêttableçêl-la.
</p>
<ion-text class="forgot-password-modal__title"
>{{ fieldAppMessages('login_page_forgot_password_modal_tag') }}</ion-text
>
<p>{{ fieldAppMessages('login_page_forgot_password_modal_content') }}</p>
</div>
<form
class="forgot-password-form"
Expand All @@ -100,7 +103,7 @@
label="Email"
[required]="true"
formControlName="email"
placeholder="Mete tu correo elêttrónico"
[placeholder]="fieldAppMessages('signup_form_email_placeholder')"
[errors]="fieldErrorMessages(form.controls['email'], 'email')"
>
</app-form-control>
Expand All @@ -118,7 +121,7 @@
type="submit"
[disabled]="forgotPasswordForm.invalid || forgotPasswordForm.disabled"
>
Rêttableçêh contraçeña
{{ fieldAppMessages('login_page_forgot_password_modal_button_tag') }}
</app-button>
</div>
</form>
Expand Down
8 changes: 4 additions & 4 deletions apps/mobile-mzima-client/src/app/auth/login/login.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FormBuilder, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { regexHelper } from '@helpers';
import { AlertService, AuthService, DeploymentService, SessionService } from '@services';
import { fieldErrorMessages } from '@helpers';
import { fieldErrorMessages, fieldAppMessages } from '@helpers';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';

@UntilDestroy()
Expand All @@ -23,6 +23,7 @@ export class LoginPage {
public isForgotPasswordModalOpen = false;
public loginError: string;
public forgotPasswordError: string;
public fieldAppMessages = fieldAppMessages;
public fieldErrorMessages = fieldErrorMessages;
public isPrivate = true;
public adminEmail = '';
Expand Down Expand Up @@ -71,9 +72,8 @@ export class LoginPage {
this.authService.resetPassword({ email }).subscribe({
next: async () => {
await this.alertService.presentAlert({
header: 'Mira en tu correo',
message:
"T'emo mandao un enlaçe de rêttableçimiento de contraçeña ar correo elêttrónico. Exa'r bîttaço y çige lâ indicaçionê.",
header: fieldAppMessages('login_page_forgot_password_alert_header'),
message: fieldAppMessages('login_page_forgot_password_alert_message'),
});
this.router.navigate(['auth/login']);
this.forgotPasswordForm.reset();
Expand Down
33 changes: 19 additions & 14 deletions apps/mobile-mzima-client/src/app/auth/signup/signup.page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<ion-content class="page ion-padding-vertical" [fullscreen]="true">
<ion-title class="page-title ion-text-center ion-margin-bottom">¡Te damô la biembenía"</ion-title>
<ion-title class="page-title ion-text-center ion-margin-bottom"
>{{ fieldAppMessages('login_signup_pages_welcome_text') }}</ion-title
>
<div class="main ion-padding-horizontal">
<app-deployment-info (deploymentClick)="chooseDeployment()"></app-deployment-info>
<form class="form" novalidate [formGroup]="form" (ngSubmit)="signUp()">
Expand All @@ -9,8 +11,8 @@
label="Nombre"
[required]="true"
formControlName="name"
placeholder="Mete tu nombre"
hint="Er nombre q'introdûccâ çe môttrará como informaçión del uçuario"
[placeholder]="fieldAppMessages('signup_form_name_placeholder')"
[hint]="fieldAppMessages('signup_form_name_hint')"
[errors]="fieldErrorMessages(form.controls['name'], 'name')"
>
</app-form-control>
Expand All @@ -19,19 +21,19 @@
label="Email"
[required]="true"
formControlName="email"
placeholder="Mete tu correo elêttrónico"
[placeholder]="fieldAppMessages('signup_form_email_placeholder')"
[errors]="fieldErrorMessages(form.controls['email'], 'email')"
>
</app-form-control>
<app-form-control
type="password"
label="Contraçeña"
[label]="fieldAppMessages('signup_form_password_label')"
[required]="true"
[togglePassword]="true"
formControlName="password"
placeholder="Mete contraçeña"
[placeholder]="fieldAppMessages('signup_form_password_placeholder')"
[errors]="fieldErrorMessages(form.controls['password'], 'password')"
[hint]="!form.controls['password'].value?.length ? 'La contraçeña debe tenêh como mínimo 8 carâtterê, una letra minúccula, una mayúccula, un número y un çímbolo.' : undefined"
[hint]="!form.controls['password'].value?.length ? fieldAppMessages('signup_form_password_hint') : undefined"
>
<app-password-strength
additional
Expand All @@ -43,11 +45,14 @@
</div>
<div class="agreement">
<app-checkbox formControlName="agreement">
Êtta aplicaçión a çío deçarroyá çobre Ushahidi Platform. Pa continuâh debê êttâh
d'acuerdo con çu
<a (click)="openLink($event, 'Privacy Policy')">Política de Pribaçiá</a>
y çû <br />
<a (click)="openLink($event, 'Privacy Policy')">Términô y Condiçionê</a>.
{{ fieldAppMessages('signup_page_privacy_policy_first_part') }}
<a (click)="openLink($event, 'Privacy Policy')"
>{{ fieldAppMessages('signup_page_privacy_policy_second_part') }}</a
>
{{ fieldAppMessages('signup_page_privacy_policy_third_part') }}<br />
<a (click)="openLink($event, 'Privacy Policy')"
>{{ fieldAppMessages('signup_page_privacy_policy_fourth_part') }}</a
>.
</app-checkbox>
</div>
<ion-text *ngIf="signupError?.length" class="form-error ion-text-center" color="danger">
Expand All @@ -60,10 +65,10 @@
type="submit"
[disabled]="form.invalid || form.disabled || !form.controls['agreement'].value"
>
Rehîttrarçe
{{ fieldAppMessages('signup_page_register_button_tag') }}
</app-button>
<app-button class="ion-margin-top" fill="clear" color="medium" routerLink="/">
Çartarçe êtto por aora
{{ fieldAppMessages('signup_page_skip_button_tag') }}
</app-button>
</div>
</form>
Expand Down
10 changes: 6 additions & 4 deletions apps/mobile-mzima-client/src/app/auth/signup/signup.page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { AbstractControl, FormBuilder, ValidatorFn, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { fieldErrorMessages, regexHelper } from '@helpers';
import { fieldErrorMessages, fieldAppMessages, regexHelper } from '@helpers';
import { generalHelpers } from '@mzima-client/sdk';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { AuthService, DeploymentService, SessionService } from '@services';
Expand All @@ -28,6 +28,7 @@ export class SignupPage {
agreement: [false, [Validators.required]],
});
public signupError: string;
public fieldAppMessages = fieldAppMessages;
public fieldErrorMessages = fieldErrorMessages;

constructor(
Expand Down Expand Up @@ -67,8 +68,9 @@ export class SignupPage {
error: ({ error }) => {
this.form.enable();

if (error.errors[1].message === 'êtte correo elêttrónico ya êttá en uço') {
this.signupError = error.errors[1].message;
if (error.errors[1].message === 'email ya está en uso') {
// this.signupError = error.errors[1].message;
this.signupError = fieldAppMessages('signup_page_email_exist_error_message');
this.checkExistEmailError(true);
setTimeout(() => {
this.checkExistEmailError(false);
Expand All @@ -92,7 +94,7 @@ export class SignupPage {
public openLink(event: Event, link: string): void {
event.preventDefault();
event.stopPropagation();
window.open(link);
console.log('open: ', link);
}

public chooseDeployment(): void {
Expand Down
Loading

0 comments on commit 09ff1d1

Please sign in to comment.