Skip to content

Commit

Permalink
Make viewer about text translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed Oct 16, 2024
1 parent 4592a0a commit dbeebd2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 38 deletions.
34 changes: 34 additions & 0 deletions frontend/src/lib/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,5 +718,39 @@ If you don't see a dialog or already closed it, click the button below:",
"any": "Any",
"yes_no": "{value, select, true {Yes} false {No} other {Unknown}}",
"did_you_know": "Did you know?",
},
"viewer": {
"about": "## What is this?\n\
\
This is a beta version of a new dictionary building tool that is currently under development.\n\
\
The data you see here reflects the current data in the corresponding [Language Forge](https://languageforge.org/) project.\n\
\
This read-only version of the new dictionary tool is primarily for gathering early feedback on its look and feel. So, please use the [Feedback](/api/feedback) button in the top right corner of the page.\n\
\
## It can edit FieldWorks projects!\n\
\
It's true! There's already another version of the tool that you can use today to open and edit your data in FieldWorks.\n\
It's also loaded with additional features! We're calling it [FieldWorks Lite](https://lexbox.org/fw-lite).\n\
So, please download and try out the alpha version of [FieldWorks Lite](https://lexbox.org/fw-lite) as well.\n\
\
## Should I be excited?\n\
\
Yes! FieldWorks Lite will be revolutionary in multiple ways. It will be:\n\
\
- Cross-platform: it will work on Windows, Linux, Mac and eventually mobile\n\
- Usable offline: you won't need an internet connection\n\
- Collaborative: you will see any changes other users make as they work\n\
- Faster than you're used to - we're quite confident about that 😀\n\
\
Eventually, FieldWorks Lite will replace both [WeSay](https://software.sil.org/wesay/) and [Language Forge](https://languageforge.org/).\n\
\
So, please send us your [feedback](/api/feedback). We want this tool to serve you as well as possible.\n\
\
## FieldWorks Lite is not\n\
\
- A replacement for [FieldWorks](https://software.sil.org/fieldworks/)\n\
- A replacement for [Dictionary App Builder](https://software.sil.org/dictionaryappbuilder/)\n\
- A replacement for [Webonary](https://www.webonary.org/)"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
import {LexboxService} from 'viewer/service-provider';
import {LfClassicLexboxApi} from './lfClassicLexboxApi';
import type {PageData} from './$types';
import t from '$lib/i18n';
import { derived } from 'svelte/store';
export let data: PageData;
$: project = data.project;
const about = derived(t, ($t) => $t('viewer.about'));
const serviceProvider = window.lexbox.ServiceProvider;
let service: LfClassicLexboxApi;
$: {
if (serviceProvider) {
let localService = new LfClassicLexboxApi($project.code);
let localService = new LfClassicLexboxApi($project.code, about);
serviceProvider.setService(LexboxService.LexboxApi, localService);
service = localService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
type SemanticDomain
} from 'viewer/lexbox-api';
import { SEMANTIC_DOMAINS_EN } from './semantic-domains.en.generated-data';
import { writable } from 'svelte/store';
import { type Readable } from 'svelte/store';

function prepareEntriesForUi(entries: IEntry[]): void {
entries.forEach(entry => {
Expand All @@ -32,13 +32,13 @@ function preparePartsOfSpeedForUi(partsOfSpeech: PartOfSpeech[]): void {
}

export class LfClassicLexboxApi implements LexboxApiClient {
constructor(private projectCode: string) {
constructor(private projectCode: string, private aboutMarkdown: Readable<string>) {
}

SupportedFeatures(): LexboxApiFeatures {
return {
feedback: true,
about: writable(aboutMarkdown),
about: this.aboutMarkdown,
};
}

Expand Down Expand Up @@ -147,37 +147,3 @@ export class LfClassicLexboxApi implements LexboxApiClient {
}

}

const aboutMarkdown =
`## What is this?
This is a beta version of a new dictionary building tool that is currently under development.
The data you see here reflects the current data in the corresponding [Language Forge](https://languageforge.org/) project.
This read-only version of the new dictionary tool is primarily for gathering early feedback on its look and feel. So, please use the [Feedback](/api/feedback) button in the top right corner of the page.
## It can edit FieldWorks projects!
It's true! There's already another version of the tool that you can use today to open and edit your data in FieldWorks.
It's also loaded with additional features! We're calling it [FieldWorks Lite](https://lexbox.org/fw-lite).
So, please download and try out the alpha version of [FieldWorks Lite](https://lexbox.org/fw-lite) as well.
## Should I be excited?
Yes! FieldWorks Lite will be revolutionary in multiple ways. It will be:
- Cross-platform: it will work on Windows, Linux, Mac and eventually mobile
- Usable offline: you won't need an internet connection
- Collaborative: you will see any changes other users make as they work
- Faster than you're used to - we're quite confident about that 😀
Eventually, FieldWorks Lite will replace both [WeSay](https://software.sil.org/wesay/) and [Language Forge](https://languageforge.org/).
So, please send us your [feedback](/api/feedback). We want this tool to serve you as well as possible.
## FieldWorks Lite is not
- A replacement for [FieldWorks](https://software.sil.org/fieldworks/)
- A replacement for [Dictionary App Builder](https://software.sil.org/dictionaryappbuilder/)
- A replacement for [Webonary](https://www.webonary.org/)`;

0 comments on commit dbeebd2

Please sign in to comment.