Skip to main content

Notes

Why You're on the staging server.

Originating from web/src/components/layout/layout.tsx It uses web/src/utility.ts:isProduction() which simply check if the window.location.origin === URLS.HTTP_ROOT where URLS.HTTP_ROOT is https://commonvoice.mozilla.org.

File Changed so Far.

  • server/src/lib/api.ts saveAvatarClip() which I don't think I should've change because it's probably not related to the recordings.
  • server/src/lib/bucket.ts getRandomClips()
  • server/src/lib/clip.ts

Changing the Number of Contributions

To change the number or required contibution, we need to change SET_COUNT in web/src/components/pages/contribution/contribution.tsx. We also need to change shortcut-rerecord-toggle for every web/locales/*/messages.ftl.

Languages

Can we limit the available languages in the drop down menu? locales/all.json controls the available languages in the UI's drop down box. This has the side effect that we no longer can simply use https://localhost:9000 because this would automatically redirect us to English which is no longer available. To fix this, we need to change DEFAULT_LOCALE in web/src/services/localization.ts b/web/src/services/localization.ts to either git or str. We chose to change it to git.

Changing Font

We would like to use BC Sans Typeface. More typography info. Download FONT. Unzip to web/font/. Change web/src/components/index.css and add

diff --git a/web/src/components/index.css b/web/src/components/index.css
index ccfa3a2a9..a425d4e16 100644
--- a/web/src/components/index.css
+++ b/web/src/components/index.css
@@ -42,6 +42,11 @@ html[lang='az'] {
--base-font-family: 'Inter', sans-serif;
}

+html[lang='git'],
+html[lang='str'] {
+ --base-font-family: 'BCSans', sans-serif;
+}
+
html {
font-family: var(--base-font-family);
font-size: var(--font-size);

This changes the font to BCSans when the selected language is either Gitksan or SENĆOŦEN.

Report

When recording utterances on the speak page, if someone clicks the report button, where can we find the report? We've clicked the report button on the speak page and submitted a report of difficult-to-pronounce. The report was recorded in mysql.

mysql> use voiceweb;
Database changed
mysql> select * from reported_sentences;
+----+--------------------------------------+------------------------------------------------------------------+---------------------+---------------------+
| id | client_id | sentence_id | reason | created_at |
+----+--------------------------------------+------------------------------------------------------------------+---------------------+---------------------+
| 1 | 8f7b3457-1a9f-4c9e-a44c-d33fadb3bb5c | 050848b77fdb38926067f69260010712d4758cd3f206967fb512d0b48bdf1223 | difficult-pronounce | 2022-06-22 22:44:39 |
+----+--------------------------------------+------------------------------------------------------------------+---------------------+---------------------+
1 row in set (0.00 sec)

User Rerecording a Clip for a Sentence

It looks like it is an error as in clipSaveError for a user to try to rerecord a clip for a sentence that he/she already have recorded. Can we delete the proper entry in mysql to get a user to rerecord an utterance for a given sentence? lib/clip.ts

if (await this.model.db.clipExists(client_id, sentenceId)) {
this.clipSaveError(
headers,
response,
204,
`${clipFileName} already exists`,
ERRORS.ALREADY_EXISTS,
'clip'
);
return;
} else {
...

Clientid?

How are the clientids generated? It seems to be at least tied to the browser because from the same pc using two different browsers, we will be assigned two differente clientid.

If we can find the entry in clips, it is sufficient to delete the row to get a rerecording of that sentence by that said person. It isn't clear exactly how to associate the user with his client_id.

USE voiceweb;
DELETE FROM clips WHERE id = 1;