From e02dc6896d36c4c810b9f232cc37d01d165af7e2 Mon Sep 17 00:00:00 2001 From: khalifan-kfan Date: Tue, 2 Jan 2024 18:03:59 +0300 Subject: [PATCH 1/8] add translations module --- .../dashboard/src/app/app.component.ts | 8 +- .../dashboard/src/app/app.routes.ts | 4 + .../edit/translations-edit.component.html | 5 + .../edit/translations-edit.component.scss | 0 .../edit/translations-edit.component.spec.ts | 21 ++++ .../pages/edit/translations-edit.component.ts | 48 ++++++++ .../pages/home/translations.page.html | 5 + .../pages/home/translations.page.scss | 14 +++ .../pages/home/translations.page.spec.ts | 22 ++++ .../pages/home/translations.page.ts | 22 ++++ .../translations/translations.module.ts | 28 +++++ .../translations/translations.service.ts | 113 ++++++++++++++++++ libs/webcomponents/package.json | 16 +-- yarn.lock | 2 +- 14 files changed, 295 insertions(+), 13 deletions(-) create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.spec.ts create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.spec.ts create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/translations.module.ts create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts diff --git a/apps/picsa-apps/dashboard/src/app/app.component.ts b/apps/picsa-apps/dashboard/src/app/app.component.ts index 20d61aaf4..976da1c88 100644 --- a/apps/picsa-apps/dashboard/src/app/app.component.ts +++ b/apps/picsa-apps/dashboard/src/app/app.component.ts @@ -42,10 +42,10 @@ export class AppComponent implements AfterViewInit { // label: 'Monitoring Forms', // href: '/monitoring-forms', // }, - // { - // label: 'Translations', - // href: '/translations', - // }, + { + label: 'Translations', + href: '/translations', + }, ]; globalLinks: INavLink[] = [ diff --git a/apps/picsa-apps/dashboard/src/app/app.routes.ts b/apps/picsa-apps/dashboard/src/app/app.routes.ts index 3245ea90c..a9ece7996 100644 --- a/apps/picsa-apps/dashboard/src/app/app.routes.ts +++ b/apps/picsa-apps/dashboard/src/app/app.routes.ts @@ -9,4 +9,8 @@ export const appRoutes: Route[] = [ path: 'climate-data', loadChildren: () => import('./modules/climate-data/climate-data.module').then((m) => m.ClimateDataModule), }, + { + path: 'translations', + loadChildren: () => import('./modules/translations/translations.module').then((m) => m.TranslationsPageModule), + }, ]; diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html new file mode 100644 index 000000000..0f255fe6e --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html @@ -0,0 +1,5 @@ +
+

Edit Translations

+ + +
diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.spec.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.spec.ts new file mode 100644 index 000000000..874da4764 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { TranslationsEditComponent } from './translations-edit.component'; + +describe('TranslationsEditComponent', () => { + let component: TranslationsEditComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [TranslationsEditComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(TranslationsEditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts new file mode 100644 index 000000000..e2020b8ed --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts @@ -0,0 +1,48 @@ +import { CommonModule } from '@angular/common'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; +// eslint-disable-next-line @nx/enforce-module-boundaries +import type { Database } from '@picsa/server-types'; +import { PICSAFormValidators } from '@picsa/shared/modules/forms/validators'; +//import { +// IUploadResult, +// SupabaseStoragePickerDirective, +// SupabaseUploadComponent, +// } from '@picsa/shared/services/core/supabase'; +// import { IStorageEntry } from '@picsa/shared/services/core/supabase/services/supabase-storage.service'; + +// import { DashboardMaterialModule } from '../../../../material.module'; +// import { DashboardResourcesStorageLinkComponent } from '../../components/storage-link/storage-link.component'; +// import { ResourcesDashboardService } from '../../translations.service'; + +// type IResourceEntry = Database['public']['Tables']['resources']['Row']; + +@Component({ + selector: 'dashboard-resource-create', + standalone: true, + imports: [ + CommonModule, + // DashboardMaterialModule, + // DashboardResourcesStorageLinkComponent, + // FormsModule, + // ReactiveFormsModule, + // SupabaseStoragePickerDirective, + // SupabaseUploadComponent, + ], + templateUrl: './translations-edit.component.html', + styleUrls: ['./translations-edit.component.scss'], +}) +export class TranslationsEditComponent { + constructor( + // private service: ResourcesDashboardService, + private route: ActivatedRoute + ) {} + + + + + + + +} diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html new file mode 100644 index 000000000..ca08f6a58 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html @@ -0,0 +1,5 @@ +
+
+

Translations

+
+
diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss new file mode 100644 index 000000000..05bb98ef7 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss @@ -0,0 +1,14 @@ +table.resources-table { + max-height: 50vh; + display: block; + overflow: auto; +} +tr.resource-row { + cursor: pointer; + &:hover { + background: whitesmoke; + } +} +th { + font-weight: bold; +} diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.spec.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.spec.ts new file mode 100644 index 000000000..f0e220f52 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TranslationsPageComponent } from './translations.page'; + +describe('TranslationsPageComponent', () => { + let component: TranslationsPageComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [TranslationsPageComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(TranslationsPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts new file mode 100644 index 000000000..ea99e6041 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts @@ -0,0 +1,22 @@ +import { CommonModule } from '@angular/common'; +import { Component, OnInit } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { DashboardMaterialModule } from '../../../../material.module'; +// import { DashboardResourcesStorageLinkComponent } from '../../components'; +import { ResourcesDashboardService } from '../../translations.service'; + +@Component({ + selector: 'dashboard-resources-page', + standalone: true, + imports: [CommonModule, DashboardMaterialModule, RouterModule], + templateUrl: './translations.page.html', + styleUrls: ['./translations.page.scss'], +}) +export class TranslationsPageComponent implements OnInit { + //public displayedColumns = ['title', 'storage_file']; + constructor(public service: ResourcesDashboardService) {} + ngOnInit(): void { + this.service.ready(); + } +} diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.module.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.module.ts new file mode 100644 index 000000000..37bf594c1 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.module.ts @@ -0,0 +1,28 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { TranslationsEditComponent } from './pages/edit/translations-edit.component'; +import { TranslationsPageComponent } from './pages/home/translations.page'; + +@NgModule({ + declarations: [], + imports: [ + CommonModule, + RouterModule.forChild([ + { + path: '', + component: TranslationsPageComponent, + }, + { + path: 'edit', + component: TranslationsEditComponent, + }, + { + path: ':id', + component: TranslationsEditComponent, + }, + ]), + ], +}) +export class TranslationsPageModule {} diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts new file mode 100644 index 000000000..0638c4133 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts @@ -0,0 +1,113 @@ +import { Injectable, signal } from '@angular/core'; +// eslint-disable-next-line @nx/enforce-module-boundaries +import { Database } from '@picsa/server-types'; +import { PicsaAsyncService } from '@picsa/shared/services/asyncService.service'; +import { PicsaNotificationService } from '@picsa/shared/services/core/notification.service'; +import { SupabaseService } from '@picsa/shared/services/core/supabase'; +import { IStorageEntry } from '@picsa/shared/services/core/supabase/services/supabase-storage.service'; +import { arrayToHashmap } from '@picsa/utils'; + +export interface IResourceStorageEntry extends IStorageEntry { + /** Url generated when upload to public bucket (will always be populated, even if bucket not public) */ + publicUrl: string; +} + +export type IResourceEntry = Database['public']['Tables']['resources']['Row']; + +@Injectable({ providedIn: 'root' }) +export class ResourcesDashboardService extends PicsaAsyncService { + private storageFiles: IResourceStorageEntry[] = []; + public storageFilesHashmap: Record = {}; + public readonly resources = signal([]); + + public get table() { + return this.supabaseService.db.table('resources'); + } + + constructor(private supabaseService: SupabaseService, private notificationService: PicsaNotificationService) { + super(); + } + + public override async init() { + await this.supabaseService.ready(); + await this.listStorageFiles(); + await this.listResources(); + } + + /** Retrieve storage db meta for a file */ + public async getStorageFileById(id: string) { + // Refresh storage file cache if id not found + if (!this.storageFilesHashmap[id]) { + await this.listStorageFiles(); + } + return this.storageFilesHashmap[id]; + } + + /** + * + * TODO - only enable super admin/local dev + * TODO - remove when no longer required + */ + public async migrateHardcodedResources() { + // NOTE - assumes storage files manually uploaded + + // eslint-disable-next-line @nx/enforce-module-boundaries + const { DB_COLLECTION_ENTRIES, DB_FILE_ENTRIES, DB_LINK_ENTRIES } = await import( + '@picsa/resources/src/app/data/index' + ); + console.log({ DB_COLLECTION_ENTRIES, DB_FILE_ENTRIES, DB_LINK_ENTRIES }); + const ref = this.supabaseService.db.table('resources'); + const uploaded: unknown[] = []; + const missing: unknown[] = []; + + for (const fileEntry of Object.values(DB_FILE_ENTRIES)) { + const { type, description, url } = fileEntry; + // extract pathname from firebase url + const { pathname } = new URL(url); + const storagePath = decodeURI(pathname).replace(/%2F/g, '/').replace('/v0/b/picsa-apps.appspot.com/o/', ''); + // check for equivalent storage file + const storageFile = this.storageFiles.find((file) => file.name === storagePath); + if (storageFile) { + const dbEntry: Database['public']['Tables']['resources']['Insert'] = { + description, + type, + + storage_file: storageFile.id, + }; + const { error } = await ref.upsert(dbEntry, { ignoreDuplicates: false }); + + if (error) { + console.error(error); + } + uploaded.push(fileEntry); + } else { + missing.push(fileEntry); + } + } + console.log({ uploaded, missing }); + if (missing.length > 0) { + this.notificationService.showUserNotification({ + matIcon: 'error', + message: `${missing.length} files missing from storage`, + }); + } + } + + private async listStorageFiles() { + const storageFiles = await this.supabaseService.storage.list('resources'); + this.storageFiles = storageFiles.map((file) => ({ + ...file, + publicUrl: this.supabaseService.storage.getPublicLink(file.bucket_id as string, file.name as string), + })); + this.storageFilesHashmap = arrayToHashmap(this.storageFiles, 'id'); + console.log('storage files', this.storageFilesHashmap); + } + + private async listResources() { + const { data, error } = await this.supabaseService.db.table('resources').select<'*', IResourceEntry>('*'); + if (error) { + throw error; + } + this.resources.set(data); + } +} diff --git a/libs/webcomponents/package.json b/libs/webcomponents/package.json index 9e6d67516..40a5cd7d9 100644 --- a/libs/webcomponents/package.json +++ b/libs/webcomponents/package.json @@ -1,14 +1,14 @@ { "name": "@picsa/webcomponents", "version": "0.0.1", - "main": "../../dist/libs/webcomponents/dist/index.cjs.js", - "module": "../../dist/libs/webcomponents/dist/index.js", - "es2015": "../../dist/libs/webcomponents/dist/esm/index.mjs", - "es2017": "../../dist/libs/webcomponents/dist/esm/index.mjs", - "types": "../../dist/libs/webcomponents/dist/types/components.d.ts", - "collection": "../../dist/libs/webcomponents/dist/collection/collection-manifest.json", - "collection:main": "../../dist/libs/webcomponents/dist/collection/index.js", - "unpkg": "../../dist/libs/webcomponents/dist/picsa-webcomponents/picsa-webcomponents.js", + "main": "./dist/index.cjs.js", + "module": "./dist/index.js", + "es2015": "./dist/esm/index.mjs", + "es2017": "./dist/esm/index.mjs", + "types": "./dist/types/components.d.ts", + "collection": "./dist/collection/collection-manifest.json", + "collection:main": "./dist/collection/index.js", + "unpkg": "./dist/picsa-webcomponents/picsa-webcomponents.js", "files": [ "dist/", "loader/" diff --git a/yarn.lock b/yarn.lock index cb47365d9..2a8a82888 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16456,7 +16456,7 @@ __metadata: "leaflet-draw@github:enketo/Leaflet.draw#ff730785db7fcccbf2485ffcf4dffe1238a7c617": version: 1.0.4 resolution: "leaflet-draw@https://github.com/enketo/Leaflet.draw.git#commit=ff730785db7fcccbf2485ffcf4dffe1238a7c617" - checksum: b08b88994769667f11f2b6a8937656c89cea34dafd4661abab0b48b4b97f3bddbdce7b23ddfdb8d7c6335e065530e32a70e281314afa34afa134bf68597945fc + checksum: 253998170af27f886d05b245c85429767e272647221daaf8d94ff5b86f75b8cbb96cc76a8a88492243166a214bc3b66b3ae704a81f74c862f09ac6c9495f731e languageName: node linkType: hard From 189f2ec5e50d8be55aae698252010da8ca157ec0 Mon Sep 17 00:00:00 2001 From: khalifan-kfan Date: Wed, 3 Jan 2024 09:20:25 +0300 Subject: [PATCH 2/8] fix data display --- .../pages/edit/translations-edit.component.ts | 35 ++----- .../pages/home/translations.page.html | 43 ++++++++ .../pages/home/translations.page.scss | 4 + .../pages/home/translations.page.ts | 19 +++- .../translations/translations.service.ts | 98 +++---------------- ...240102153452_translations_table_create.sql | 11 +++ apps/picsa-server/supabase/types/index.ts | 30 ++++++ .../src/assets/resources/contents.json | 24 ++--- .../storage-file-picker.component.ts | 2 +- libs/webcomponents/package.json | 16 +-- 10 files changed, 146 insertions(+), 136 deletions(-) create mode 100644 apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts index e2020b8ed..f5075d86d 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts @@ -1,48 +1,33 @@ import { CommonModule } from '@angular/common'; import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; + import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; // eslint-disable-next-line @nx/enforce-module-boundaries -import type { Database } from '@picsa/server-types'; -import { PICSAFormValidators } from '@picsa/shared/modules/forms/validators'; -//import { -// IUploadResult, -// SupabaseStoragePickerDirective, -// SupabaseUploadComponent, -// } from '@picsa/shared/services/core/supabase'; -// import { IStorageEntry } from '@picsa/shared/services/core/supabase/services/supabase-storage.service'; + import type { Database } from '@picsa/server-types'; + import { PICSAFormValidators } from '@picsa/shared/modules/forms/validators'; -// import { DashboardMaterialModule } from '../../../../material.module'; + import { DashboardMaterialModule } from '../../../../material.module'; // import { DashboardResourcesStorageLinkComponent } from '../../components/storage-link/storage-link.component'; -// import { ResourcesDashboardService } from '../../translations.service'; +import { TranslationDashboardService } from '../../translations.service'; // type IResourceEntry = Database['public']['Tables']['resources']['Row']; @Component({ - selector: 'dashboard-resource-create', + selector: 'dashboard-translations-edit', standalone: true, imports: [ CommonModule, - // DashboardMaterialModule, - // DashboardResourcesStorageLinkComponent, - // FormsModule, - // ReactiveFormsModule, - // SupabaseStoragePickerDirective, - // SupabaseUploadComponent, + DashboardMaterialModule, + FormsModule, + ReactiveFormsModule, ], templateUrl: './translations-edit.component.html', styleUrls: ['./translations-edit.component.scss'], }) export class TranslationsEditComponent { constructor( - // private service: ResourcesDashboardService, + private service: TranslationDashboardService, private route: ActivatedRoute ) {} - - - - - - } diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html index ca08f6a58..8b6399289 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html @@ -2,4 +2,47 @@

Translations

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
en {{ element.en }} mw_ny {{ element.mw_ny }} sw {{ element.sw }} tg {{ element.tg }} zm_ny {{ element.zm_ny }} Date {{ element.created_at | date: 'mediumDate' }}
diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss index 05bb98ef7..b79bcd6c7 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss @@ -12,3 +12,7 @@ tr.resource-row { th { font-weight: bold; } + +td { + cursor: pointer; +} \ No newline at end of file diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts index ea99e6041..3e6d42056 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts @@ -1,22 +1,31 @@ import { CommonModule } from '@angular/common'; import { Component, OnInit } from '@angular/core'; import { RouterModule } from '@angular/router'; +import { Router } from '@angular/router'; +// eslint-disable-next-line @nx/enforce-module-boundaries +import { Database } from '@picsa/server-types'; import { DashboardMaterialModule } from '../../../../material.module'; -// import { DashboardResourcesStorageLinkComponent } from '../../components'; -import { ResourcesDashboardService } from '../../translations.service'; +import { TranslationDashboardService } from '../../translations.service'; +export type ITranslationRow = Database['public']['Tables']['translations']['Row']; @Component({ - selector: 'dashboard-resources-page', + selector: 'dashboard-translations-page', standalone: true, imports: [CommonModule, DashboardMaterialModule, RouterModule], templateUrl: './translations.page.html', styleUrls: ['./translations.page.scss'], }) export class TranslationsPageComponent implements OnInit { - //public displayedColumns = ['title', 'storage_file']; - constructor(public service: ResourcesDashboardService) {} + displayedColumns: string[] = [ 'en', 'mw_ny', 'sw', 'tg', 'zm_ny','created_at',]; + constructor(public service: TranslationDashboardService, private router: Router) {} ngOnInit(): void { this.service.ready(); + + } + goToRecord(row:ITranslationRow){ + console.log(row) + this.router.navigate([`/`, row.id]); + } } diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts index 0638c4133..758941b9c 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts @@ -1,113 +1,41 @@ -import { Injectable, signal } from '@angular/core'; +import { Injectable } from '@angular/core'; // eslint-disable-next-line @nx/enforce-module-boundaries import { Database } from '@picsa/server-types'; import { PicsaAsyncService } from '@picsa/shared/services/asyncService.service'; -import { PicsaNotificationService } from '@picsa/shared/services/core/notification.service'; +// import { PicsaNotificationService } from '@picsa/shared/services/core/notification.service'; import { SupabaseService } from '@picsa/shared/services/core/supabase'; import { IStorageEntry } from '@picsa/shared/services/core/supabase/services/supabase-storage.service'; -import { arrayToHashmap } from '@picsa/utils'; + +export type ITranslationRow = Database['public']['Tables']['translations']['Row']; export interface IResourceStorageEntry extends IStorageEntry { /** Url generated when upload to public bucket (will always be populated, even if bucket not public) */ publicUrl: string; } - -export type IResourceEntry = Database['public']['Tables']['resources']['Row']; - @Injectable({ providedIn: 'root' }) -export class ResourcesDashboardService extends PicsaAsyncService { - private storageFiles: IResourceStorageEntry[] = []; - public storageFilesHashmap: Record = {}; - public readonly resources = signal([]); +export class TranslationDashboardService extends PicsaAsyncService { + + public translations: ITranslationRow[] = []; public get table() { - return this.supabaseService.db.table('resources'); + return this.supabaseService.db.table('translations'); } - constructor(private supabaseService: SupabaseService, private notificationService: PicsaNotificationService) { + constructor(private supabaseService: SupabaseService) { super(); } public override async init() { await this.supabaseService.ready(); - await this.listStorageFiles(); - await this.listResources(); - } - - /** Retrieve storage db meta for a file */ - public async getStorageFileById(id: string) { - // Refresh storage file cache if id not found - if (!this.storageFilesHashmap[id]) { - await this.listStorageFiles(); - } - return this.storageFilesHashmap[id]; - } - - /** - * - * TODO - only enable super admin/local dev - * TODO - remove when no longer required - */ - public async migrateHardcodedResources() { - // NOTE - assumes storage files manually uploaded - - // eslint-disable-next-line @nx/enforce-module-boundaries - const { DB_COLLECTION_ENTRIES, DB_FILE_ENTRIES, DB_LINK_ENTRIES } = await import( - '@picsa/resources/src/app/data/index' - ); - console.log({ DB_COLLECTION_ENTRIES, DB_FILE_ENTRIES, DB_LINK_ENTRIES }); - const ref = this.supabaseService.db.table('resources'); - const uploaded: unknown[] = []; - const missing: unknown[] = []; - - for (const fileEntry of Object.values(DB_FILE_ENTRIES)) { - const { type, description, url } = fileEntry; - // extract pathname from firebase url - const { pathname } = new URL(url); - const storagePath = decodeURI(pathname).replace(/%2F/g, '/').replace('/v0/b/picsa-apps.appspot.com/o/', ''); - // check for equivalent storage file - const storageFile = this.storageFiles.find((file) => file.name === storagePath); - if (storageFile) { - const dbEntry: Database['public']['Tables']['resources']['Insert'] = { - description, - type, - - storage_file: storageFile.id, - }; - const { error } = await ref.upsert(dbEntry, { ignoreDuplicates: false }); - - if (error) { - console.error(error); - } - uploaded.push(fileEntry); - } else { - missing.push(fileEntry); - } - } - console.log({ uploaded, missing }); - if (missing.length > 0) { - this.notificationService.showUserNotification({ - matIcon: 'error', - message: `${missing.length} files missing from storage`, - }); - } + await this.listTranslations(); } - private async listStorageFiles() { - const storageFiles = await this.supabaseService.storage.list('resources'); - this.storageFiles = storageFiles.map((file) => ({ - ...file, - publicUrl: this.supabaseService.storage.getPublicLink(file.bucket_id as string, file.name as string), - })); - this.storageFilesHashmap = arrayToHashmap(this.storageFiles, 'id'); - console.log('storage files', this.storageFilesHashmap); - } - private async listResources() { - const { data, error } = await this.supabaseService.db.table('resources').select<'*', IResourceEntry>('*'); + private async listTranslations() { + const { data, error } = await this.supabaseService.db.table('translations').select<'*', ITranslationRow>('*'); if (error) { throw error; } - this.resources.set(data); + this.translations = data || []; } } diff --git a/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql b/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql new file mode 100644 index 000000000..c661792b0 --- /dev/null +++ b/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql @@ -0,0 +1,11 @@ +create table + public.translations ( + id bigint generated by default as identity, + created_at timestamp with time zone not null default now(), + en text null, + mw_ny text null, + sw text null, + tg text null, + zm_ny text null, + constraint translations_pkey primary key (id) + ) tablespace pg_default; \ No newline at end of file diff --git a/apps/picsa-server/supabase/types/index.ts b/apps/picsa-server/supabase/types/index.ts index 7da0ffaea..5946a1596 100644 --- a/apps/picsa-server/supabase/types/index.ts +++ b/apps/picsa-server/supabase/types/index.ts @@ -264,6 +264,36 @@ export interface Database { } Relationships: [] } + translations: { + Row: { + created_at: string + en: string | null + id: number + mw_ny: string | null + sw: string | null + tg: string | null + zm_ny: string | null + } + Insert: { + created_at?: string + en?: string | null + id?: number + mw_ny?: string | null + sw?: string | null + tg?: string | null + zm_ny?: string | null + } + Update: { + created_at?: string + en?: string | null + id?: number + mw_ny?: string | null + sw?: string | null + tg?: string | null + zm_ny?: string | null + } + Relationships: [] + } } Views: { storage_objects: { diff --git a/apps/picsa-tools/resources-tool/src/assets/resources/contents.json b/apps/picsa-tools/resources-tool/src/assets/resources/contents.json index fe8583095..89bc4db74 100644 --- a/apps/picsa-tools/resources-tool/src/assets/resources/contents.json +++ b/apps/picsa-tools/resources-tool/src/assets/resources/contents.json @@ -44,8 +44,8 @@ "covers/facebook.svg": { "relativePath": "covers/facebook.svg", "size_kb": 1.1, - "md5Checksum": "8626bc9119bd6b8bc0fa04e8a20b6e74", - "modifiedTime": "2022-09-28T20:19:52.986Z" + "md5Checksum": "a09b2f44f6b44b5b6e29aedba9f92029", + "modifiedTime": "2023-07-10T22:11:12.359Z" }, "covers/gap.jpg": { "relativePath": "covers/gap.jpg", @@ -61,9 +61,9 @@ }, "covers/gender-equality.svg": { "relativePath": "covers/gender-equality.svg", - "size_kb": 5.5, - "md5Checksum": "0b6599c4d8b3a87b787910b18a9d8851", - "modifiedTime": "2022-11-01T20:27:18.286Z" + "size_kb": 5.4, + "md5Checksum": "95af38f37c2179d4ad0c5288cbb236ed", + "modifiedTime": "2023-07-10T22:11:12.359Z" }, "covers/gras-nelk.jpg": { "relativePath": "covers/gras-nelk.jpg", @@ -110,8 +110,8 @@ "covers/spreadsheet.svg": { "relativePath": "covers/spreadsheet.svg", "size_kb": 2.8, - "md5Checksum": "a03a4bfb0a1791fda8e232a8b032715b", - "modifiedTime": "2022-09-30T09:35:53.529Z" + "md5Checksum": "0a1bc91188bbc03fda0a7cb2bc1aa6ce", + "modifiedTime": "2023-07-10T22:11:12.360Z" }, "covers/twitter.png": { "relativePath": "covers/twitter.png", @@ -121,15 +121,15 @@ }, "covers/videos.svg": { "relativePath": "covers/videos.svg", - "size_kb": 3.5, - "md5Checksum": "9bee23e2f74d07bd0cdd27bdc286e777", - "modifiedTime": "2023-09-25T18:01:08.322Z" + "size_kb": 3.4, + "md5Checksum": "37516a0c19e20344d02960c6368dde62", + "modifiedTime": "2023-11-16T07:09:42.068Z" }, "covers/weather.svg": { "relativePath": "covers/weather.svg", "size_kb": 3.1, - "md5Checksum": "db07c7d20d9520124c251c810c5817fd", - "modifiedTime": "2022-09-28T19:22:58.064Z" + "md5Checksum": "ca87f24916d258b8b8b5dd8343d4305b", + "modifiedTime": "2023-07-10T22:11:12.360Z" }, "covers/whatsapp.svg": { "relativePath": "covers/whatsapp.svg", diff --git a/libs/shared/src/services/core/supabase/components/storage-file-picker/storage-file-picker.component.ts b/libs/shared/src/services/core/supabase/components/storage-file-picker/storage-file-picker.component.ts index e0dfd1712..7995046d7 100644 --- a/libs/shared/src/services/core/supabase/components/storage-file-picker/storage-file-picker.component.ts +++ b/libs/shared/src/services/core/supabase/components/storage-file-picker/storage-file-picker.component.ts @@ -66,7 +66,7 @@ export class SupabaseStorageFilePickerComponent { const entries = await this.storage.list(this.storageBucketName, this.storageFolderPath); this.fileEntries = entries // filter out metadata files which have filename starting with `.` - .filter(({ name }) => !name?.split('/').pop()?.startsWith('.')) + .filter(({ name }) => name && !name.split('/').pop()?.startsWith('.')) .sort((a, b) => { if (!b.name) return 1; if (!a.name) return -1; diff --git a/libs/webcomponents/package.json b/libs/webcomponents/package.json index 40a5cd7d9..9e6d67516 100644 --- a/libs/webcomponents/package.json +++ b/libs/webcomponents/package.json @@ -1,14 +1,14 @@ { "name": "@picsa/webcomponents", "version": "0.0.1", - "main": "./dist/index.cjs.js", - "module": "./dist/index.js", - "es2015": "./dist/esm/index.mjs", - "es2017": "./dist/esm/index.mjs", - "types": "./dist/types/components.d.ts", - "collection": "./dist/collection/collection-manifest.json", - "collection:main": "./dist/collection/index.js", - "unpkg": "./dist/picsa-webcomponents/picsa-webcomponents.js", + "main": "../../dist/libs/webcomponents/dist/index.cjs.js", + "module": "../../dist/libs/webcomponents/dist/index.js", + "es2015": "../../dist/libs/webcomponents/dist/esm/index.mjs", + "es2017": "../../dist/libs/webcomponents/dist/esm/index.mjs", + "types": "../../dist/libs/webcomponents/dist/types/components.d.ts", + "collection": "../../dist/libs/webcomponents/dist/collection/collection-manifest.json", + "collection:main": "../../dist/libs/webcomponents/dist/collection/index.js", + "unpkg": "../../dist/libs/webcomponents/dist/picsa-webcomponents/picsa-webcomponents.js", "files": [ "dist/", "loader/" From de4690e10ae9be00a8ac029d74159542ae8c410b Mon Sep 17 00:00:00 2001 From: khalifan-kfan Date: Mon, 15 Jan 2024 13:11:38 +0300 Subject: [PATCH 3/8] enable editing for a single translation --- .../edit/translations-edit.component.html | 41 ++++++++++++++- .../edit/translations-edit.component.scss | 26 ++++++++++ .../pages/edit/translations-edit.component.ts | 52 +++++++++++++------ .../pages/home/translations.page.ts | 5 +- .../translations/translations.service.ts | 20 +++++++ 5 files changed, 123 insertions(+), 21 deletions(-) diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html index 0f255fe6e..79b6d2bef 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html @@ -1,5 +1,42 @@

Edit Translations

+ @if(translationRow){ +
+
+ +
{{ translationRow.created_at | date: 'mediumDate' }}
+
- -
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+ + + } @else if(dataLoadError) { +
{{dataLoadError}}
+ } @else { +
Loading...
+ } + @if(editActionFeedbackMessage){ +
{{editActionFeedbackMessage}}
+ } + \ No newline at end of file diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss index e69de29bb..ab42dae12 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss @@ -0,0 +1,26 @@ +.form-content{ + display: flex; + flex-direction: column; + gap: 1.4rem; +} +.submitButton{ + width: 7rem; + margin-bottom: 1rem; +} +.form-data{ + display: flex; + flex-direction: column; + gap: 0.5rem; + +} +input { + padding: 8px; + color: var(--color-primary); + outline-color: var(--color-primary); + max-width: 300px; + display: block; + font-size: 0.9rem; + white-space: pre-wrap; + word-wrap: break-word; + + } \ No newline at end of file diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts index f5075d86d..b110d3a5d 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts @@ -1,33 +1,55 @@ import { CommonModule } from '@angular/common'; import { Component, OnInit } from '@angular/core'; - import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; // eslint-disable-next-line @nx/enforce-module-boundaries - import type { Database } from '@picsa/server-types'; - import { PICSAFormValidators } from '@picsa/shared/modules/forms/validators'; +import type { Database } from '@picsa/server-types'; +import { PICSAFormValidators } from '@picsa/shared/modules/forms/validators'; - import { DashboardMaterialModule } from '../../../../material.module'; +import { DashboardMaterialModule } from '../../../../material.module'; // import { DashboardResourcesStorageLinkComponent } from '../../components/storage-link/storage-link.component'; import { TranslationDashboardService } from '../../translations.service'; -// type IResourceEntry = Database['public']['Tables']['resources']['Row']; +type ITranslationEntry = Database['public']['Tables']['translations']['Row']; @Component({ selector: 'dashboard-translations-edit', standalone: true, - imports: [ - CommonModule, - DashboardMaterialModule, - FormsModule, - ReactiveFormsModule, - ], + imports: [CommonModule, DashboardMaterialModule, FormsModule, ReactiveFormsModule], templateUrl: './translations-edit.component.html', styleUrls: ['./translations-edit.component.scss'], }) export class TranslationsEditComponent { - constructor( - private service: TranslationDashboardService, - private route: ActivatedRoute - ) {} + translationRow: ITranslationEntry; + dataLoadError: string; + editActionFeedbackMessage: string; + constructor(private service: TranslationDashboardService, private route: ActivatedRoute) { + this.service.ready(); + this.route.params.subscribe((params) => { + const id = params['id']; + this.service + .getTranslationById(id) + .then((data) => { + this.translationRow = data; + }) + .catch((error) => { + console.error('Error fetching translation:', error); + this.dataLoadError = 'Failed to fetch translation.'; + }); + }); + } + submitForm() { + this.service + .updateTranslationById(this.translationRow.id, this.translationRow) + .then((data) => { + if (data === 'Updated successfully') { + this.editActionFeedbackMessage = 'Updated successfully'; + } + }) + .catch((error) => { + console.error('Error editing translation:', error); + this.editActionFeedbackMessage = 'Failed to edit translation.'; + }); + } } diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts index 3e6d42056..30952b222 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts @@ -21,11 +21,8 @@ export class TranslationsPageComponent implements OnInit { constructor(public service: TranslationDashboardService, private router: Router) {} ngOnInit(): void { this.service.ready(); - } goToRecord(row:ITranslationRow){ - console.log(row) - this.router.navigate([`/`, row.id]); - + this.router.navigate([`/translations`, row.id]); } } diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts index 758941b9c..d727315a7 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts @@ -38,4 +38,24 @@ export class TranslationDashboardService extends PicsaAsyncService { } this.translations = data || []; } + + // update a translation record by ID + public async updateTranslationById(id: number, updatedData: Partial): Promise { + const { data, error } = await this.supabaseService.db.table('translations').update(updatedData).eq('id', id); + if (error) { + throw error; + } + return "Updated successfully"; + } + + // Fetch a translation record by ID + public async getTranslationById(id: number): Promise { + const { data, error } = await this.supabaseService.db.table('translations').select('*').eq('id', id).single(); + if (error) { + throw error; + } + + return data; + } + } From 5ae99903c6fefc214defcb733468a5d85153ff02 Mon Sep 17 00:00:00 2001 From: khalifan-kfan Date: Mon, 15 Jan 2024 17:14:40 +0300 Subject: [PATCH 4/8] adding and deleting translations --- .../dashboard/src/app/material.module.ts | 2 +- .../edit/translations-edit.component.html | 13 +++-- .../edit/translations-edit.component.scss | 3 ++ .../pages/edit/translations-edit.component.ts | 26 +++++++--- .../pages/home/translations.page.html | 13 +++-- .../pages/home/translations.page.scss | 9 ++++ .../pages/home/translations.page.ts | 12 ++++- .../pages/new/new-translations.component.html | 34 +++++++++++++ .../pages/new/new-translations.component.scss | 26 ++++++++++ .../new/new-translations.component.spec.ts | 21 ++++++++ .../pages/new/new-translations.component.ts | 50 +++++++++++++++++++ .../translations/translations.module.ts | 5 +- .../translations/translations.service.ts | 29 ++++++++++- 13 files changed, 222 insertions(+), 21 deletions(-) create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.html create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.scss create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.spec.ts create mode 100644 apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.ts diff --git a/apps/picsa-apps/dashboard/src/app/material.module.ts b/apps/picsa-apps/dashboard/src/app/material.module.ts index e6dd0d0ce..8a3c8b562 100644 --- a/apps/picsa-apps/dashboard/src/app/material.module.ts +++ b/apps/picsa-apps/dashboard/src/app/material.module.ts @@ -24,7 +24,7 @@ const matModules = [ MatStepperModule, MatTableModule, MatTabsModule, - MatToolbarModule, + MatToolbarModule ]; @NgModule({ diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html index 79b6d2bef..479112177 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html @@ -2,8 +2,8 @@

Edit Translations

@if(translationRow){
-
- +
+
{{ translationRow.created_at | date: 'mediumDate' }}
@@ -29,7 +29,7 @@

Edit Translations

- +
} @else if(dataLoadError) {
{{dataLoadError}}
@@ -37,6 +37,11 @@

Edit Translations

Loading...
} @if(editActionFeedbackMessage){ -
{{editActionFeedbackMessage}}
+
{{editActionFeedbackMessage}}
+ } + @if(translationRow){ +

Delete this Translation

+ } \ No newline at end of file diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss index ab42dae12..ece1fed38 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss @@ -7,6 +7,9 @@ width: 7rem; margin-bottom: 1rem; } +.deleteButton{ + width: 15rem; +} .form-data{ display: flex; flex-direction: column; diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts index b110d3a5d..306c74b67 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts @@ -1,10 +1,10 @@ import { CommonModule } from '@angular/common'; -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; +import { Component } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ActivatedRoute,Router } from '@angular/router'; +import { RouterModule } from '@angular/router'; // eslint-disable-next-line @nx/enforce-module-boundaries import type { Database } from '@picsa/server-types'; -import { PICSAFormValidators } from '@picsa/shared/modules/forms/validators'; import { DashboardMaterialModule } from '../../../../material.module'; // import { DashboardResourcesStorageLinkComponent } from '../../components/storage-link/storage-link.component'; @@ -15,7 +15,7 @@ type ITranslationEntry = Database['public']['Tables']['translations']['Row']; @Component({ selector: 'dashboard-translations-edit', standalone: true, - imports: [CommonModule, DashboardMaterialModule, FormsModule, ReactiveFormsModule], + imports: [CommonModule, DashboardMaterialModule, FormsModule, ReactiveFormsModule,RouterModule], templateUrl: './translations-edit.component.html', styleUrls: ['./translations-edit.component.scss'], }) @@ -23,7 +23,7 @@ export class TranslationsEditComponent { translationRow: ITranslationEntry; dataLoadError: string; editActionFeedbackMessage: string; - constructor(private service: TranslationDashboardService, private route: ActivatedRoute) { + constructor(private service: TranslationDashboardService, private route: ActivatedRoute, private router: Router) { this.service.ready(); this.route.params.subscribe((params) => { const id = params['id']; @@ -52,4 +52,18 @@ export class TranslationsEditComponent { this.editActionFeedbackMessage = 'Failed to edit translation.'; }); } + deleteTranslation(id:number){ + this.service.deleteTranslationById(id).then((data) => { + if (data === 'Deleted Successfully') { + this.router.navigate([`/translations`]); + } + }) + .catch((error) => { + console.error('Error deleting translation:', error); + }); + } + async openTranslationDeleteDialog() { + //failed attempt to use a shared delete model + this.deleteTranslation(this.translationRow.id); + } } diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html index 8b6399289..18fad70f8 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html @@ -1,11 +1,13 @@
-
-

Translations

+
+

Translations

+
+ @if(service.translations){ - + @@ -40,9 +42,10 @@

Translations

- - +
en {{ element.en }} {{ element.created_at | date: 'mediumDate' }}
+} +
diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss index b79bcd6c7..496f3585e 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.scss @@ -15,4 +15,13 @@ th { td { cursor: pointer; +} + +.disallow-click{ + pointer-events: none; + cursor: not-allowed; +} +.allow-click{ + pointer-events:all; + cursor: pointer; } \ No newline at end of file diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts index 30952b222..914e7738b 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts @@ -17,12 +17,22 @@ export type ITranslationRow = Database['public']['Tables']['translations']['Row' styleUrls: ['./translations.page.scss'], }) export class TranslationsPageComponent implements OnInit { - displayedColumns: string[] = [ 'en', 'mw_ny', 'sw', 'tg', 'zm_ny','created_at',]; + displayedColumns: string[] = [ 'en', 'mw_ny', 'sw', 'tg', 'zm_ny','created_at']; + constructor(public service: TranslationDashboardService, private router: Router) {} ngOnInit(): void { this.service.ready(); + this.refreshTranslations(); } + goToRecord(row:ITranslationRow){ this.router.navigate([`/translations`, row.id]); } + + + refreshTranslations() { + this.service.listTranslations().catch((error) => { + console.error('Error fetching translations:', error); + }); + } } diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.html new file mode 100644 index 000000000..4efa8924c --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.html @@ -0,0 +1,34 @@ +
+

New Translations

+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+ +
+ + @if(editActionFeedbackMessage){ +
{{editActionFeedbackMessage}}
+ } +
\ No newline at end of file diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.scss b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.scss new file mode 100644 index 000000000..ab42dae12 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.scss @@ -0,0 +1,26 @@ +.form-content{ + display: flex; + flex-direction: column; + gap: 1.4rem; +} +.submitButton{ + width: 7rem; + margin-bottom: 1rem; +} +.form-data{ + display: flex; + flex-direction: column; + gap: 0.5rem; + +} +input { + padding: 8px; + color: var(--color-primary); + outline-color: var(--color-primary); + max-width: 300px; + display: block; + font-size: 0.9rem; + white-space: pre-wrap; + word-wrap: break-word; + + } \ No newline at end of file diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.spec.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.spec.ts new file mode 100644 index 000000000..6ddf928c7 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { NewTranslationsComponent } from './new-translations.component' + +describe('NewTranslationsComponent', () => { + let component: NewTranslationsComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [NewTranslationsComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(NewTranslationsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.ts new file mode 100644 index 000000000..6da562a79 --- /dev/null +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.ts @@ -0,0 +1,50 @@ +import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; + +// eslint-disable-next-line @nx/enforce-module-boundaries +//import type { Database } from '@picsa/server-types'; +import { DashboardMaterialModule } from '../../../../material.module'; +// import { DashboardResourcesStorageLinkComponent } from '../../components/storage-link/storage-link.component'; +import { TranslationDashboardService } from '../../translations.service'; + +//type ITranslationEntry = Database['public']['Tables']['translations']['Row']; + +@Component({ + selector: 'dashboard-translations-new', + standalone: true, + imports: [CommonModule, DashboardMaterialModule, FormsModule, ReactiveFormsModule], + templateUrl: './new-translations.component.html', + styleUrls: ['./new-translations.component.scss'], +}) +export class NewTranslationsComponent { + en:string; + mw_ny:string; + sw:string; + tg:string; + zm_ny:string; + editActionFeedbackMessage: string; + constructor(private service: TranslationDashboardService) { + this.service.ready(); + } + submitForm() { + const data = { + en:this.en, + mw_ny: this.mw_ny, + sw:this.sw, + tg:this.tg, + zm_ny:this.zm_ny, + } + this.service.addTranslation(data) + .then((data) => { + if (data === 'Added successfully') { + this.editActionFeedbackMessage = 'Added successfully'; + } + }) + .catch((error) => { + console.error('Error adding translation:', error); + this.editActionFeedbackMessage = 'Failed to add a translation.'; + }); + + } +} diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.module.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.module.ts index 37bf594c1..01229510a 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.module.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.module.ts @@ -4,6 +4,7 @@ import { RouterModule } from '@angular/router'; import { TranslationsEditComponent } from './pages/edit/translations-edit.component'; import { TranslationsPageComponent } from './pages/home/translations.page'; +import { NewTranslationsComponent } from './pages/new/new-translations.component'; @NgModule({ declarations: [], @@ -15,8 +16,8 @@ import { TranslationsPageComponent } from './pages/home/translations.page'; component: TranslationsPageComponent, }, { - path: 'edit', - component: TranslationsEditComponent, + path: 'new', + component: NewTranslationsComponent, }, { path: ':id', diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts index d727315a7..539501dfe 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts @@ -31,7 +31,7 @@ export class TranslationDashboardService extends PicsaAsyncService { } - private async listTranslations() { + public async listTranslations() { const { data, error } = await this.supabaseService.db.table('translations').select<'*', ITranslationRow>('*'); if (error) { throw error; @@ -54,8 +54,33 @@ export class TranslationDashboardService extends PicsaAsyncService { if (error) { throw error; } - return data; } + //delete function + public async deleteTranslationById(id: number): Promise { + const { error } = await this.supabaseService + .db + .table('translations') + .delete() + .eq('id', id); + + if (error) { + throw error; + } + return "Deleted Successfully" + } + +// In your TranslationDashboardService +public async addTranslation(translation: Partial): Promise { + const { data, error } = await this.supabaseService + .db + .table('translations') + .insert([translation]); + + if (error) { + throw error; + } + return "Added successfully"; } +} \ No newline at end of file From 813935b6a0d857daaf294e9d98efda87ab58a7fb Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Mon, 15 Jan 2024 12:59:33 -0800 Subject: [PATCH 5/8] chore: update db columns and add seed data --- .../pages/home/translations.page.html | 62 ++-- .../pages/home/translations.page.ts | 7 +- .../supabase/data/translations_rows.csv | 345 ++++++++++++++++++ ...240102153452_translations_table_create.sql | 16 +- 4 files changed, 395 insertions(+), 35 deletions(-) create mode 100644 apps/picsa-server/supabase/data/translations_rows.csv diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html index 18fad70f8..88f94b9f4 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html @@ -1,51 +1,61 @@
-
-

Translations

+
+

Translations

@if(service.translations){ - - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + + + + + + + + + + + + + - - + + - +
en {{ element.en }} Tool{{ element.tool }} mw_ny {{ element.mw_ny }} Context{{ element.context }} sw {{ element.sw }} en{{ element.en }} tg {{ element.tg }} mw_ny{{ element.mw_ny }} zm_ny {{ element.zm_ny }} zm_ny{{ element.zm_ny }}ke_sw{{ element.ke_sw }}tj_tg{{ element.tj_tg }} Date {{ element.created_at | date: 'mediumDate' }} Date{{ element.created_at | date: 'mediumDate' }}
-} - + }
diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts index 914e7738b..a0082e846 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts @@ -17,19 +17,18 @@ export type ITranslationRow = Database['public']['Tables']['translations']['Row' styleUrls: ['./translations.page.scss'], }) export class TranslationsPageComponent implements OnInit { - displayedColumns: string[] = [ 'en', 'mw_ny', 'sw', 'tg', 'zm_ny','created_at']; - + displayedColumns: string[] = ['tool', 'context', 'en', 'mw_ny', 'zm_ny', 'sw', 'tg', 'created_at']; + constructor(public service: TranslationDashboardService, private router: Router) {} ngOnInit(): void { this.service.ready(); this.refreshTranslations(); } - goToRecord(row:ITranslationRow){ + goToRecord(row: ITranslationRow) { this.router.navigate([`/translations`, row.id]); } - refreshTranslations() { this.service.listTranslations().catch((error) => { console.error('Error fetching translations:', error); diff --git a/apps/picsa-server/supabase/data/translations_rows.csv b/apps/picsa-server/supabase/data/translations_rows.csv new file mode 100644 index 000000000..5837fb986 --- /dev/null +++ b/apps/picsa-server/supabase/data/translations_rows.csv @@ -0,0 +1,345 @@ +created_at,tool,context,en,mw_ny,ke_sw,tj_tg,zm_ny +2024-01-15 20:34:08.423203+00,budget,,Add Female Member,Onjezerani membala wa mkazi,,,Ikamponi membala wam'kazi +2024-01-15 20:34:08.423203+00,budget,,Add Male Member,Onjezerani membala wa mamuna,,,Ikamponi membala wam'muna +2024-01-15 20:34:08.423203+00,budget,,Balance,Ndalama zotsala,,,Zokharira +2024-01-15 20:34:08.423203+00,budget,,Consumed,Zodyedwa,,,Zosewenzetsedwa +2024-01-15 20:34:08.423203+00,budget,,Cost,Mtengo,,,Mtengo +2024-01-15 20:34:08.423203+00,budget,,Create New Budget,Pangani bajeti yatsopano,,,Pangani bajeti yatsopano +2024-01-15 20:34:08.423203+00,budget,,Days,Masiku,,,Masiku +2024-01-15 20:34:08.423203+00,budget,,Decrease Scale,Kuchepetsa mlingo,,,Chepetsa kukula +2024-01-15 20:34:08.423203+00,budget,,description,mafotokozeredwe,,,kaonekeswe +2024-01-15 20:34:08.423203+00,budget,,Description (optional),Kufotokozera (Mukhoza osalemba),,,Kufotokozera (posankha) +2024-01-15 20:34:08.423203+00,budget,,Enterprise,bizinesi,,,malonda +2024-01-15 20:34:08.423203+00,budget,,Family,banja,,,banja +2024-01-15 20:34:08.423203+00,budget,,Family Labour,ntchito yogwiridwa ndi amubanjamo,,,ntchito ya banja +2024-01-15 20:34:08.423203+00,budget,,How long is your budget for?,bajeti yanu imakhala yayitali bwanji?,,,bajeti yanu imakhala yayitali motani? +2024-01-15 20:34:08.423203+00,budget,,Import Budget Code,lowetsani nambala ya bajeti,,,nambala ya bajeti +2024-01-15 20:34:08.423203+00,budget,,Increase Scale,onjezerani mulingo,,,kuchulukitsa +2024-01-15 20:34:08.423203+00,budget,,Inputs,zolowa,,,zolowa +2024-01-15 20:34:08.423203+00,budget,,Outputs,zotuluka,,,zotuluka +2024-01-15 20:34:08.423203+00,budget,activities,apply fertiliser,kuthira feteleza,,,thirani fatatleza +2024-01-15 20:34:08.423203+00,budget,activities,apply pesticide,kopopela mankhwala a tizilombo,,,thirani mankhwala +2024-01-15 20:34:08.423203+00,budget,activities,bagging,kupakila mmatumba,,,kuika m'mathumba +2024-01-15 20:34:08.423203+00,budget,activities,banding,kubandila,,,kumangilira +2024-01-15 20:34:08.423203+00,budget,activities,build housing,kumanga makola,,,kumanga nyumba +2024-01-15 20:34:08.423203+00,budget,activities,compost manure making,kupanga manyowa,,,kupanga manyowa kuzinyalala +2024-01-15 20:34:08.423203+00,budget,activities,dipping,kupanga dipi ziweto,,,kupaka +2024-01-15 20:34:08.423203+00,budget,activities,feeding livestock,kudyetsa ziweto,,,kudyetsa ziweto +2024-01-15 20:34:08.423203+00,budget,activities,harvesting,kukolola,,,kukolola +2024-01-15 20:34:08.423203+00,budget,activities,land clearing,kusosa,,,kukonza malo +2024-01-15 20:34:08.423203+00,budget,activities,marketing and selling,kutsatsa ndi kugulitsa,,,kutsatsa ndi kugulitsa +2024-01-15 20:34:08.423203+00,budget,activities,mulching,kuphimbila,,,mochi +2024-01-15 20:34:08.423203+00,budget,activities,ploughing,kugalauza,,,kugaula +2024-01-15 20:34:08.423203+00,budget,activities,post-harvest handling,kusamala zokolora,,,kagwiridwe pambuyo po kolola +2024-01-15 20:34:08.423203+00,budget,activities,provide supplements,kupereka zakudya zoonjezera,,,perekani zothandizila +2024-01-15 20:34:08.423203+00,budget,activities,provide water,kupereka madzi ku ziweto,,,perekani madzi +2024-01-15 20:34:08.423203+00,budget,activities,purchase,kugula,,,gulani +2024-01-15 20:34:08.423203+00,budget,activities,relocation,kusamutsa ziweso,,,kusamukira +2024-01-15 20:34:08.423203+00,budget,activities,shelling,kutonola/kusola,,,kutongola +2024-01-15 20:34:08.423203+00,budget,activities,sowing,kufesa,,,kufesa +2024-01-15 20:34:08.423203+00,budget,activities,storage,kusunga,,,kasungidwe +2024-01-15 20:34:08.423203+00,budget,activities,threshing,kupuntha,,,kupuntha +2024-01-15 20:34:08.423203+00,budget,activities,transport,transipoti,,,mayendedwe +2024-01-15 20:34:08.423203+00,budget,activities,transport livestock,kunyamula ziweto,,,kunyamula ziweto +2024-01-15 20:34:08.423203+00,budget,activities,vaccinate,kupereka katemela,,,katemera +2024-01-15 20:34:08.423203+00,budget,activities,value addition,kuwonjezera phindu,,,kuwonjezera phindu +2024-01-15 20:34:08.423203+00,budget,activities,watering,kuthirira,,,kuthirira +2024-01-15 20:34:08.423203+00,budget,activities,weeding,kupalira,,,kupalira +2024-01-15 20:34:08.423203+00,common,buttons,Cancel,thetsani,,,kutseka +2024-01-15 20:34:08.423203+00,common,buttons,Close,Tsekani,,,Tsekani +2024-01-15 20:34:08.423203+00,common,buttons,Next,pitani tsamba lina,,,ina +2024-01-15 20:34:08.423203+00,common,buttons,Save,sungani,,,sungani +2024-01-15 20:34:08.423203+00,common,buttons,Back,Kumbuyo,,,Bwelerani +2024-01-15 20:34:08.423203+00,common,buttons,Delete,Kufufuta,,,Fafanizani +2024-01-15 20:34:08.423203+00,common,buttons,Edit,Sinthani,,,Lembani bwino +2024-01-15 20:34:08.423203+00,climate,chart,End,Pothera,,,Tsirizani +2024-01-15 20:34:08.423203+00,climate,chart,End of Season,Mapeto a nyengo,,,Kutha kwa nyengo +2024-01-15 20:34:08.423203+00,climate,chart,End of season is defined as the last day in the season (1st October - 30th April) with more than 10mm of rainfall.,Mapeto a nyengo akutanthauza tsiku lomaliza mu nyengo (1 okotobala mpaka 30 epulo) lomwe kwagwa mvula yoposa 10mm,,,Kutha kwa nyengo akutanthauza tsiku lomaliza mu nyengo (1 okotobala mpaka 30 epulo) lomwe kwagwa mvula yoposa 10mm +2024-01-15 20:34:08.423203+00,climate,chart,Length,kutalika,,,kutalika +2024-01-15 20:34:08.423203+00,climate,chart,Length of Season,Kutalika kwa nyengo,,,Kutalika kwa nyengo +2024-01-15 20:34:08.423203+00,climate,chart,Length of season is defined as the total days from the start of the season until the end of the season as defined,Lutalika kwa nyengo kutanthauza masiku onse kuyambira pachiyambi mpaka pamapeto a nyengo monga momwe zafotokozedwa,,,Kutalika kwa nyengo kutanthauza masiku onse kuyambira pachiyambi mpaka pamapeto a nyengo monga momwe zafotokozedwa +2024-01-15 20:34:08.423203+00,climate,chart,Rain,Mvula,,,Mvula +2024-01-15 20:34:08.423203+00,climate,chart,Seasonal Rainfall,Mvula ya mu nyengo,,,Mvula ya mu nyengo +2024-01-15 20:34:08.423203+00,climate,chart,Seasonal rainfall is defined as the total rain recorded from the start of the season until the end of the season,Mvula ya mu nyengo imatanthauza mvula yonse yomwe yalembedwa kuti yagwa kuyambira pachiyambi mpaka pa mapeto a nyengoyo,,,Mvula ya mu nyengo imatanthauza mvula yonse yomwe yalembedwa kuti yagwa kuyambira pachiyambi mpaka pa mapeto a nyengoyo +2024-01-15 20:34:08.423203+00,climate,chart,Seasonal Total Rainfall (mm),Mvula yathu yathunthu ya nyengo yapadera (mm),,,Mvula yathu yathunthu ya nyengo yapadera (mm) +2024-01-15 20:34:08.423203+00,climate,chart,Start,Kuyamba,,,Suyamba +2024-01-15 20:34:08.423203+00,climate,chart,Start of Season,chiyambi cha nyengo,,,chiyambi cha nyengo +2024-01-15 20:34:08.423203+00,climate,chart,Start of season is defined as the first occasion (from 1st October) with more than 25mm in a 3 day period and no dry spell of 10 days or more within the following 30 days,chiymabi cha nyengo chimatanthauza mvula yoyamba (kuyambira pa 1 okotobala) yomwe yagwa kuposa mlingo wa 25mm mu masiku atatu ndipo kuti panalibe ng'amba ya masiku oposa khumi mu masiku makumi atatu kuchokera nthawi yomwe mvula inagwa.,,,chiymabi cha nyengo chimatanthauza mvula yoyamba (kuyambira pa 1 okotobala) yomwe yagwa kuposa mlingo wa 25mm mu masiku atatu ndipo kuti panalibe ng'amba ya masiku oposa khumi mu masiku makumi atatu kuchokera nthawi yomwe mvula inagwa. +2024-01-15 20:34:08.423203+00,climate,chart,Extreme,,,, +2024-01-15 20:34:08.423203+00,climate,chart,Extreme Rainfall,,,, +2024-01-15 20:34:08.423203+00,climate,chart,Extreme rainfall are days where the total amount of rain exceeds the 95th Percentile,,,, +2024-01-15 20:34:08.423203+00,climate,chart,Frequency of Extreme,,,, +2024-01-15 20:34:08.423203+00,budget,day_1,Monday,Lolemba,,,Pa lolemba +2024-01-15 20:34:08.423203+00,budget,day_2,Tuesday,Lachiwiri,,,Pa chiwiri +2024-01-15 20:34:08.423203+00,budget,day_3,Wednesday,Lachitatu,,,Pa chitatu +2024-01-15 20:34:08.423203+00,budget,day_4,Thursday,lachinayi,,,Pa chinai +2024-01-15 20:34:08.423203+00,budget,day_5,Friday,Lachisanu,,,Pa chisanu +2024-01-15 20:34:08.423203+00,budget,day_6,Saturday,Loweruka,,,Pa chiweru +2024-01-15 20:34:08.423203+00,budget,day_7,Sunday,Lamulungu,,,Pa sondo +2024-01-15 20:34:08.423203+00,budget,enterprise,afforestation,kudzala mitengo,,,kubyala mitengo +2024-01-15 20:34:08.423203+00,budget,enterprise,cattle,ng'ombe,,,ng'ombe +2024-01-15 20:34:08.423203+00,budget,enterprise,chicken,nkhuku,,,nkhuku +2024-01-15 20:34:08.423203+00,budget,enterprise,cowpeas,khobwe,,,nyemba +2024-01-15 20:34:08.423203+00,budget,enterprise,ducks,abakha,,,abakha +2024-01-15 20:34:08.423203+00,budget,enterprise,fish,nsomba,,,nsomba +2024-01-15 20:34:08.423203+00,budget,enterprise,goats,mbuzi,,,mbuzi +2024-01-15 20:34:08.423203+00,budget,enterprise,groundnuts,mtedza,,,nshawa +2024-01-15 20:34:08.423203+00,budget,enterprise,guinea fowl,nkhanga,,,nkhanga +2024-01-15 20:34:08.423203+00,budget,enterprise,maize,chimanga,,,chimanga +2024-01-15 20:34:08.423203+00,budget,enterprise,mixed,kusakaniza,,,kusakaniza +2024-01-15 20:34:08.423203+00,budget,enterprise,onions,anyezi,,,anyezi +2024-01-15 20:34:08.423203+00,budget,enterprise,paw-paw,papaya,,,paw-paw +2024-01-15 20:34:08.423203+00,budget,enterprise,pigeon peas,nandolo,,,nyamdolo +2024-01-15 20:34:08.423203+00,budget,enterprise,pigs,nkhumba,,,nkhumba +2024-01-15 20:34:08.423203+00,budget,enterprise,rice,mpunga,,,mpunga +2024-01-15 20:34:08.423203+00,budget,enterprise,sheep,nkhosa,,,mbelele +2024-01-15 20:34:08.423203+00,budget,enterprise,sorghum,mapila,,,mapira +2024-01-15 20:34:08.423203+00,budget,enterprise,soya beans,soya,,,nyemba za soya +2024-01-15 20:34:08.423203+00,budget,enterprise,sweet potatoes,mbatata ya kholowa,,,kandolo/kachamba +2024-01-15 20:34:08.423203+00,budget,enterprise,tomatoes,tomato,,,chimate +2024-01-15 20:34:08.423203+00,budget,enterprise,watermelon,mavwende,,,vwembe +2024-01-15 20:34:08.423203+00,budget,inputs,bags,matumba,,,matumba +2024-01-15 20:34:08.423203+00,budget,inputs,chemicals,mankhwala,,,mankhwala +2024-01-15 20:34:08.423203+00,budget,inputs,feed,zakudza za ziweto,,,zakudya zaziweto (Kudyetsa) +2024-01-15 20:34:08.423203+00,budget,inputs,fertiliser,feteleza,,,fataleza +2024-01-15 20:34:08.423203+00,budget,inputs,housing,khola,,,mosungila +2024-01-15 20:34:08.423203+00,budget,inputs,labour - paid,"ganyu ",,,ntchito - yolipidwa +2024-01-15 20:34:08.423203+00,budget,inputs,manure sacks,matumba a manyowa,,,masaka ya manyowa +2024-01-15 20:34:08.423203+00,budget,inputs,manure wheelbarrows,wilibala ya manyowa,,,wilibala ya manyowa +2024-01-15 20:34:08.423203+00,budget,inputs,ox cart,ngolo,,,kochikali/ ngolo +2024-01-15 20:34:08.423203+00,budget,inputs,pot for storage,mphika wongula zinthu,,,mphika posungira +2024-01-15 20:34:08.423203+00,budget,inputs,protective equipment,zida zozitetezera pogwira ntchito,,,zida zoteteza +2024-01-15 20:34:08.423203+00,budget,inputs,seeds,mbewu,,,mbewu +2024-01-15 20:34:08.423203+00,budget,inputs,sheller hire,kupanga hayala chida chotonolera,,,makina otongolera olipilidwa +2024-01-15 20:34:08.423203+00,budget,inputs,supplements,zakudya za ziweto zoowonjezera,,,zothandizila +2024-01-15 20:34:08.423203+00,budget,inputs,tools,zida,,,zida +2024-01-15 20:34:08.423203+00,budget,inputs,tractor hire,kubweleka thirakitale,,,ganyu ya thalakita +2024-01-15 20:34:08.423203+00,budget,inputs,transportation hire,hayala ya thiransipoti,,,mayendedwe olipira +2024-01-15 20:34:08.423203+00,budget,inputs,vaccine,katemera,,,katemera +2024-01-15 20:34:08.423203+00,budget,month_1,January,januwale,,,januwale +2024-01-15 20:34:08.423203+00,budget,month_1_short,Jan,januwale,,,jan +2024-01-15 20:34:08.423203+00,budget,month_10,October,okotabala,,,okotabala +2024-01-15 20:34:08.423203+00,budget,month_10_short,Oct,oko,,,oko +2024-01-15 20:34:08.423203+00,budget,month_11,November,novembala,,,novembala +2024-01-15 20:34:08.423203+00,budget,month_11_short,Nov,novembala,,,nov +2024-01-15 20:34:08.423203+00,budget,month_12,December,disembala,,,disembala +2024-01-15 20:34:08.423203+00,budget,month_12_short,Dec,disembala,,,dis +2024-01-15 20:34:08.423203+00,budget,month_2,February,febuluwale,,,febuluwale +2024-01-15 20:34:08.423203+00,budget,month_2_short,Feb,febuluwale,,,feb +2024-01-15 20:34:08.423203+00,budget,month_3,March,marichi,,,marichi +2024-01-15 20:34:08.423203+00,budget,month_3_short,Mar,marichi,,,mar +2024-01-15 20:34:08.423203+00,budget,month_4,April,epulo,,,epulo +2024-01-15 20:34:08.423203+00,budget,month_4_short,Apr,epulo,,,epu +2024-01-15 20:34:08.423203+00,budget,month_5_short,May,meyi,,,meyi +2024-01-15 20:34:08.423203+00,budget,month_6,June,juni,,,juni +2024-01-15 20:34:08.423203+00,budget,month_6_short,Jun,juni,,,jun +2024-01-15 20:34:08.423203+00,budget,month_7,July,julayi,,,julayi +2024-01-15 20:34:08.423203+00,budget,month_7_short,Jul,Julaye,,,jul +2024-01-15 20:34:08.423203+00,budget,month_8,August,ogasiti,,,ogasiti +2024-01-15 20:34:08.423203+00,budget,month_8_short,Aug,ogasiti,,,oga +2024-01-15 20:34:08.423203+00,budget,month_9,September,sepitembala,,,sepitembala +2024-01-15 20:34:08.423203+00,budget,month_9_short,Sep,sepitembala,,,sep +2024-01-15 20:34:08.423203+00,budget,other,add custom,onjezani zipangizo,,,kuikapo m'sonkho +2024-01-15 20:34:08.423203+00,budget,other,family labour,ntchito yogwiridwa ndi amubanjamo,,,ntchito ya banja +2024-01-15 20:34:08.423203+00,budget,outputs,crop,mbewu,,,zokolora +2024-01-15 20:34:08.423203+00,budget,outputs,eggs,mazira,,,mazira +2024-01-15 20:34:08.423203+00,budget,outputs,fodder for livestock,chakudya cha ziweto,,,chakudya cha ziweto +2024-01-15 20:34:08.423203+00,budget,outputs,manure for compost,manyowa a kompositi,,,manyowa ozipangila kuzinyalala +2024-01-15 20:34:08.423203+00,budget,outputs,meat,nyama,,,nyama +2024-01-15 20:34:08.423203+00,budget,outputs,milk,mkaka,,,mkaka +2024-01-15 20:34:08.423203+00,budget,outputs,money,ndalama,,,ndalama +2024-01-15 20:34:08.423203+00,budget,outputs,wood,nkhuni,,,matabwa +2024-01-15 20:34:08.423203+00,budget,,Produce Consumed,zokolola zomwe zagwiritsidwa ntchito,,,zokolola zomwe zagwiritsidwa ntchito +2024-01-15 20:34:08.423203+00,budget,,Quantity,kuchuluka,,,kuchuluka kwake +2024-01-15 20:34:08.423203+00,budget,,Saved Budgets,bajeti zosungidwa,,,bajeti zosungidwa +2024-01-15 20:34:08.423203+00,budget,,Save your budget,sungani bajeti yanu,,,sungani bajeti yanu +2024-01-15 20:34:08.423203+00,budget,,Select,sankhani,,,sankhani +2024-01-15 20:34:08.423203+00,budget,,Select Enterprise,sankhani mtundu wa bizinezi,,,sankhani makampani +2024-01-15 20:34:08.423203+00,budget,,Share as Picture,tumizani ngati chithunzi,,,gawani monga chithunzi +2024-01-15 20:34:08.423203+00,budget,,Share Budget,tumizani bajeti kwa ena,,,gawani bajeti +2024-01-15 20:34:08.423203+00,budget,,Show More,onetsani zambiri,,,onetsani zambiri +2024-01-15 20:34:08.423203+00,budget,,starting in,kuyambira mu,,,kuyambira +2024-01-15 20:34:08.423203+00,budget,,Summary,mwachidule,,,chidule +2024-01-15 20:34:08.423203+00,budget,,Title,mutu,,,mutu +2024-01-15 20:34:08.423203+00,budget,,Total,zonse pamodzi,,,zonse +2024-01-15 20:34:08.423203+00,budget,,Values,kuchuluka kwake,,,mfundo +2024-01-15 20:34:08.423203+00,budget,,What is your type of enterprise?,kodi mtundu wanu wabizinesi ndi uti?,,,kodi mtundu wanu wabizinesi ndi uti? +2024-01-15 20:34:08.423203+00,climate,,Analyse,Kuzukuta,,,Fufuza +2024-01-15 20:34:08.423203+00,climate,,Chart,Galafu,,,Zithunzi zazochita +2024-01-15 20:34:08.423203+00,climate,,Definition,Tanthauzo,,,Kumasulira +2024-01-15 20:34:08.423203+00,climate,,Hide Tool Options,Bisani Zipangizo,,,bisani zosankha za chida +2024-01-15 20:34:08.423203+00,climate,,Line,Mzere,,,Mzere +2024-01-15 20:34:08.423203+00,climate,,On average,pa mlingo wa chikatikati,,,pamodzi +2024-01-15 20:34:08.423203+00,climate,,out of,kuchokera pa,,,kuchokera +2024-01-15 20:34:08.423203+00,climate,,Print Version,zoti zikhoza kusindikizidwa,,,zolembedwa papepala +2024-01-15 20:34:08.423203+00,climate,,satisfy,kukhutitsidwa,,,kuthutila +2024-01-15 20:34:08.423203+00,climate,,Seasonal Total Rainfall,Mvula yonse ya nyengo,,,mvula yonse ya nyengo +2024-01-15 20:34:08.423203+00,climate,,Select a site,sankhani malo,,,sankhani malo +2024-01-15 20:34:08.423203+00,climate,,Share,tumizani,,,gawani +2024-01-15 20:34:08.423203+00,climate,,Share App Link,Tumizani progalamu,,,Gawani ulalo wa app +2024-01-15 20:34:08.423203+00,climate,,Share Chart,tumizani galafu,,,gawani chithunzi +2024-01-15 20:34:08.423203+00,climate,,Show Tool Options,onetsani zipangizo,,,onetsani zida zosiyana +2024-01-15 20:34:08.423203+00,climate,,Station,sitesheni,,,malo +2024-01-15 20:34:08.423203+00,climate,,Terciles,Magawo a zotsatira za kafukufuku,,,Misampha +2024-01-15 20:34:08.423203+00,climate,,Tools,zida,,,zida +2024-01-15 20:34:08.423203+00,climate,,Year,chaka,,,chaka +2024-01-15 20:34:08.423203+00,climate,,years out of every 10,zaka pa zaka 10 zilizonse,,,zaka 10 zilizonse +2024-01-15 20:34:08.423203+00,budget,,Edit Budget,Sinthani bajeti,,,Kupitamonso mu bajeti +2024-01-15 20:34:08.423203+00,budget,,Female Member,Membala wa mkazi,,,Membala wam'kazi +2024-01-15 20:34:08.423203+00,budget,,Import,Kutenga bajeti yokonzedwa,,,Kuika nji +2024-01-15 20:34:08.423203+00,budget,,Legend,Zizindikiro,,,Wosaiwalika +2024-01-15 20:34:08.423203+00,budget,,Male Member,Membala wa mamuna,,,Membala wam'muna +2024-01-15 20:34:08.423203+00,budget,,No outputs produce for consumption,Palibe zokolora zomwe zagwiritsidwa (zadyedwa) ntchito pakhomo,,,Palibe zokolola zakudya pakhomo +2024-01-15 20:34:08.423203+00,budget,,Total Consumed,Zonse zomwe zagwiritsidwa ntchito (zadyedwa),,,Zonse Zosewenzetsadwa +2024-01-15 20:34:08.423203+00,budget,,Total Produced,Zokolola zonse,,,Zonse Zokololedwa +2024-01-15 20:34:08.423203+00,common,,Are you sure you want to delete?,Mukutsimikiza kuti mufuna mufufute?,,,Kodi mutsimikiza kuti mufuna kufufuta? +2024-01-15 20:34:08.423203+00,extension,,Budget,Bajeti,,,Bajeti +2024-01-15 20:34:08.423203+00,extension,,Click on the button below to retry,dinani pa batani pansipa kuti muyesenso,,,dinizani pa batani pansipa kuti muyesenso +2024-01-15 20:34:08.423203+00,extension,,Discussions are held within WhatsApp groups. You can use the links below to join groups you are interested in,"Pa whatsapp group ya alangizi pamakhala zokambilana. ngati mukufuna kulowanawo gululi, ndinu olandilidwa ndipo tsatilani link pansipa",,,"Pa whatsapp group ya alangizi pamakhala zokambilana. ngati mukufuna kulowanawo gululi, ndinu olandilidwa ndipo tsatilani link pansipa" +2024-01-15 20:34:08.423203+00,extension,,Join,lowani,,,lowani +2024-01-15 20:34:08.423203+00,extension,,Joined,Alowa,,,Kulumikizana +2024-01-15 20:34:08.423203+00,extension,,Manual,Buku,,,Buku +2024-01-15 20:34:08.423203+00,extension,,Monitoring,Kuwunikira,,,Kuyanganira / Kuyendera +2024-01-15 20:34:08.423203+00,extension,,Privacy Policy,Mfundo zazinsinsi,,,Mfundo zazinsinsi +2024-01-15 20:34:08.423203+00,extension,,Probability,kuthekera koti zikhoza kuchitika,,,mpata wa zoyembekezeleka +2024-01-15 20:34:08.423203+00,extension,,Reload,bwezeraninso,,,bwezeraninso +2024-01-15 20:34:08.423203+00,extension,,Resources,zipangizo,,,zipangizo +2024-01-15 20:34:08.423203+00,extension,,Settings,zipangizo,,,makhalidwe +2024-01-15 20:34:08.423203+00,extension,,Something went wrong...,chinachake chinalakwika ...,,,chinachake chinalakwika ... +2024-01-15 20:34:08.423203+00,manual,,Activities,Zochitika,,,Zinchito +2024-01-15 20:34:08.423203+00,common,,Edit Profiles,Sinthani mbiri,,,Lembani bwino maprofaelo +2024-01-15 20:34:08.423203+00,common,,Extension,Ulangizi,,,Kukuza +2024-01-15 20:34:08.423203+00,common,,Farmer,Mlimi,,,Mlimi +2024-01-15 20:34:08.423203+00,common,,Hide Options,Bisani Zipangizo,,,Bimphani zosankha +2024-01-15 20:34:08.423203+00,common,,Name,Dzina,,,Dzina +2024-01-15 20:34:08.423203+00,common,,New Profile,Mbiri yatsopano,,,Profaelo yatsopano +2024-01-15 20:34:08.423203+00,common,,Select Country,Sankhani Dziko,,,Sankhani dziko +2024-01-15 20:34:08.423203+00,common,,Select Language,Sankhani chilankhulo,,,Sankhani Chilankhulidwe +2024-01-15 20:34:08.423203+00,common,,Show Options,onetsani zipangizo,,,Wonetsani zosankha +2024-01-15 20:34:08.423203+00,common,,Who is using?,Akugwiritsa ntchito ndi ndani?,,,Ndani akusewenzetsa +2024-01-15 20:34:08.423203+00,crop-probability,,Beans,Nyemba,,,Kaela +2024-01-15 20:34:08.423203+00,crop-probability,,Calculated by using FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station.,Kuwerengeredwa pogwiritsa ntchito FAO CLIMWAT 2.0 ya Cropwat ndi Cropwat 8.0 ndi uthenga wa zanyengo ya Nkhotakota Met Station.,,,Kuwerengela kusewenzetsa FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station. +2024-01-15 20:34:08.423203+00,crop-probability,,Cassava,Chinangwa,,,Chinangwa +2024-01-15 20:34:08.423203+00,crop-probability,,Chance of receiving the water requirement in the days to maturity for this crop variety,Mwayi olandira madzi amene mbewu imafunikira mu masiku amene mbewu imatenga kuti ikhwime pa mbewu zosiyanasiyana,,,Mpata wolandila madzi oyenera kuti mtundu wa mbeu iyi iche. +2024-01-15 20:34:08.423203+00,crop-probability,,Crop water requirement (mm),Kuchuluka kwa madzi amene mbewu imafuna,,,M'yeso wofunikira wa madzi ku mbeu iyi +2024-01-15 20:34:08.423203+00,crop-probability,,Days to maturity,Masiku omwe zimatenga kuti ziche,,,Masiku kuti iche +2024-01-15 20:34:08.423203+00,crop-probability,,"Longitude:34.26, Latitude: -12.91 Altitude: 500.","Longitude:34.26, Latitude: -12.91 Altitude: 500.",,,"Kutalika :34.26, Kutambasuka:12.91, Mtunda wa M'mwamba : 500" +2024-01-15 20:34:08.423203+00,crop-probability,,Probability of season start on or before below date,Kuthekera koti nyengo ikhoza kuyamba pa tsiku lili mmunsili,,,Mpata wa dzinja kuyamba pa loikika kapena isanafike tsikulo +2024-01-15 20:34:08.423203+00,crop-probability,,Pumpkins,Maungu,,,Matanje/Maungu +2024-01-15 20:34:08.423203+00,crop-probability,,Sunflower,Mpendadzuwa,,,M'penya dzuwa/nsendemu +2024-01-15 20:34:08.423203+00,crop-probability,,Variety,Mtundu wa mbewu,,,Mtundu wa mbeu +2024-01-15 20:34:08.423203+00,extension,,Climate,Nyengo,,,Nyengo +2024-01-15 20:34:08.423203+00,extension,,Options,Zisankho,,,Zosankha +2024-01-15 20:34:08.423203+00,manual,,After the season,Pakutha pa nyengo,,,Pambuyo pakutha kwa Nyengo +2024-01-15 20:34:08.423203+00,manual,,Step A,Gawo A,,,Gawo A +2024-01-15 20:34:08.423203+00,manual,,Step B,Gawo B,,,Gawo B +2024-01-15 20:34:08.423203+00,manual,,Step C,Gawo C,,,Gawo C +2024-01-15 20:34:08.423203+00,manual,,Step D,Gawo D,,,Gawo D +2024-01-15 20:34:08.423203+00,manual,,Step E,Gawo E,,,Gawo E +2024-01-15 20:34:08.423203+00,manual,,Step F,Gawo F,,,Gawo F +2024-01-15 20:34:08.423203+00,manual,,Step G,Gawo G,,,Gawo G +2024-01-15 20:34:08.423203+00,manual,,Step H,Gawo H,,,Gawo H +2024-01-15 20:34:08.423203+00,manual,,Step I,Gawo I,,,Gawo I +2024-01-15 20:34:08.423203+00,manual,,Step J,Gawo J,,,Gawo J +2024-01-15 20:34:08.423203+00,manual,,Step K,Gawo K,,,Gawo K +2024-01-15 20:34:08.423203+00,manual,,Step L,Gawo L,,,Gawo L +2024-01-15 20:34:08.423203+00,manual,,Compare different options and plans,Siyanitsani zisankho ndi ma pulani osiyanasiyana,,,Linganizani Zosankha +2024-01-15 20:34:08.423203+00,manual,,Create,Pangani,,,Pangani +2024-01-15 20:34:08.423203+00,manual,,Crop Info,Zokhudza mbeu,,,Zambiri za Mbeu +2024-01-15 20:34:08.423203+00,manual,,During the season,Mkatikati mwa sizoni/nyengo,,,Mkati mwa Nyengo +2024-01-15 20:34:08.423203+00,monitoring,,Forms,mafomu,,,mafomu +2024-01-15 20:34:08.423203+00,manual,,Farmers choose,Alimi amasankha,,,Alimi asankha +2024-01-15 20:34:08.423203+00,manual,,Historic climate,mbiri ya za nyengo,,,Mbiri ya za Nyengo +2024-01-15 20:34:08.423203+00,manual,,Info Sheet,Tsamba la mauthenga,,,Tsamba la zambiri +2024-01-15 20:34:08.423203+00,manual,,Is the climate changing?,Kodi nyengo ikusintha?,,,Kodi nyengo ikusintha? +2024-01-15 20:34:08.423203+00,manual,,Just before the season,Sizoni/nyengo isanayambe,,,Pafupi kuyamba kwa nyengo +2024-01-15 20:34:08.423203+00,manual,,Learn and improve,Kuphunzira ndi kukonza,,,Phunzilani ndi kusintha +2024-01-15 20:34:08.423203+00,manual,,Livelihood Info,Zokhudza njira zopezera ndalama,,,Zambiri ya makhalidwe +2024-01-15 20:34:08.423203+00,manual,,Livestock Info,Mauthenga a ziweto,,,Zambiri ya ziweto +2024-01-15 20:34:08.423203+00,manual,,Long before the season,Kutali ndi kuyamba kwa nyengo,,,M'malanga +2024-01-15 20:34:08.423203+00,manual,,Options by context,Zisankho potengera nkhani,,,Zosankha Munjirayake +2024-01-15 20:34:08.423203+00,manual,,Probability and Risk,Kuthekera and Ziopsezo,,,Mpata komanso ziophyezo +2024-01-15 20:34:08.423203+00,manual,,Quiz,Mayeso,,,Mafunso +2024-01-15 20:34:08.423203+00,manual,,Resource Allocation Map (RAM),Mapu ogawa zinthu zimene tikuyenera kugwiritsa ntchito,,,Chitunzi cha Zomwe tilinazo +2024-01-15 20:34:08.423203+00,manual,,Response to forecast,Yankho ku ulosi wa nyengo,,,Zomwe tichita ndi uthenga wa zanyengo +2024-01-15 20:34:08.423203+00,option,,Money,ndalama,,,ndalama +2024-01-15 20:34:08.423203+00,manual,,Review,Kuunikira,,,Ndemanga +2024-01-15 20:34:08.423203+00,manual,,Revisit,Kubwereza,,,Yenderansoni +2024-01-15 20:34:08.423203+00,manual,,Seasonal Calendar,Kalendala ya nyengo,,,Kalenda ya Nyengo +2024-01-15 20:34:08.423203+00,manual,,Seasonal forecast,ulosi wa nyengo,,,Uthenga wa zanyengo +2024-01-15 20:34:08.423203+00,manual,,Select and amend,sankhani ndipo sinthani,,,Sankhani ndi Kusintha +2024-01-15 20:34:08.423203+00,manual,,Short-term forecasts and warnings,Ulosi wakanthawi kochepa wa zanyengo ndi ma chenjezo,,,Uthenga wa zanyengo wa nthawi yochepa +2024-01-15 20:34:08.423203+00,manual,,The farmer decides,Mulimi amapanga chiganizo,,,Mlimi asankha zochita +2024-01-15 20:34:08.423203+00,manual,,What are the options for the farmer?,Zisankho zomwe mulimi alinazo ndi ziti?,,,Kodi nizosankha zotani mam'limi? +2024-01-15 20:34:08.423203+00,manual,,What are the probabilities and risks?,Kodi kuthera koti zikhoza kuchitika komanso ziopzezo zake ndi ziti?,,,Kodi pali m'pata wotani komanso ziophyezo? +2024-01-15 20:34:08.423203+00,manual,,What does the farmer currently do?,Kodi muliliyu amapanga chiyani pakadali pano?,,,Kodi m'limi achita zotani pa nthawi ino? +2024-01-15 20:34:08.423203+00,option,,Add benefit,Onjezerani phindu/ubwino,,,Ikani maphindu +2024-01-15 20:34:08.423203+00,option,,Add New Option,Onjezerani Chisankho china,,,Ikani zosankha zatsopano +2024-01-15 20:34:08.423203+00,resources,,Collection not found,Kutolera sizikupezeka,,,Zokonzedwa bwino sizikupezeka +2024-01-15 20:34:08.423203+00,budget,,fruits,zipatso,,,zipatso +2024-01-15 20:34:08.423203+00,budget,,livestock,ziweto,,,ziweto +2024-01-15 20:34:08.423203+00,option,,Benefits,Ubwino/Phindu,,,Maphindu +2024-01-15 20:34:08.423203+00,option,,Benefits and who,Ubwino/Phindu ndipo amapindula ndindani?,,,Maphindu ndipo kwayani +2024-01-15 20:34:08.423203+00,option,,Enter the practice for this option,Lembani zochitika za chisankho ichi,,,Ikani ndondomeko ya zosankha za apa +2024-01-15 20:34:08.423203+00,option,,Female,Mkazi,,,M'zimai +2024-01-15 20:34:08.423203+00,option,,Finish,Kumaliza,,,Tsilizani +2024-01-15 20:34:08.423203+00,option,,Gender,Mwamuna kapena Mkazi,,,Jenda +2024-01-15 20:34:08.423203+00,option,,High RF,Mvula yambiri,,,Mvula yambiri +2024-01-15 20:34:08.423203+00,option,,Investment,Zomwe talowetsa,,,Zolowamo +2024-01-15 20:34:08.423203+00,option,,Investment in terms of money and time,Ndalama ndi nthawi zomwe talowetsa,,,Ndalama Zolowamo komanso nthawi +2024-01-15 20:34:08.423203+00,option,,Low RF,Mvula yochepa,,,Mvula yochepekera +2024-01-15 20:34:08.423203+00,option,,Male,Mwamuna,,,M'zibambo +2024-01-15 20:34:08.423203+00,option,,Mid RF,Mvula yachikatikati,,,Mvula yapakatinkati +2024-01-15 20:34:08.423203+00,option,,Performance,Mene zachitira,,,Kakulidwe ka mbeu +2024-01-15 20:34:08.423203+00,crop-probability,,All,zonse,,,zonse +2024-01-15 20:34:08.423203+00,option,,"Performance in high, mid and low RF (rainfall)","Mene zachitira pomwe mvula inali yambiri, yochepa kapena yachikatikati",,,"Kakulidwe ka mbeu ngati mvula yachuluka, yachepekela komanso ngati niyapakatinkati" +2024-01-15 20:34:08.423203+00,option,,Practice,Zochitika,,,Nyira ya Malimidwe +2024-01-15 20:34:08.423203+00,option,,Risk,Ziopsezo,,,Chiophyezo +2024-01-15 20:34:08.423203+00,option,,Risk of practice (disadvantage),Kuipa (Ziopsezo) za chochitika ichi,,,Chiphyezo cha malimidwe awo +2024-01-15 20:34:08.423203+00,crop-probability,,Cowpeas,khobwe,,,nyemba +2024-01-15 20:34:08.423203+00,crop-probability,,Crop,mbewu,,,zokolora +2024-01-15 20:34:08.423203+00,crop-probability,,Crop Information,uthenga okhudza mbeu,,,mauthenga a mbeu +2024-01-15 20:34:08.423203+00,option,,Risks,Ziopsezo,,,Ziophyezo +2024-01-15 20:34:08.423203+00,option,,*This field is required,gawoli ndilofunika kuyankhidwa,,,Apa mpofunikira +2024-01-15 20:34:08.423203+00,crop-probability,,Groundnuts,mtedza,,,nshawa +2024-01-15 20:34:08.423203+00,option,,Time,Nthawi,,,Nthawi +2024-01-15 20:34:08.423203+00,crop-probability,,Maize,chimanga,,,chimanga +2024-01-15 20:34:08.423203+00,crop-probability,,Pigeon Peas,nandolo,,,nyamdolo +2024-01-15 20:34:08.423203+00,option,,Time (months),Nthawi (Miyezi),,,Minyezi +2024-01-15 20:34:08.423203+00,option,,Time to start benefiting,Nthawi imene ikutenga kuti tizayambe kupindula,,,Nthawi yoyamba kuona maphindu +2024-01-15 20:34:08.423203+00,crop-probability,,Rice,mpunga,,,mpunga +2024-01-15 20:34:08.423203+00,crop-probability,,Sorghum,mapila,,,mapira +2024-01-15 20:34:08.423203+00,crop-probability,,Soya Beans,soya,,,nyemba za soya +2024-01-15 20:34:08.423203+00,crop-probability,,Station,sitesheni,,,malo +2024-01-15 20:34:08.423203+00,option,,Who does it,Amachita ndi ndani?,,,Ndani achita izi +2024-01-15 20:34:08.423203+00,crop-probability,,Sweet Potatoes,mbatata ya kholowa,,,kandolo/kachamba +2024-01-15 20:34:08.423203+00,option,,Who does the practice,Amachita ichi ndi ndani?,,,Ndani achita ndondomeko iyi +2024-01-15 20:34:08.423203+00,budget,,Budget Tool,kupanga bajeti,,,njira ya kayendetsedwe ka chuma +2024-01-15 20:34:08.423203+00,budget,,For Sale,,,, +2024-01-15 20:34:08.423203+00,budget,,New Budget,,,, +2024-01-15 20:34:08.423203+00,budget,,Purchased,,,, +2024-01-15 20:34:08.423203+00,crop-probability,,Cotton,,,, +2024-01-15 20:34:08.423203+00,crop-probability,,Probability of season start on or before date,,,, +2024-01-15 20:34:08.423203+00,crop-probability,,Tobacco,,,, +2024-01-15 20:34:08.423203+00,option,,Activities,Zochitika,,,Zinchito +2024-01-15 20:34:08.423203+00,option,,Decisions,,,, +2024-01-15 20:34:08.423203+00,option,,Who does activity,,,, +2024-01-15 20:34:08.423203+00,option,,Who does the activity,,,, +2024-01-15 20:34:08.423203+00,option,,Who makes decisions,,,, +2024-01-15 20:34:08.423203+00,budget,,Add Card,,,, +2024-01-15 20:34:08.423203+00,budget,,Share App Link,Tumizani progalamu,,,Gawani ulalo wa app +2024-01-15 20:34:08.423203+00,climate,,Calculated with the date range of Start of rains and End of the rains,,,, +2024-01-15 20:34:08.423203+00,climate,,Capacity of 100mm on 1st March reduces 0.5 with evaporation rate of 5mm per day,,,, +2024-01-15 20:34:08.423203+00,climate,,First 3 days receiving rainfall amount of 20mm and not followed by 9-day dry spell for the next 21 days,,,, +2024-01-15 20:34:08.423203+00,climate,,Seasonal total rainfall calculated between the defined start and defined end of the season,,,, +2024-01-15 20:34:08.423203+00,manual,,Activity Flow Chart,,,, +2024-01-15 20:34:08.423203+00,manual,,Comparing different options and planning using Participatory Budgets,,,, +2024-01-15 20:34:08.423203+00,manual,,Introduction,,,, +2024-01-15 20:34:08.423203+00,manual,,Manual Requires Download,,,, +2024-01-15 20:34:08.423203+00,manual,,PICSA,PICSA,,,PICSA +2024-01-15 20:34:08.423203+00,manual,,What are the opportunities and risks?,,,, +2024-01-15 20:34:08.423203+00,monitoring,,Create New,,,, +2024-01-15 20:34:08.423203+00,monitoring,,Submissions,,,, +2024-01-15 20:34:08.423203+00,monitoring,,Submit,,,, +2024-01-15 20:34:08.423203+00,climate,,Above,,,, +2024-01-15 20:34:08.423203+00,climate,,Below,,,, \ No newline at end of file diff --git a/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql b/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql index c661792b0..df62907db 100644 --- a/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql +++ b/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql @@ -1,11 +1,17 @@ create table public.translations ( - id bigint generated by default as identity, created_at timestamp with time zone not null default now(), - en text null, + tool text not null, + context text not null default ''::text, + en text not null, + -- Additional languages + -- Uses ISO 3166 alpha-2 country code and ISO 639 Set 1 language code + -- https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes + -- https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes mw_ny text null, - sw text null, - tg text null, + ke_sw text null, + tj_tg text null, zm_ny text null, - constraint translations_pkey primary key (id) + -- Primary key generated as combination of tool, context and en text + constraint translations_pkey primary key (tool, context, en) ) tablespace pg_default; \ No newline at end of file From 43f81ee4f98dc6269735b044be42cd300e2a9839 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Mon, 15 Jan 2024 13:24:31 -0800 Subject: [PATCH 6/8] chore: update types --- apps/picsa-server/supabase/types/index.ts | 94 ++++------------------- 1 file changed, 15 insertions(+), 79 deletions(-) diff --git a/apps/picsa-server/supabase/types/index.ts b/apps/picsa-server/supabase/types/index.ts index 5946a1596..cb5a3d4c9 100644 --- a/apps/picsa-server/supabase/types/index.ts +++ b/apps/picsa-server/supabase/types/index.ts @@ -197,99 +197,35 @@ export interface Database { } ] } - resources_child: { - Row: { - country_code: string | null - created_at: string - id: number - language_code: string | null - parent: string - storage_file: string - tag: string | null - } - Insert: { - country_code?: string | null - created_at?: string - id?: number - language_code?: string | null - parent: string - storage_file: string - tag?: string | null - } - Update: { - country_code?: string | null - created_at?: string - id?: number - language_code?: string | null - parent?: string - storage_file?: string - tag?: string | null - } - Relationships: [ - { - foreignKeyName: "resources_child_parent_fkey" - columns: ["parent"] - referencedRelation: "resources" - referencedColumns: ["id"] - }, - { - foreignKeyName: "resources_child_storage_file_fkey" - columns: ["storage_file"] - referencedRelation: "objects" - referencedColumns: ["id"] - }, - { - foreignKeyName: "resources_child_storage_file_fkey" - columns: ["storage_file"] - referencedRelation: "storage_objects" - referencedColumns: ["id"] - } - ] - } - users: { - Row: { - created_at: string - first_name: string | null - id: number - } - Insert: { - created_at?: string - first_name?: string | null - id?: number - } - Update: { - created_at?: string - first_name?: string | null - id?: number - } - Relationships: [] - } translations: { Row: { + context: string created_at: string - en: string | null - id: number + en: string + ke_sw: string | null mw_ny: string | null - sw: string | null - tg: string | null + tj_tg: string | null + tool: string zm_ny: string | null } Insert: { + context?: string created_at?: string - en?: string | null - id?: number + en: string + ke_sw?: string | null mw_ny?: string | null - sw?: string | null - tg?: string | null + tj_tg?: string | null + tool: string zm_ny?: string | null } Update: { + context?: string created_at?: string - en?: string | null - id?: number + en?: string + ke_sw?: string | null mw_ny?: string | null - sw?: string | null - tg?: string | null + tj_tg?: string | null + tool?: string zm_ny?: string | null } Relationships: [] From a19df04e6452e4b07305d570a0047884a119da50 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Mon, 15 Jan 2024 14:05:29 -0800 Subject: [PATCH 7/8] refactor: translation id generator --- .../edit/translations-edit.component.html | 25 +- .../pages/edit/translations-edit.component.ts | 24 +- .../translations/translations.service.ts | 50 +- .../supabase/data/translations_rows.csv | 446 ++++-------------- ...240102153452_translations_table_create.sql | 6 +- apps/picsa-server/supabase/types/index.ts | 9 +- 6 files changed, 160 insertions(+), 400 deletions(-) diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html index 479112177..1a9431b6a 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html @@ -18,12 +18,12 @@

Edit Translations

- - + +
- - + +
@@ -32,16 +32,15 @@

Edit Translations

} @else if(dataLoadError) { -
{{dataLoadError}}
+
{{ dataLoadError }}
} @else {
Loading...
- } - @if(editActionFeedbackMessage){ -
{{editActionFeedbackMessage}}
- } - @if(translationRow){ + } @if(editActionFeedbackMessage){ +
{{ editActionFeedbackMessage }}
+ } @if(translationRow){

Delete this Translation

- + } -
\ No newline at end of file +
diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts index 306c74b67..344ccce73 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ActivatedRoute,Router } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { RouterModule } from '@angular/router'; // eslint-disable-next-line @nx/enforce-module-boundaries import type { Database } from '@picsa/server-types'; @@ -15,7 +15,7 @@ type ITranslationEntry = Database['public']['Tables']['translations']['Row']; @Component({ selector: 'dashboard-translations-edit', standalone: true, - imports: [CommonModule, DashboardMaterialModule, FormsModule, ReactiveFormsModule,RouterModule], + imports: [CommonModule, DashboardMaterialModule, FormsModule, ReactiveFormsModule, RouterModule], templateUrl: './translations-edit.component.html', styleUrls: ['./translations-edit.component.scss'], }) @@ -52,15 +52,17 @@ export class TranslationsEditComponent { this.editActionFeedbackMessage = 'Failed to edit translation.'; }); } - deleteTranslation(id:number){ - this.service.deleteTranslationById(id).then((data) => { - if (data === 'Deleted Successfully') { - this.router.navigate([`/translations`]); - } - }) - .catch((error) => { - console.error('Error deleting translation:', error); - }); + deleteTranslation(id: string) { + this.service + .deleteTranslationById(id) + .then((data) => { + if (data === 'Deleted Successfully') { + this.router.navigate([`/translations`]); + } + }) + .catch((error) => { + console.error('Error deleting translation:', error); + }); } async openTranslationDeleteDialog() { //failed attempt to use a shared delete model diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts index 539501dfe..0fc580f6a 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/translations.service.ts @@ -14,8 +14,7 @@ export interface IResourceStorageEntry extends IStorageEntry { } @Injectable({ providedIn: 'root' }) export class TranslationDashboardService extends PicsaAsyncService { - - public translations: ITranslationRow[] = []; + public translations: ITranslationRow[] = []; public get table() { return this.supabaseService.db.table('translations'); @@ -30,7 +29,6 @@ export class TranslationDashboardService extends PicsaAsyncService { await this.listTranslations(); } - public async listTranslations() { const { data, error } = await this.supabaseService.db.table('translations').select<'*', ITranslationRow>('*'); if (error) { @@ -38,18 +36,17 @@ export class TranslationDashboardService extends PicsaAsyncService { } this.translations = data || []; } - // update a translation record by ID - public async updateTranslationById(id: number, updatedData: Partial): Promise { + public async updateTranslationById(id: string, updatedData: Partial): Promise { const { data, error } = await this.supabaseService.db.table('translations').update(updatedData).eq('id', id); if (error) { throw error; } - return "Updated successfully"; + return 'Updated successfully'; } // Fetch a translation record by ID - public async getTranslationById(id: number): Promise { + public async getTranslationById(id: string): Promise { const { data, error } = await this.supabaseService.db.table('translations').select('*').eq('id', id).single(); if (error) { throw error; @@ -57,30 +54,31 @@ export class TranslationDashboardService extends PicsaAsyncService { return data; } - //delete function - public async deleteTranslationById(id: number): Promise { - const { error } = await this.supabaseService - .db - .table('translations') - .delete() - .eq('id', id); - + //delete function + public async deleteTranslationById(id: string): Promise { + const { error } = await this.supabaseService.db.table('translations').delete().eq('id', id); + if (error) { throw error; } - return "Deleted Successfully" + return 'Deleted Successfully'; } -// In your TranslationDashboardService -public async addTranslation(translation: Partial): Promise { - const { data, error } = await this.supabaseService - .db - .table('translations') - .insert([translation]); + // In your TranslationDashboardService + public async addTranslation(translation: Partial): Promise { + translation.id = this.generateId(translation as ITranslationRow); + const { data, error } = await this.supabaseService.db.table('translations').insert([translation]); + + if (error) { + throw error; + } + return 'Added successfully'; + } - if (error) { - throw error; + /** Composite id generated by combination of row metadata and en text */ + private generateId(row: ITranslationRow) { + // Convert to lower case and remove non-alphanumeric characters so that minor text differences ignored + const textId = row.en.toLowerCase().replace(/[^a-z0-9]/gi, ''); + return `${row.tool}-${row.context || ''}-${textId}`; } - return "Added successfully"; } -} \ No newline at end of file diff --git a/apps/picsa-server/supabase/data/translations_rows.csv b/apps/picsa-server/supabase/data/translations_rows.csv index 5837fb986..1a78e5cb5 100644 --- a/apps/picsa-server/supabase/data/translations_rows.csv +++ b/apps/picsa-server/supabase/data/translations_rows.csv @@ -1,345 +1,101 @@ -created_at,tool,context,en,mw_ny,ke_sw,tj_tg,zm_ny -2024-01-15 20:34:08.423203+00,budget,,Add Female Member,Onjezerani membala wa mkazi,,,Ikamponi membala wam'kazi -2024-01-15 20:34:08.423203+00,budget,,Add Male Member,Onjezerani membala wa mamuna,,,Ikamponi membala wam'muna -2024-01-15 20:34:08.423203+00,budget,,Balance,Ndalama zotsala,,,Zokharira -2024-01-15 20:34:08.423203+00,budget,,Consumed,Zodyedwa,,,Zosewenzetsedwa -2024-01-15 20:34:08.423203+00,budget,,Cost,Mtengo,,,Mtengo -2024-01-15 20:34:08.423203+00,budget,,Create New Budget,Pangani bajeti yatsopano,,,Pangani bajeti yatsopano -2024-01-15 20:34:08.423203+00,budget,,Days,Masiku,,,Masiku -2024-01-15 20:34:08.423203+00,budget,,Decrease Scale,Kuchepetsa mlingo,,,Chepetsa kukula -2024-01-15 20:34:08.423203+00,budget,,description,mafotokozeredwe,,,kaonekeswe -2024-01-15 20:34:08.423203+00,budget,,Description (optional),Kufotokozera (Mukhoza osalemba),,,Kufotokozera (posankha) -2024-01-15 20:34:08.423203+00,budget,,Enterprise,bizinesi,,,malonda -2024-01-15 20:34:08.423203+00,budget,,Family,banja,,,banja -2024-01-15 20:34:08.423203+00,budget,,Family Labour,ntchito yogwiridwa ndi amubanjamo,,,ntchito ya banja -2024-01-15 20:34:08.423203+00,budget,,How long is your budget for?,bajeti yanu imakhala yayitali bwanji?,,,bajeti yanu imakhala yayitali motani? -2024-01-15 20:34:08.423203+00,budget,,Import Budget Code,lowetsani nambala ya bajeti,,,nambala ya bajeti -2024-01-15 20:34:08.423203+00,budget,,Increase Scale,onjezerani mulingo,,,kuchulukitsa -2024-01-15 20:34:08.423203+00,budget,,Inputs,zolowa,,,zolowa -2024-01-15 20:34:08.423203+00,budget,,Outputs,zotuluka,,,zotuluka -2024-01-15 20:34:08.423203+00,budget,activities,apply fertiliser,kuthira feteleza,,,thirani fatatleza -2024-01-15 20:34:08.423203+00,budget,activities,apply pesticide,kopopela mankhwala a tizilombo,,,thirani mankhwala -2024-01-15 20:34:08.423203+00,budget,activities,bagging,kupakila mmatumba,,,kuika m'mathumba -2024-01-15 20:34:08.423203+00,budget,activities,banding,kubandila,,,kumangilira -2024-01-15 20:34:08.423203+00,budget,activities,build housing,kumanga makola,,,kumanga nyumba -2024-01-15 20:34:08.423203+00,budget,activities,compost manure making,kupanga manyowa,,,kupanga manyowa kuzinyalala -2024-01-15 20:34:08.423203+00,budget,activities,dipping,kupanga dipi ziweto,,,kupaka -2024-01-15 20:34:08.423203+00,budget,activities,feeding livestock,kudyetsa ziweto,,,kudyetsa ziweto -2024-01-15 20:34:08.423203+00,budget,activities,harvesting,kukolola,,,kukolola -2024-01-15 20:34:08.423203+00,budget,activities,land clearing,kusosa,,,kukonza malo -2024-01-15 20:34:08.423203+00,budget,activities,marketing and selling,kutsatsa ndi kugulitsa,,,kutsatsa ndi kugulitsa -2024-01-15 20:34:08.423203+00,budget,activities,mulching,kuphimbila,,,mochi -2024-01-15 20:34:08.423203+00,budget,activities,ploughing,kugalauza,,,kugaula -2024-01-15 20:34:08.423203+00,budget,activities,post-harvest handling,kusamala zokolora,,,kagwiridwe pambuyo po kolola -2024-01-15 20:34:08.423203+00,budget,activities,provide supplements,kupereka zakudya zoonjezera,,,perekani zothandizila -2024-01-15 20:34:08.423203+00,budget,activities,provide water,kupereka madzi ku ziweto,,,perekani madzi -2024-01-15 20:34:08.423203+00,budget,activities,purchase,kugula,,,gulani -2024-01-15 20:34:08.423203+00,budget,activities,relocation,kusamutsa ziweso,,,kusamukira -2024-01-15 20:34:08.423203+00,budget,activities,shelling,kutonola/kusola,,,kutongola -2024-01-15 20:34:08.423203+00,budget,activities,sowing,kufesa,,,kufesa -2024-01-15 20:34:08.423203+00,budget,activities,storage,kusunga,,,kasungidwe -2024-01-15 20:34:08.423203+00,budget,activities,threshing,kupuntha,,,kupuntha -2024-01-15 20:34:08.423203+00,budget,activities,transport,transipoti,,,mayendedwe -2024-01-15 20:34:08.423203+00,budget,activities,transport livestock,kunyamula ziweto,,,kunyamula ziweto -2024-01-15 20:34:08.423203+00,budget,activities,vaccinate,kupereka katemela,,,katemera -2024-01-15 20:34:08.423203+00,budget,activities,value addition,kuwonjezera phindu,,,kuwonjezera phindu -2024-01-15 20:34:08.423203+00,budget,activities,watering,kuthirira,,,kuthirira -2024-01-15 20:34:08.423203+00,budget,activities,weeding,kupalira,,,kupalira -2024-01-15 20:34:08.423203+00,common,buttons,Cancel,thetsani,,,kutseka -2024-01-15 20:34:08.423203+00,common,buttons,Close,Tsekani,,,Tsekani -2024-01-15 20:34:08.423203+00,common,buttons,Next,pitani tsamba lina,,,ina -2024-01-15 20:34:08.423203+00,common,buttons,Save,sungani,,,sungani -2024-01-15 20:34:08.423203+00,common,buttons,Back,Kumbuyo,,,Bwelerani -2024-01-15 20:34:08.423203+00,common,buttons,Delete,Kufufuta,,,Fafanizani -2024-01-15 20:34:08.423203+00,common,buttons,Edit,Sinthani,,,Lembani bwino -2024-01-15 20:34:08.423203+00,climate,chart,End,Pothera,,,Tsirizani -2024-01-15 20:34:08.423203+00,climate,chart,End of Season,Mapeto a nyengo,,,Kutha kwa nyengo -2024-01-15 20:34:08.423203+00,climate,chart,End of season is defined as the last day in the season (1st October - 30th April) with more than 10mm of rainfall.,Mapeto a nyengo akutanthauza tsiku lomaliza mu nyengo (1 okotobala mpaka 30 epulo) lomwe kwagwa mvula yoposa 10mm,,,Kutha kwa nyengo akutanthauza tsiku lomaliza mu nyengo (1 okotobala mpaka 30 epulo) lomwe kwagwa mvula yoposa 10mm -2024-01-15 20:34:08.423203+00,climate,chart,Length,kutalika,,,kutalika -2024-01-15 20:34:08.423203+00,climate,chart,Length of Season,Kutalika kwa nyengo,,,Kutalika kwa nyengo -2024-01-15 20:34:08.423203+00,climate,chart,Length of season is defined as the total days from the start of the season until the end of the season as defined,Lutalika kwa nyengo kutanthauza masiku onse kuyambira pachiyambi mpaka pamapeto a nyengo monga momwe zafotokozedwa,,,Kutalika kwa nyengo kutanthauza masiku onse kuyambira pachiyambi mpaka pamapeto a nyengo monga momwe zafotokozedwa -2024-01-15 20:34:08.423203+00,climate,chart,Rain,Mvula,,,Mvula -2024-01-15 20:34:08.423203+00,climate,chart,Seasonal Rainfall,Mvula ya mu nyengo,,,Mvula ya mu nyengo -2024-01-15 20:34:08.423203+00,climate,chart,Seasonal rainfall is defined as the total rain recorded from the start of the season until the end of the season,Mvula ya mu nyengo imatanthauza mvula yonse yomwe yalembedwa kuti yagwa kuyambira pachiyambi mpaka pa mapeto a nyengoyo,,,Mvula ya mu nyengo imatanthauza mvula yonse yomwe yalembedwa kuti yagwa kuyambira pachiyambi mpaka pa mapeto a nyengoyo -2024-01-15 20:34:08.423203+00,climate,chart,Seasonal Total Rainfall (mm),Mvula yathu yathunthu ya nyengo yapadera (mm),,,Mvula yathu yathunthu ya nyengo yapadera (mm) -2024-01-15 20:34:08.423203+00,climate,chart,Start,Kuyamba,,,Suyamba -2024-01-15 20:34:08.423203+00,climate,chart,Start of Season,chiyambi cha nyengo,,,chiyambi cha nyengo -2024-01-15 20:34:08.423203+00,climate,chart,Start of season is defined as the first occasion (from 1st October) with more than 25mm in a 3 day period and no dry spell of 10 days or more within the following 30 days,chiymabi cha nyengo chimatanthauza mvula yoyamba (kuyambira pa 1 okotobala) yomwe yagwa kuposa mlingo wa 25mm mu masiku atatu ndipo kuti panalibe ng'amba ya masiku oposa khumi mu masiku makumi atatu kuchokera nthawi yomwe mvula inagwa.,,,chiymabi cha nyengo chimatanthauza mvula yoyamba (kuyambira pa 1 okotobala) yomwe yagwa kuposa mlingo wa 25mm mu masiku atatu ndipo kuti panalibe ng'amba ya masiku oposa khumi mu masiku makumi atatu kuchokera nthawi yomwe mvula inagwa. -2024-01-15 20:34:08.423203+00,climate,chart,Extreme,,,, -2024-01-15 20:34:08.423203+00,climate,chart,Extreme Rainfall,,,, -2024-01-15 20:34:08.423203+00,climate,chart,Extreme rainfall are days where the total amount of rain exceeds the 95th Percentile,,,, -2024-01-15 20:34:08.423203+00,climate,chart,Frequency of Extreme,,,, -2024-01-15 20:34:08.423203+00,budget,day_1,Monday,Lolemba,,,Pa lolemba -2024-01-15 20:34:08.423203+00,budget,day_2,Tuesday,Lachiwiri,,,Pa chiwiri -2024-01-15 20:34:08.423203+00,budget,day_3,Wednesday,Lachitatu,,,Pa chitatu -2024-01-15 20:34:08.423203+00,budget,day_4,Thursday,lachinayi,,,Pa chinai -2024-01-15 20:34:08.423203+00,budget,day_5,Friday,Lachisanu,,,Pa chisanu -2024-01-15 20:34:08.423203+00,budget,day_6,Saturday,Loweruka,,,Pa chiweru -2024-01-15 20:34:08.423203+00,budget,day_7,Sunday,Lamulungu,,,Pa sondo -2024-01-15 20:34:08.423203+00,budget,enterprise,afforestation,kudzala mitengo,,,kubyala mitengo -2024-01-15 20:34:08.423203+00,budget,enterprise,cattle,ng'ombe,,,ng'ombe -2024-01-15 20:34:08.423203+00,budget,enterprise,chicken,nkhuku,,,nkhuku -2024-01-15 20:34:08.423203+00,budget,enterprise,cowpeas,khobwe,,,nyemba -2024-01-15 20:34:08.423203+00,budget,enterprise,ducks,abakha,,,abakha -2024-01-15 20:34:08.423203+00,budget,enterprise,fish,nsomba,,,nsomba -2024-01-15 20:34:08.423203+00,budget,enterprise,goats,mbuzi,,,mbuzi -2024-01-15 20:34:08.423203+00,budget,enterprise,groundnuts,mtedza,,,nshawa -2024-01-15 20:34:08.423203+00,budget,enterprise,guinea fowl,nkhanga,,,nkhanga -2024-01-15 20:34:08.423203+00,budget,enterprise,maize,chimanga,,,chimanga -2024-01-15 20:34:08.423203+00,budget,enterprise,mixed,kusakaniza,,,kusakaniza -2024-01-15 20:34:08.423203+00,budget,enterprise,onions,anyezi,,,anyezi -2024-01-15 20:34:08.423203+00,budget,enterprise,paw-paw,papaya,,,paw-paw -2024-01-15 20:34:08.423203+00,budget,enterprise,pigeon peas,nandolo,,,nyamdolo -2024-01-15 20:34:08.423203+00,budget,enterprise,pigs,nkhumba,,,nkhumba -2024-01-15 20:34:08.423203+00,budget,enterprise,rice,mpunga,,,mpunga -2024-01-15 20:34:08.423203+00,budget,enterprise,sheep,nkhosa,,,mbelele -2024-01-15 20:34:08.423203+00,budget,enterprise,sorghum,mapila,,,mapira -2024-01-15 20:34:08.423203+00,budget,enterprise,soya beans,soya,,,nyemba za soya -2024-01-15 20:34:08.423203+00,budget,enterprise,sweet potatoes,mbatata ya kholowa,,,kandolo/kachamba -2024-01-15 20:34:08.423203+00,budget,enterprise,tomatoes,tomato,,,chimate -2024-01-15 20:34:08.423203+00,budget,enterprise,watermelon,mavwende,,,vwembe -2024-01-15 20:34:08.423203+00,budget,inputs,bags,matumba,,,matumba -2024-01-15 20:34:08.423203+00,budget,inputs,chemicals,mankhwala,,,mankhwala -2024-01-15 20:34:08.423203+00,budget,inputs,feed,zakudza za ziweto,,,zakudya zaziweto (Kudyetsa) -2024-01-15 20:34:08.423203+00,budget,inputs,fertiliser,feteleza,,,fataleza -2024-01-15 20:34:08.423203+00,budget,inputs,housing,khola,,,mosungila -2024-01-15 20:34:08.423203+00,budget,inputs,labour - paid,"ganyu ",,,ntchito - yolipidwa -2024-01-15 20:34:08.423203+00,budget,inputs,manure sacks,matumba a manyowa,,,masaka ya manyowa -2024-01-15 20:34:08.423203+00,budget,inputs,manure wheelbarrows,wilibala ya manyowa,,,wilibala ya manyowa -2024-01-15 20:34:08.423203+00,budget,inputs,ox cart,ngolo,,,kochikali/ ngolo -2024-01-15 20:34:08.423203+00,budget,inputs,pot for storage,mphika wongula zinthu,,,mphika posungira -2024-01-15 20:34:08.423203+00,budget,inputs,protective equipment,zida zozitetezera pogwira ntchito,,,zida zoteteza -2024-01-15 20:34:08.423203+00,budget,inputs,seeds,mbewu,,,mbewu -2024-01-15 20:34:08.423203+00,budget,inputs,sheller hire,kupanga hayala chida chotonolera,,,makina otongolera olipilidwa -2024-01-15 20:34:08.423203+00,budget,inputs,supplements,zakudya za ziweto zoowonjezera,,,zothandizila -2024-01-15 20:34:08.423203+00,budget,inputs,tools,zida,,,zida -2024-01-15 20:34:08.423203+00,budget,inputs,tractor hire,kubweleka thirakitale,,,ganyu ya thalakita -2024-01-15 20:34:08.423203+00,budget,inputs,transportation hire,hayala ya thiransipoti,,,mayendedwe olipira -2024-01-15 20:34:08.423203+00,budget,inputs,vaccine,katemera,,,katemera -2024-01-15 20:34:08.423203+00,budget,month_1,January,januwale,,,januwale -2024-01-15 20:34:08.423203+00,budget,month_1_short,Jan,januwale,,,jan -2024-01-15 20:34:08.423203+00,budget,month_10,October,okotabala,,,okotabala -2024-01-15 20:34:08.423203+00,budget,month_10_short,Oct,oko,,,oko -2024-01-15 20:34:08.423203+00,budget,month_11,November,novembala,,,novembala -2024-01-15 20:34:08.423203+00,budget,month_11_short,Nov,novembala,,,nov -2024-01-15 20:34:08.423203+00,budget,month_12,December,disembala,,,disembala -2024-01-15 20:34:08.423203+00,budget,month_12_short,Dec,disembala,,,dis -2024-01-15 20:34:08.423203+00,budget,month_2,February,febuluwale,,,febuluwale -2024-01-15 20:34:08.423203+00,budget,month_2_short,Feb,febuluwale,,,feb -2024-01-15 20:34:08.423203+00,budget,month_3,March,marichi,,,marichi -2024-01-15 20:34:08.423203+00,budget,month_3_short,Mar,marichi,,,mar -2024-01-15 20:34:08.423203+00,budget,month_4,April,epulo,,,epulo -2024-01-15 20:34:08.423203+00,budget,month_4_short,Apr,epulo,,,epu -2024-01-15 20:34:08.423203+00,budget,month_5_short,May,meyi,,,meyi -2024-01-15 20:34:08.423203+00,budget,month_6,June,juni,,,juni -2024-01-15 20:34:08.423203+00,budget,month_6_short,Jun,juni,,,jun -2024-01-15 20:34:08.423203+00,budget,month_7,July,julayi,,,julayi -2024-01-15 20:34:08.423203+00,budget,month_7_short,Jul,Julaye,,,jul -2024-01-15 20:34:08.423203+00,budget,month_8,August,ogasiti,,,ogasiti -2024-01-15 20:34:08.423203+00,budget,month_8_short,Aug,ogasiti,,,oga -2024-01-15 20:34:08.423203+00,budget,month_9,September,sepitembala,,,sepitembala -2024-01-15 20:34:08.423203+00,budget,month_9_short,Sep,sepitembala,,,sep -2024-01-15 20:34:08.423203+00,budget,other,add custom,onjezani zipangizo,,,kuikapo m'sonkho -2024-01-15 20:34:08.423203+00,budget,other,family labour,ntchito yogwiridwa ndi amubanjamo,,,ntchito ya banja -2024-01-15 20:34:08.423203+00,budget,outputs,crop,mbewu,,,zokolora -2024-01-15 20:34:08.423203+00,budget,outputs,eggs,mazira,,,mazira -2024-01-15 20:34:08.423203+00,budget,outputs,fodder for livestock,chakudya cha ziweto,,,chakudya cha ziweto -2024-01-15 20:34:08.423203+00,budget,outputs,manure for compost,manyowa a kompositi,,,manyowa ozipangila kuzinyalala -2024-01-15 20:34:08.423203+00,budget,outputs,meat,nyama,,,nyama -2024-01-15 20:34:08.423203+00,budget,outputs,milk,mkaka,,,mkaka -2024-01-15 20:34:08.423203+00,budget,outputs,money,ndalama,,,ndalama -2024-01-15 20:34:08.423203+00,budget,outputs,wood,nkhuni,,,matabwa -2024-01-15 20:34:08.423203+00,budget,,Produce Consumed,zokolola zomwe zagwiritsidwa ntchito,,,zokolola zomwe zagwiritsidwa ntchito -2024-01-15 20:34:08.423203+00,budget,,Quantity,kuchuluka,,,kuchuluka kwake -2024-01-15 20:34:08.423203+00,budget,,Saved Budgets,bajeti zosungidwa,,,bajeti zosungidwa -2024-01-15 20:34:08.423203+00,budget,,Save your budget,sungani bajeti yanu,,,sungani bajeti yanu -2024-01-15 20:34:08.423203+00,budget,,Select,sankhani,,,sankhani -2024-01-15 20:34:08.423203+00,budget,,Select Enterprise,sankhani mtundu wa bizinezi,,,sankhani makampani -2024-01-15 20:34:08.423203+00,budget,,Share as Picture,tumizani ngati chithunzi,,,gawani monga chithunzi -2024-01-15 20:34:08.423203+00,budget,,Share Budget,tumizani bajeti kwa ena,,,gawani bajeti -2024-01-15 20:34:08.423203+00,budget,,Show More,onetsani zambiri,,,onetsani zambiri -2024-01-15 20:34:08.423203+00,budget,,starting in,kuyambira mu,,,kuyambira -2024-01-15 20:34:08.423203+00,budget,,Summary,mwachidule,,,chidule -2024-01-15 20:34:08.423203+00,budget,,Title,mutu,,,mutu -2024-01-15 20:34:08.423203+00,budget,,Total,zonse pamodzi,,,zonse -2024-01-15 20:34:08.423203+00,budget,,Values,kuchuluka kwake,,,mfundo -2024-01-15 20:34:08.423203+00,budget,,What is your type of enterprise?,kodi mtundu wanu wabizinesi ndi uti?,,,kodi mtundu wanu wabizinesi ndi uti? -2024-01-15 20:34:08.423203+00,climate,,Analyse,Kuzukuta,,,Fufuza -2024-01-15 20:34:08.423203+00,climate,,Chart,Galafu,,,Zithunzi zazochita -2024-01-15 20:34:08.423203+00,climate,,Definition,Tanthauzo,,,Kumasulira -2024-01-15 20:34:08.423203+00,climate,,Hide Tool Options,Bisani Zipangizo,,,bisani zosankha za chida -2024-01-15 20:34:08.423203+00,climate,,Line,Mzere,,,Mzere -2024-01-15 20:34:08.423203+00,climate,,On average,pa mlingo wa chikatikati,,,pamodzi -2024-01-15 20:34:08.423203+00,climate,,out of,kuchokera pa,,,kuchokera -2024-01-15 20:34:08.423203+00,climate,,Print Version,zoti zikhoza kusindikizidwa,,,zolembedwa papepala -2024-01-15 20:34:08.423203+00,climate,,satisfy,kukhutitsidwa,,,kuthutila -2024-01-15 20:34:08.423203+00,climate,,Seasonal Total Rainfall,Mvula yonse ya nyengo,,,mvula yonse ya nyengo -2024-01-15 20:34:08.423203+00,climate,,Select a site,sankhani malo,,,sankhani malo -2024-01-15 20:34:08.423203+00,climate,,Share,tumizani,,,gawani -2024-01-15 20:34:08.423203+00,climate,,Share App Link,Tumizani progalamu,,,Gawani ulalo wa app -2024-01-15 20:34:08.423203+00,climate,,Share Chart,tumizani galafu,,,gawani chithunzi -2024-01-15 20:34:08.423203+00,climate,,Show Tool Options,onetsani zipangizo,,,onetsani zida zosiyana -2024-01-15 20:34:08.423203+00,climate,,Station,sitesheni,,,malo -2024-01-15 20:34:08.423203+00,climate,,Terciles,Magawo a zotsatira za kafukufuku,,,Misampha -2024-01-15 20:34:08.423203+00,climate,,Tools,zida,,,zida -2024-01-15 20:34:08.423203+00,climate,,Year,chaka,,,chaka -2024-01-15 20:34:08.423203+00,climate,,years out of every 10,zaka pa zaka 10 zilizonse,,,zaka 10 zilizonse -2024-01-15 20:34:08.423203+00,budget,,Edit Budget,Sinthani bajeti,,,Kupitamonso mu bajeti -2024-01-15 20:34:08.423203+00,budget,,Female Member,Membala wa mkazi,,,Membala wam'kazi -2024-01-15 20:34:08.423203+00,budget,,Import,Kutenga bajeti yokonzedwa,,,Kuika nji -2024-01-15 20:34:08.423203+00,budget,,Legend,Zizindikiro,,,Wosaiwalika -2024-01-15 20:34:08.423203+00,budget,,Male Member,Membala wa mamuna,,,Membala wam'muna -2024-01-15 20:34:08.423203+00,budget,,No outputs produce for consumption,Palibe zokolora zomwe zagwiritsidwa (zadyedwa) ntchito pakhomo,,,Palibe zokolola zakudya pakhomo -2024-01-15 20:34:08.423203+00,budget,,Total Consumed,Zonse zomwe zagwiritsidwa ntchito (zadyedwa),,,Zonse Zosewenzetsadwa -2024-01-15 20:34:08.423203+00,budget,,Total Produced,Zokolola zonse,,,Zonse Zokololedwa -2024-01-15 20:34:08.423203+00,common,,Are you sure you want to delete?,Mukutsimikiza kuti mufuna mufufute?,,,Kodi mutsimikiza kuti mufuna kufufuta? -2024-01-15 20:34:08.423203+00,extension,,Budget,Bajeti,,,Bajeti -2024-01-15 20:34:08.423203+00,extension,,Click on the button below to retry,dinani pa batani pansipa kuti muyesenso,,,dinizani pa batani pansipa kuti muyesenso -2024-01-15 20:34:08.423203+00,extension,,Discussions are held within WhatsApp groups. You can use the links below to join groups you are interested in,"Pa whatsapp group ya alangizi pamakhala zokambilana. ngati mukufuna kulowanawo gululi, ndinu olandilidwa ndipo tsatilani link pansipa",,,"Pa whatsapp group ya alangizi pamakhala zokambilana. ngati mukufuna kulowanawo gululi, ndinu olandilidwa ndipo tsatilani link pansipa" -2024-01-15 20:34:08.423203+00,extension,,Join,lowani,,,lowani -2024-01-15 20:34:08.423203+00,extension,,Joined,Alowa,,,Kulumikizana -2024-01-15 20:34:08.423203+00,extension,,Manual,Buku,,,Buku -2024-01-15 20:34:08.423203+00,extension,,Monitoring,Kuwunikira,,,Kuyanganira / Kuyendera -2024-01-15 20:34:08.423203+00,extension,,Privacy Policy,Mfundo zazinsinsi,,,Mfundo zazinsinsi -2024-01-15 20:34:08.423203+00,extension,,Probability,kuthekera koti zikhoza kuchitika,,,mpata wa zoyembekezeleka -2024-01-15 20:34:08.423203+00,extension,,Reload,bwezeraninso,,,bwezeraninso -2024-01-15 20:34:08.423203+00,extension,,Resources,zipangizo,,,zipangizo -2024-01-15 20:34:08.423203+00,extension,,Settings,zipangizo,,,makhalidwe -2024-01-15 20:34:08.423203+00,extension,,Something went wrong...,chinachake chinalakwika ...,,,chinachake chinalakwika ... -2024-01-15 20:34:08.423203+00,manual,,Activities,Zochitika,,,Zinchito -2024-01-15 20:34:08.423203+00,common,,Edit Profiles,Sinthani mbiri,,,Lembani bwino maprofaelo -2024-01-15 20:34:08.423203+00,common,,Extension,Ulangizi,,,Kukuza -2024-01-15 20:34:08.423203+00,common,,Farmer,Mlimi,,,Mlimi -2024-01-15 20:34:08.423203+00,common,,Hide Options,Bisani Zipangizo,,,Bimphani zosankha -2024-01-15 20:34:08.423203+00,common,,Name,Dzina,,,Dzina -2024-01-15 20:34:08.423203+00,common,,New Profile,Mbiri yatsopano,,,Profaelo yatsopano -2024-01-15 20:34:08.423203+00,common,,Select Country,Sankhani Dziko,,,Sankhani dziko -2024-01-15 20:34:08.423203+00,common,,Select Language,Sankhani chilankhulo,,,Sankhani Chilankhulidwe -2024-01-15 20:34:08.423203+00,common,,Show Options,onetsani zipangizo,,,Wonetsani zosankha -2024-01-15 20:34:08.423203+00,common,,Who is using?,Akugwiritsa ntchito ndi ndani?,,,Ndani akusewenzetsa -2024-01-15 20:34:08.423203+00,crop-probability,,Beans,Nyemba,,,Kaela -2024-01-15 20:34:08.423203+00,crop-probability,,Calculated by using FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station.,Kuwerengeredwa pogwiritsa ntchito FAO CLIMWAT 2.0 ya Cropwat ndi Cropwat 8.0 ndi uthenga wa zanyengo ya Nkhotakota Met Station.,,,Kuwerengela kusewenzetsa FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station. -2024-01-15 20:34:08.423203+00,crop-probability,,Cassava,Chinangwa,,,Chinangwa -2024-01-15 20:34:08.423203+00,crop-probability,,Chance of receiving the water requirement in the days to maturity for this crop variety,Mwayi olandira madzi amene mbewu imafunikira mu masiku amene mbewu imatenga kuti ikhwime pa mbewu zosiyanasiyana,,,Mpata wolandila madzi oyenera kuti mtundu wa mbeu iyi iche. -2024-01-15 20:34:08.423203+00,crop-probability,,Crop water requirement (mm),Kuchuluka kwa madzi amene mbewu imafuna,,,M'yeso wofunikira wa madzi ku mbeu iyi -2024-01-15 20:34:08.423203+00,crop-probability,,Days to maturity,Masiku omwe zimatenga kuti ziche,,,Masiku kuti iche -2024-01-15 20:34:08.423203+00,crop-probability,,"Longitude:34.26, Latitude: -12.91 Altitude: 500.","Longitude:34.26, Latitude: -12.91 Altitude: 500.",,,"Kutalika :34.26, Kutambasuka:12.91, Mtunda wa M'mwamba : 500" -2024-01-15 20:34:08.423203+00,crop-probability,,Probability of season start on or before below date,Kuthekera koti nyengo ikhoza kuyamba pa tsiku lili mmunsili,,,Mpata wa dzinja kuyamba pa loikika kapena isanafike tsikulo -2024-01-15 20:34:08.423203+00,crop-probability,,Pumpkins,Maungu,,,Matanje/Maungu -2024-01-15 20:34:08.423203+00,crop-probability,,Sunflower,Mpendadzuwa,,,M'penya dzuwa/nsendemu -2024-01-15 20:34:08.423203+00,crop-probability,,Variety,Mtundu wa mbewu,,,Mtundu wa mbeu -2024-01-15 20:34:08.423203+00,extension,,Climate,Nyengo,,,Nyengo -2024-01-15 20:34:08.423203+00,extension,,Options,Zisankho,,,Zosankha -2024-01-15 20:34:08.423203+00,manual,,After the season,Pakutha pa nyengo,,,Pambuyo pakutha kwa Nyengo -2024-01-15 20:34:08.423203+00,manual,,Step A,Gawo A,,,Gawo A -2024-01-15 20:34:08.423203+00,manual,,Step B,Gawo B,,,Gawo B -2024-01-15 20:34:08.423203+00,manual,,Step C,Gawo C,,,Gawo C -2024-01-15 20:34:08.423203+00,manual,,Step D,Gawo D,,,Gawo D -2024-01-15 20:34:08.423203+00,manual,,Step E,Gawo E,,,Gawo E -2024-01-15 20:34:08.423203+00,manual,,Step F,Gawo F,,,Gawo F -2024-01-15 20:34:08.423203+00,manual,,Step G,Gawo G,,,Gawo G -2024-01-15 20:34:08.423203+00,manual,,Step H,Gawo H,,,Gawo H -2024-01-15 20:34:08.423203+00,manual,,Step I,Gawo I,,,Gawo I -2024-01-15 20:34:08.423203+00,manual,,Step J,Gawo J,,,Gawo J -2024-01-15 20:34:08.423203+00,manual,,Step K,Gawo K,,,Gawo K -2024-01-15 20:34:08.423203+00,manual,,Step L,Gawo L,,,Gawo L -2024-01-15 20:34:08.423203+00,manual,,Compare different options and plans,Siyanitsani zisankho ndi ma pulani osiyanasiyana,,,Linganizani Zosankha -2024-01-15 20:34:08.423203+00,manual,,Create,Pangani,,,Pangani -2024-01-15 20:34:08.423203+00,manual,,Crop Info,Zokhudza mbeu,,,Zambiri za Mbeu -2024-01-15 20:34:08.423203+00,manual,,During the season,Mkatikati mwa sizoni/nyengo,,,Mkati mwa Nyengo -2024-01-15 20:34:08.423203+00,monitoring,,Forms,mafomu,,,mafomu -2024-01-15 20:34:08.423203+00,manual,,Farmers choose,Alimi amasankha,,,Alimi asankha -2024-01-15 20:34:08.423203+00,manual,,Historic climate,mbiri ya za nyengo,,,Mbiri ya za Nyengo -2024-01-15 20:34:08.423203+00,manual,,Info Sheet,Tsamba la mauthenga,,,Tsamba la zambiri -2024-01-15 20:34:08.423203+00,manual,,Is the climate changing?,Kodi nyengo ikusintha?,,,Kodi nyengo ikusintha? -2024-01-15 20:34:08.423203+00,manual,,Just before the season,Sizoni/nyengo isanayambe,,,Pafupi kuyamba kwa nyengo -2024-01-15 20:34:08.423203+00,manual,,Learn and improve,Kuphunzira ndi kukonza,,,Phunzilani ndi kusintha -2024-01-15 20:34:08.423203+00,manual,,Livelihood Info,Zokhudza njira zopezera ndalama,,,Zambiri ya makhalidwe -2024-01-15 20:34:08.423203+00,manual,,Livestock Info,Mauthenga a ziweto,,,Zambiri ya ziweto -2024-01-15 20:34:08.423203+00,manual,,Long before the season,Kutali ndi kuyamba kwa nyengo,,,M'malanga -2024-01-15 20:34:08.423203+00,manual,,Options by context,Zisankho potengera nkhani,,,Zosankha Munjirayake -2024-01-15 20:34:08.423203+00,manual,,Probability and Risk,Kuthekera and Ziopsezo,,,Mpata komanso ziophyezo -2024-01-15 20:34:08.423203+00,manual,,Quiz,Mayeso,,,Mafunso -2024-01-15 20:34:08.423203+00,manual,,Resource Allocation Map (RAM),Mapu ogawa zinthu zimene tikuyenera kugwiritsa ntchito,,,Chitunzi cha Zomwe tilinazo -2024-01-15 20:34:08.423203+00,manual,,Response to forecast,Yankho ku ulosi wa nyengo,,,Zomwe tichita ndi uthenga wa zanyengo -2024-01-15 20:34:08.423203+00,option,,Money,ndalama,,,ndalama -2024-01-15 20:34:08.423203+00,manual,,Review,Kuunikira,,,Ndemanga -2024-01-15 20:34:08.423203+00,manual,,Revisit,Kubwereza,,,Yenderansoni -2024-01-15 20:34:08.423203+00,manual,,Seasonal Calendar,Kalendala ya nyengo,,,Kalenda ya Nyengo -2024-01-15 20:34:08.423203+00,manual,,Seasonal forecast,ulosi wa nyengo,,,Uthenga wa zanyengo -2024-01-15 20:34:08.423203+00,manual,,Select and amend,sankhani ndipo sinthani,,,Sankhani ndi Kusintha -2024-01-15 20:34:08.423203+00,manual,,Short-term forecasts and warnings,Ulosi wakanthawi kochepa wa zanyengo ndi ma chenjezo,,,Uthenga wa zanyengo wa nthawi yochepa -2024-01-15 20:34:08.423203+00,manual,,The farmer decides,Mulimi amapanga chiganizo,,,Mlimi asankha zochita -2024-01-15 20:34:08.423203+00,manual,,What are the options for the farmer?,Zisankho zomwe mulimi alinazo ndi ziti?,,,Kodi nizosankha zotani mam'limi? -2024-01-15 20:34:08.423203+00,manual,,What are the probabilities and risks?,Kodi kuthera koti zikhoza kuchitika komanso ziopzezo zake ndi ziti?,,,Kodi pali m'pata wotani komanso ziophyezo? -2024-01-15 20:34:08.423203+00,manual,,What does the farmer currently do?,Kodi muliliyu amapanga chiyani pakadali pano?,,,Kodi m'limi achita zotani pa nthawi ino? -2024-01-15 20:34:08.423203+00,option,,Add benefit,Onjezerani phindu/ubwino,,,Ikani maphindu -2024-01-15 20:34:08.423203+00,option,,Add New Option,Onjezerani Chisankho china,,,Ikani zosankha zatsopano -2024-01-15 20:34:08.423203+00,resources,,Collection not found,Kutolera sizikupezeka,,,Zokonzedwa bwino sizikupezeka -2024-01-15 20:34:08.423203+00,budget,,fruits,zipatso,,,zipatso -2024-01-15 20:34:08.423203+00,budget,,livestock,ziweto,,,ziweto -2024-01-15 20:34:08.423203+00,option,,Benefits,Ubwino/Phindu,,,Maphindu -2024-01-15 20:34:08.423203+00,option,,Benefits and who,Ubwino/Phindu ndipo amapindula ndindani?,,,Maphindu ndipo kwayani -2024-01-15 20:34:08.423203+00,option,,Enter the practice for this option,Lembani zochitika za chisankho ichi,,,Ikani ndondomeko ya zosankha za apa -2024-01-15 20:34:08.423203+00,option,,Female,Mkazi,,,M'zimai -2024-01-15 20:34:08.423203+00,option,,Finish,Kumaliza,,,Tsilizani -2024-01-15 20:34:08.423203+00,option,,Gender,Mwamuna kapena Mkazi,,,Jenda -2024-01-15 20:34:08.423203+00,option,,High RF,Mvula yambiri,,,Mvula yambiri -2024-01-15 20:34:08.423203+00,option,,Investment,Zomwe talowetsa,,,Zolowamo -2024-01-15 20:34:08.423203+00,option,,Investment in terms of money and time,Ndalama ndi nthawi zomwe talowetsa,,,Ndalama Zolowamo komanso nthawi -2024-01-15 20:34:08.423203+00,option,,Low RF,Mvula yochepa,,,Mvula yochepekera -2024-01-15 20:34:08.423203+00,option,,Male,Mwamuna,,,M'zibambo -2024-01-15 20:34:08.423203+00,option,,Mid RF,Mvula yachikatikati,,,Mvula yapakatinkati -2024-01-15 20:34:08.423203+00,option,,Performance,Mene zachitira,,,Kakulidwe ka mbeu -2024-01-15 20:34:08.423203+00,crop-probability,,All,zonse,,,zonse -2024-01-15 20:34:08.423203+00,option,,"Performance in high, mid and low RF (rainfall)","Mene zachitira pomwe mvula inali yambiri, yochepa kapena yachikatikati",,,"Kakulidwe ka mbeu ngati mvula yachuluka, yachepekela komanso ngati niyapakatinkati" -2024-01-15 20:34:08.423203+00,option,,Practice,Zochitika,,,Nyira ya Malimidwe -2024-01-15 20:34:08.423203+00,option,,Risk,Ziopsezo,,,Chiophyezo -2024-01-15 20:34:08.423203+00,option,,Risk of practice (disadvantage),Kuipa (Ziopsezo) za chochitika ichi,,,Chiphyezo cha malimidwe awo -2024-01-15 20:34:08.423203+00,crop-probability,,Cowpeas,khobwe,,,nyemba -2024-01-15 20:34:08.423203+00,crop-probability,,Crop,mbewu,,,zokolora -2024-01-15 20:34:08.423203+00,crop-probability,,Crop Information,uthenga okhudza mbeu,,,mauthenga a mbeu -2024-01-15 20:34:08.423203+00,option,,Risks,Ziopsezo,,,Ziophyezo -2024-01-15 20:34:08.423203+00,option,,*This field is required,gawoli ndilofunika kuyankhidwa,,,Apa mpofunikira -2024-01-15 20:34:08.423203+00,crop-probability,,Groundnuts,mtedza,,,nshawa -2024-01-15 20:34:08.423203+00,option,,Time,Nthawi,,,Nthawi -2024-01-15 20:34:08.423203+00,crop-probability,,Maize,chimanga,,,chimanga -2024-01-15 20:34:08.423203+00,crop-probability,,Pigeon Peas,nandolo,,,nyamdolo -2024-01-15 20:34:08.423203+00,option,,Time (months),Nthawi (Miyezi),,,Minyezi -2024-01-15 20:34:08.423203+00,option,,Time to start benefiting,Nthawi imene ikutenga kuti tizayambe kupindula,,,Nthawi yoyamba kuona maphindu -2024-01-15 20:34:08.423203+00,crop-probability,,Rice,mpunga,,,mpunga -2024-01-15 20:34:08.423203+00,crop-probability,,Sorghum,mapila,,,mapira -2024-01-15 20:34:08.423203+00,crop-probability,,Soya Beans,soya,,,nyemba za soya -2024-01-15 20:34:08.423203+00,crop-probability,,Station,sitesheni,,,malo -2024-01-15 20:34:08.423203+00,option,,Who does it,Amachita ndi ndani?,,,Ndani achita izi -2024-01-15 20:34:08.423203+00,crop-probability,,Sweet Potatoes,mbatata ya kholowa,,,kandolo/kachamba -2024-01-15 20:34:08.423203+00,option,,Who does the practice,Amachita ichi ndi ndani?,,,Ndani achita ndondomeko iyi -2024-01-15 20:34:08.423203+00,budget,,Budget Tool,kupanga bajeti,,,njira ya kayendetsedwe ka chuma -2024-01-15 20:34:08.423203+00,budget,,For Sale,,,, -2024-01-15 20:34:08.423203+00,budget,,New Budget,,,, -2024-01-15 20:34:08.423203+00,budget,,Purchased,,,, -2024-01-15 20:34:08.423203+00,crop-probability,,Cotton,,,, -2024-01-15 20:34:08.423203+00,crop-probability,,Probability of season start on or before date,,,, -2024-01-15 20:34:08.423203+00,crop-probability,,Tobacco,,,, -2024-01-15 20:34:08.423203+00,option,,Activities,Zochitika,,,Zinchito -2024-01-15 20:34:08.423203+00,option,,Decisions,,,, -2024-01-15 20:34:08.423203+00,option,,Who does activity,,,, -2024-01-15 20:34:08.423203+00,option,,Who does the activity,,,, -2024-01-15 20:34:08.423203+00,option,,Who makes decisions,,,, -2024-01-15 20:34:08.423203+00,budget,,Add Card,,,, -2024-01-15 20:34:08.423203+00,budget,,Share App Link,Tumizani progalamu,,,Gawani ulalo wa app -2024-01-15 20:34:08.423203+00,climate,,Calculated with the date range of Start of rains and End of the rains,,,, -2024-01-15 20:34:08.423203+00,climate,,Capacity of 100mm on 1st March reduces 0.5 with evaporation rate of 5mm per day,,,, -2024-01-15 20:34:08.423203+00,climate,,First 3 days receiving rainfall amount of 20mm and not followed by 9-day dry spell for the next 21 days,,,, -2024-01-15 20:34:08.423203+00,climate,,Seasonal total rainfall calculated between the defined start and defined end of the season,,,, -2024-01-15 20:34:08.423203+00,manual,,Activity Flow Chart,,,, -2024-01-15 20:34:08.423203+00,manual,,Comparing different options and planning using Participatory Budgets,,,, -2024-01-15 20:34:08.423203+00,manual,,Introduction,,,, -2024-01-15 20:34:08.423203+00,manual,,Manual Requires Download,,,, -2024-01-15 20:34:08.423203+00,manual,,PICSA,PICSA,,,PICSA -2024-01-15 20:34:08.423203+00,manual,,What are the opportunities and risks?,,,, -2024-01-15 20:34:08.423203+00,monitoring,,Create New,,,, -2024-01-15 20:34:08.423203+00,monitoring,,Submissions,,,, -2024-01-15 20:34:08.423203+00,monitoring,,Submit,,,, -2024-01-15 20:34:08.423203+00,climate,,Above,,,, -2024-01-15 20:34:08.423203+00,climate,,Below,,,, \ No newline at end of file +id,created_at,tool,context,en,mw_ny,ke_sw,tj_tg,zm_ny +budget-activities-applyfertiliser,2024-01-15 20:34:08.423203+00,budget,activities,apply fertiliser,kuthira feteleza,,,thirani fatatleza +budget-activities-applypesticide,2024-01-15 20:34:08.423203+00,budget,activities,apply pesticide,kopopela mankhwala a tizilombo,,,thirani mankhwala +budget-activities-bagging,2024-01-15 20:34:08.423203+00,budget,activities,bagging,kupakila mmatumba,,,kuika m'mathumba +budget-activities-banding,2024-01-15 20:34:08.423203+00,budget,activities,banding,kubandila,,,kumangilira +budget-activities-buildhousing,2024-01-15 20:34:08.423203+00,budget,activities,build housing,kumanga makola,,,kumanga nyumba +budget-activities-compostmanuremaking,2024-01-15 20:34:08.423203+00,budget,activities,compost manure making,kupanga manyowa,,,kupanga manyowa kuzinyalala +budget-activities-dipping,2024-01-15 20:34:08.423203+00,budget,activities,dipping,kupanga dipi ziweto,,,kupaka +budget-activities-feedinglivestock,2024-01-15 20:34:08.423203+00,budget,activities,feeding livestock,kudyetsa ziweto,,,kudyetsa ziweto +budget-activities-harvesting,2024-01-15 20:34:08.423203+00,budget,activities,harvesting,kukolola,,,kukolola +budget-activities-landclearing,2024-01-15 20:34:08.423203+00,budget,activities,land clearing,kusosa,,,kukonza malo +budget-activities-marketingandselling,2024-01-15 20:34:08.423203+00,budget,activities,marketing and selling,kutsatsa ndi kugulitsa,,,kutsatsa ndi kugulitsa +budget-activities-mulching,2024-01-15 20:34:08.423203+00,budget,activities,mulching,kuphimbila,,,mochi +budget-activities-ploughing,2024-01-15 20:34:08.423203+00,budget,activities,ploughing,kugalauza,,,kugaula +budget-activities-postharvesthandling,2024-01-15 20:34:08.423203+00,budget,activities,post-harvest handling,kusamala zokolora,,,kagwiridwe pambuyo po kolola +budget-activities-providesupplements,2024-01-15 20:34:08.423203+00,budget,activities,provide supplements,kupereka zakudya zoonjezera,,,perekani zothandizila +budget-activities-providewater,2024-01-15 20:34:08.423203+00,budget,activities,provide water,kupereka madzi ku ziweto,,,perekani madzi +budget-activities-purchase,2024-01-15 20:34:08.423203+00,budget,activities,purchase,kugula,,,gulani +budget-activities-relocation,2024-01-15 20:34:08.423203+00,budget,activities,relocation,kusamutsa ziweso,,,kusamukira +budget-activities-shelling,2024-01-15 20:34:08.423203+00,budget,activities,shelling,kutonola/kusola,,,kutongola +budget-activities-sowing,2024-01-15 20:34:08.423203+00,budget,activities,sowing,kufesa,,,kufesa +budget-activities-storage,2024-01-15 20:34:08.423203+00,budget,activities,storage,kusunga,,,kasungidwe +budget-activities-threshing,2024-01-15 20:34:08.423203+00,budget,activities,threshing,kupuntha,,,kupuntha +budget-activities-transport,2024-01-15 20:34:08.423203+00,budget,activities,transport,transipoti,,,mayendedwe +budget-activities-transportlivestock,2024-01-15 20:34:08.423203+00,budget,activities,transport livestock,kunyamula ziweto,,,kunyamula ziweto +budget-activities-vaccinate,2024-01-15 20:34:08.423203+00,budget,activities,vaccinate,kupereka katemela,,,katemera +budget-activities-valueaddition,2024-01-15 20:34:08.423203+00,budget,activities,value addition,kuwonjezera phindu,,,kuwonjezera phindu +budget-activities-watering,2024-01-15 20:34:08.423203+00,budget,activities,watering,kuthirira,,,kuthirira +budget-activities-weeding,2024-01-15 20:34:08.423203+00,budget,activities,weeding,kupalira,,,kupalira +budget--addfemalemember,2024-01-15 20:34:08.423203+00,budget,,Add Female Member,Onjezerani membala wa mkazi,,,Ikamponi membala wam'kazi +budget--addmalemember,2024-01-15 20:34:08.423203+00,budget,,Add Male Member,Onjezerani membala wa mamuna,,,Ikamponi membala wam'muna +budget--balance,2024-01-15 20:34:08.423203+00,budget,,Balance,Ndalama zotsala,,,Zokharira +budget--consumed,2024-01-15 20:34:08.423203+00,budget,,Consumed,Zodyedwa,,,Zosewenzetsedwa +budget--cost,2024-01-15 20:34:08.423203+00,budget,,Cost,Mtengo,,,Mtengo +budget--createnewbudget,2024-01-15 20:34:08.423203+00,budget,,Create New Budget,Pangani bajeti yatsopano,,,Pangani bajeti yatsopano +budget--days,2024-01-15 20:34:08.423203+00,budget,,Days,Masiku,,,Masiku +budget--decreasescale,2024-01-15 20:34:08.423203+00,budget,,Decrease Scale,Kuchepetsa mlingo,,,Chepetsa kukula +budget--description,2024-01-15 20:34:08.423203+00,budget,,description,mafotokozeredwe,,,kaonekeswe +budget--descriptionoptional,2024-01-15 20:34:08.423203+00,budget,,Description (optional),Kufotokozera (Mukhoza osalemba),,,Kufotokozera (posankha) +budget--enterprise,2024-01-15 20:34:08.423203+00,budget,,Enterprise,bizinesi,,,malonda +budget-enterprise-afforestation,2024-01-15 20:34:08.423203+00,budget,enterprise,afforestation,kudzala mitengo,,,kubyala mitengo +budget-enterprise-cattle,2024-01-15 20:34:08.423203+00,budget,enterprise,cattle,ng'ombe,,,ng'ombe +budget-enterprise-chicken,2024-01-15 20:34:08.423203+00,budget,enterprise,chicken,nkhuku,,,nkhuku +budget-enterprise-cowpeas,2024-01-15 20:34:08.423203+00,budget,enterprise,cowpeas,khobwe,,,nyemba +budget-enterprise-ducks,2024-01-15 20:34:08.423203+00,budget,enterprise,ducks,abakha,,,abakha +budget-enterprise-fish,2024-01-15 20:34:08.423203+00,budget,enterprise,fish,nsomba,,,nsomba +budget-enterprise-goats,2024-01-15 20:34:08.423203+00,budget,enterprise,goats,mbuzi,,,mbuzi +budget-enterprise-groundnuts,2024-01-15 20:34:08.423203+00,budget,enterprise,groundnuts,mtedza,,,nshawa +budget-enterprise-guineafowl,2024-01-15 20:34:08.423203+00,budget,enterprise,guinea fowl,nkhanga,,,nkhanga +budget-enterprise-maize,2024-01-15 20:34:08.423203+00,budget,enterprise,maize,chimanga,,,chimanga +budget-enterprise-mixed,2024-01-15 20:34:08.423203+00,budget,enterprise,mixed,kusakaniza,,,kusakaniza +budget-enterprise-onions,2024-01-15 20:34:08.423203+00,budget,enterprise,onions,anyezi,,,anyezi +budget-enterprise-pawpaw,2024-01-15 20:34:08.423203+00,budget,enterprise,paw-paw,papaya,,,paw-paw +budget-enterprise-pigeonpeas,2024-01-15 20:34:08.423203+00,budget,enterprise,pigeon peas,nandolo,,,nyamdolo +budget-enterprise-pigs,2024-01-15 20:34:08.423203+00,budget,enterprise,pigs,nkhumba,,,nkhumba +budget-enterprise-rice,2024-01-15 20:34:08.423203+00,budget,enterprise,rice,mpunga,,,mpunga +budget-enterprise-sheep,2024-01-15 20:34:08.423203+00,budget,enterprise,sheep,nkhosa,,,mbelele +budget-enterprise-sorghum,2024-01-15 20:34:08.423203+00,budget,enterprise,sorghum,mapila,,,mapira +budget-enterprise-soyabeans,2024-01-15 20:34:08.423203+00,budget,enterprise,soya beans,soya,,,nyemba za soya +budget-enterprise-sweetpotatoes,2024-01-15 20:34:08.423203+00,budget,enterprise,sweet potatoes,mbatata ya kholowa,,,kandolo/kachamba +budget-enterprise-tomatoes,2024-01-15 20:34:08.423203+00,budget,enterprise,tomatoes,tomato,,,chimate +budget-enterprise-watermelon,2024-01-15 20:34:08.423203+00,budget,enterprise,watermelon,mavwende,,,vwembe +budget--family,2024-01-15 20:34:08.423203+00,budget,,Family,banja,,,banja +budget--familylabour,2024-01-15 20:34:08.423203+00,budget,,Family Labour,ntchito yogwiridwa ndi amubanjamo,,,ntchito ya banja +budget-day_1-monday,2024-01-15 20:34:08.423203+00,budget,day_1,Monday,Lolemba,,,Pa lolemba +budget--howlongisyourbudgetfor,2024-01-15 20:34:08.423203+00,budget,,How long is your budget for?,bajeti yanu imakhala yayitali bwanji?,,,bajeti yanu imakhala yayitali motani? +budget--importbudgetcode,2024-01-15 20:34:08.423203+00,budget,,Import Budget Code,lowetsani nambala ya bajeti,,,nambala ya bajeti +budget--increasescale,2024-01-15 20:34:08.423203+00,budget,,Increase Scale,onjezerani mulingo,,,kuchulukitsa +budget--inputs,2024-01-15 20:34:08.423203+00,budget,,Inputs,zolowa,,,zolowa +budget-inputs-bags,2024-01-15 20:34:08.423203+00,budget,inputs,bags,matumba,,,matumba +budget-inputs-chemicals,2024-01-15 20:34:08.423203+00,budget,inputs,chemicals,mankhwala,,,mankhwala +budget-inputs-feed,2024-01-15 20:34:08.423203+00,budget,inputs,feed,zakudza za ziweto,,,zakudya zaziweto (Kudyetsa) +budget-inputs-fertiliser,2024-01-15 20:34:08.423203+00,budget,inputs,fertiliser,feteleza,,,fataleza +budget-inputs-housing,2024-01-15 20:34:08.423203+00,budget,inputs,housing,khola,,,mosungila +budget-inputs-labourpaid,2024-01-15 20:34:08.423203+00,budget,inputs,labour - paid,ganyu,,,ntchito - yolipidwa +budget-inputs-manuresacks,2024-01-15 20:34:08.423203+00,budget,inputs,manure sacks,matumba a manyowa,,,masaka ya manyowa +budget-inputs-manurewheelbarrows,2024-01-15 20:34:08.423203+00,budget,inputs,manure wheelbarrows,wilibala ya manyowa,,,wilibala ya manyowa +budget-inputs-oxcart,2024-01-15 20:34:08.423203+00,budget,inputs,ox cart,ngolo,,,kochikali/ ngolo +budget-inputs-potforstorage,2024-01-15 20:34:08.423203+00,budget,inputs,pot for storage,mphika wongula zinthu,,,mphika posungira +budget-inputs-protectiveequipment,2024-01-15 20:34:08.423203+00,budget,inputs,protective equipment,zida zozitetezera pogwira ntchito,,,zida zoteteza +budget-inputs-seeds,2024-01-15 20:34:08.423203+00,budget,inputs,seeds,mbewu,,,mbewu +budget-inputs-shellerhire,2024-01-15 20:34:08.423203+00,budget,inputs,sheller hire,kupanga hayala chida chotonolera,,,makina otongolera olipilidwa +budget-inputs-supplements,2024-01-15 20:34:08.423203+00,budget,inputs,supplements,zakudya za ziweto zoowonjezera,,,zothandizila +budget-inputs-tools,2024-01-15 20:34:08.423203+00,budget,inputs,tools,zida,,,zida +budget-inputs-tractorhire,2024-01-15 20:34:08.423203+00,budget,inputs,tractor hire,kubweleka thirakitale,,,ganyu ya thalakita +budget-inputs-transportationhire,2024-01-15 20:34:08.423203+00,budget,inputs,transportation hire,hayala ya thiransipoti,,,mayendedwe olipira +budget-inputs-vaccine,2024-01-15 20:34:08.423203+00,budget,inputs,vaccine,katemera,,,katemera +budget-day_2-tuesday,2024-01-15 20:34:08.423203+00,budget,day_2,Tuesday,Lachiwiri,,,Pa chiwiri +budget-day_3-wednesday,2024-01-15 20:34:08.423203+00,budget,day_3,Wednesday,Lachitatu,,,Pa chitatu +budget-other-addcustom,2024-01-15 20:34:08.423203+00,budget,other,add custom,onjezani zipangizo,,,kuikapo m'sonkho +budget-other-familylabour,2024-01-15 20:34:08.423203+00,budget,other,family labour,ntchito yogwiridwa ndi amubanjamo,,,ntchito ya banja +budget--outputs,2024-01-15 20:34:08.423203+00,budget,,Outputs,zotuluka,,,zotuluka +budget-outputs-crop,2024-01-15 20:34:08.423203+00,budget,outputs,crop,mbewu,,,zokolora +budget-outputs-eggs,2024-01-15 20:34:08.423203+00,budget,outputs,eggs,mazira,,,mazira +budget-outputs-fodderforlivestock,2024-01-15 20:34:08.423203+00,budget,outputs,fodder for livestock,chakudya cha ziweto,,,chakudya cha ziweto +budget-outputs-manureforcompost,2024-01-15 20:34:08.423203+00,budget,outputs,manure for compost,manyowa a kompositi,,,manyowa ozipangila kuzinyalala +budget-outputs-meat,2024-01-15 20:34:08.423203+00,budget,outputs,meat,nyama,,,nyama +budget-outputs-milk,2024-01-15 20:34:08.423203+00,budget,outputs,milk,mkaka,,,mkaka +budget-outputs-money,2024-01-15 20:34:08.423203+00,budget,outputs,money,ndalama,,,ndalama +budget-outputs-wood,2024-01-15 20:34:08.423203+00,budget,outputs,wood,nkhuni,,,matabwa +budget--produceconsumed,2024-01-15 20:34:08.423203+00,budget,,Produce Consumed,zokolola zomwe zagwiritsidwa ntchito,,,zokolola zomwe zagwiritsidwa ntchito \ No newline at end of file diff --git a/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql b/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql index df62907db..8b0c314c8 100644 --- a/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql +++ b/apps/picsa-server/supabase/migrations/20240102153452_translations_table_create.sql @@ -1,8 +1,9 @@ create table public.translations ( + id text not null, created_at timestamp with time zone not null default now(), tool text not null, - context text not null default ''::text, + context text, en text not null, -- Additional languages -- Uses ISO 3166 alpha-2 country code and ISO 639 Set 1 language code @@ -13,5 +14,6 @@ create table tj_tg text null, zm_ny text null, -- Primary key generated as combination of tool, context and en text - constraint translations_pkey primary key (tool, context, en) + constraint translations_pkey primary key (id), + constraint translations_tool_context_en_key unique (tool, context, en) ) tablespace pg_default; \ No newline at end of file diff --git a/apps/picsa-server/supabase/types/index.ts b/apps/picsa-server/supabase/types/index.ts index cb5a3d4c9..b1f716bc0 100644 --- a/apps/picsa-server/supabase/types/index.ts +++ b/apps/picsa-server/supabase/types/index.ts @@ -199,9 +199,10 @@ export interface Database { } translations: { Row: { - context: string + context: string | null created_at: string en: string + id: string ke_sw: string | null mw_ny: string | null tj_tg: string | null @@ -209,9 +210,10 @@ export interface Database { zm_ny: string | null } Insert: { - context?: string + context?: string | null created_at?: string en: string + id: string ke_sw?: string | null mw_ny?: string | null tj_tg?: string | null @@ -219,9 +221,10 @@ export interface Database { zm_ny?: string | null } Update: { - context?: string + context?: string | null created_at?: string en?: string + id?: string ke_sw?: string | null mw_ny?: string | null tj_tg?: string | null From 7619e08101463334993b0933be83014fa2f4223b Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Mon, 15 Jan 2024 14:13:03 -0800 Subject: [PATCH 8/8] chore: code tidying --- .../edit/translations-edit.component.html | 4 +- .../pages/home/translations.page.html | 4 +- .../pages/home/translations.page.ts | 2 +- .../pages/new/new-translations.component.html | 13 +++--- .../pages/new/new-translations.component.ts | 42 +++++++++---------- 5 files changed, 32 insertions(+), 33 deletions(-) diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html index 1a9431b6a..88f1a98aa 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html @@ -19,11 +19,11 @@

Edit Translations

- +
- +
diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html index 88f94b9f4..d38a2fca5 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html @@ -36,13 +36,13 @@

Translations

- + ke_sw {{ element.ke_sw }} - + tj_tg {{ element.tj_tg }} diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts index a0082e846..35156c525 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.ts @@ -17,7 +17,7 @@ export type ITranslationRow = Database['public']['Tables']['translations']['Row' styleUrls: ['./translations.page.scss'], }) export class TranslationsPageComponent implements OnInit { - displayedColumns: string[] = ['tool', 'context', 'en', 'mw_ny', 'zm_ny', 'sw', 'tg', 'created_at']; + displayedColumns: string[] = ['tool', 'context', 'en', 'mw_ny', 'zm_ny', 'ke_sw', 'tj_tg', 'created_at']; constructor(public service: TranslationDashboardService, private router: Router) {} ngOnInit(): void { diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.html b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.html index 4efa8924c..eda70f931 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.html +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.html @@ -2,7 +2,6 @@

New Translations

-
@@ -14,12 +13,12 @@

New Translations

- - + +
- - + +
@@ -29,6 +28,6 @@

New Translations

@if(editActionFeedbackMessage){ -
{{editActionFeedbackMessage}}
+
{{ editActionFeedbackMessage }}
} -
\ No newline at end of file +
diff --git a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.ts b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.ts index 6da562a79..ef4867f17 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/translations/pages/new/new-translations.component.ts @@ -18,33 +18,33 @@ import { TranslationDashboardService } from '../../translations.service'; styleUrls: ['./new-translations.component.scss'], }) export class NewTranslationsComponent { - en:string; - mw_ny:string; - sw:string; - tg:string; - zm_ny:string; + en: string; + mw_ny: string; + ke_sw: string; + tj_tg: string; + zm_ny: string; editActionFeedbackMessage: string; constructor(private service: TranslationDashboardService) { this.service.ready(); } submitForm() { const data = { - en:this.en, + en: this.en, mw_ny: this.mw_ny, - sw:this.sw, - tg:this.tg, - zm_ny:this.zm_ny, - } - this.service.addTranslation(data) - .then((data) => { - if (data === 'Added successfully') { - this.editActionFeedbackMessage = 'Added successfully'; - } - }) - .catch((error) => { - console.error('Error adding translation:', error); - this.editActionFeedbackMessage = 'Failed to add a translation.'; - }); - + ke_sw: this.ke_sw, + tj_tg: this.tj_tg, + zm_ny: this.zm_ny, + }; + this.service + .addTranslation(data) + .then((data) => { + if (data === 'Added successfully') { + this.editActionFeedbackMessage = 'Added successfully'; + } + }) + .catch((error) => { + console.error('Error adding translation:', error); + this.editActionFeedbackMessage = 'Failed to add a translation.'; + }); } }