Adding support for English (and other languages in the future)#7
Adding support for English (and other languages in the future)#7Hydramus wants to merge 13 commits into
Conversation
…r language switching
|
Thank you for taking the time to work on it! I will take a look at it shortly (before the launch of the revamped HKILANG website, which I believe will be in the coming month). |
graphemecluster
left a comment
There was a problem hiding this comment.
Here are part of my reviews - I haven't tried out the app yet and I'll take a look at the UI in short.
| // This method is bounded per the spec | ||
| // eslint-disable-next-line @typescript-eslint/unbound-method | ||
| const formatPercentage = Intl.NumberFormat("zh-HK", { style: "percent", minimumFractionDigits: 2, maximumFractionDigits: 2 }).format; | ||
| const formatPercentage = Intl.NumberFormat(undefined, { style: "percent", minimumFractionDigits: 2, maximumFractionDigits: 2 }).format; |
There was a problem hiding this comment.
Can this follow the current language?
| "waitau": "Wai Tau Waa", | ||
| "hakka": "Hakka Wa", |
There was a problem hiding this comment.
| "waitau": "Wai Tau Waa", | |
| "hakka": "Hakka Wa", | |
| "waitau": "Waitau", | |
| "hakka": "Hakka", |
| "hkilangLogoAlt": "Hong Kong Indigenous Language Preservation Association logo", | ||
| "hkilangTitle": "Hong Kong <span class=\"text-[#d80818] group-hover:text-[#900612] group-hover:text-opacity-90 transition-[color]\">Indigenous Language</span> Preservation Association", | ||
| "selectVoice": "Select Voice", | ||
| "description": "Enter text to hear Weitou and Hakka pronunciation, preserving local languages." |
There was a problem hiding this comment.
| "description": "Enter text to hear Weitou and Hakka pronunciation, preserving local languages." | |
| "description": "Enter text to hear Waitau and Hakka pronunciation, preserving local languages." |
| }, | ||
| "languageSelection": { | ||
| "title": "Select Language", | ||
| "welcome": "Welcome to the <b>Hong Kong Weitou and Hakka Text-to-Speech</b> reader!", |
There was a problem hiding this comment.
| "welcome": "Welcome to the <b>Hong Kong Weitou and Hakka Text-to-Speech</b> reader!", | |
| "welcome": "Welcome to the <b>Hong Kong Waitau and Hakka Text-to-Speech</b> reader!", |
| "intro": "Welcome to the <b>Hong Kong Wai Tau Waa and Hakka Text-to-Speech (TTS)</b> reader!", | ||
| "heritage": "<b>Wai Tau Waa</b> and <b>Hakka</b> are both intangible cultural heritage of Hong Kong. However, the transmission of these indigenous languages has been disrupted due to urbanization. The new generation in walled villages has little opportunity to encounter Wai Tau Waa and Hakka, or they \"can understand but cannot speak.\"", | ||
| "purpose": "Using this Text-to-Speech (<abbr>TTS</abbr>) reader can serve as a resource for learning Wai Tau Waa and Hakka, and can also become a tool for communicating with village elders, continuing the language transmission within families and communities.", | ||
| "instructions": { | ||
| "intro": "Simply enter text in the program, and it will generate natural and fluent Wai Tau Waa or Hakka speech. Instructions:", | ||
| "step1": "Select language: Wai Tau Waa / Hakka", |
There was a problem hiding this comment.
Please stick to the translation in the README (https://github.com/hkilang/TTS#readme), and change all "Weitou" or "Wai Tau Waa" to "Waitau".
| "model": "Model ", | ||
| "data": "Data " |
There was a problem hiding this comment.
| "model": "Model ", | |
| "data": "Data " | |
| "model": "model", | |
| "data": "data" |
| "onlineMode": "Online Mode", | ||
| "offlineMode": "Offline Mode", | ||
| "voiceSpeed": "Voice Speed", | ||
| "download": "Download", |
There was a problem hiding this comment.
| "download": "Download", | |
| "download": "{{type}} Download", |
But unlike the messages in downloadStatus, this has to be title-cased, so perhaps
- use two separate labels; or
-
and add aSuggested change
"download": "Download", "download": "{{type, titlecase}} Download", interpolation.formatfunction to i18next settingsformat(value, format, lng) { if (format === "capitalize") return `${value[0].toLocaleUpperCase(lng)}${value.slice(1)}`; if (format === "titlecase") return value.split(" ").map(part => `${part[0].toLocaleUpperCase(lng)}${part.slice(1)}`).join(" "); return value; },
| "cancelledIncomplete": "Download cancelled; {{type}} incomplete", | ||
| "saveFailed": "Download failed: Error occurred while saving to database", | ||
| "saveIncomplete": "Download incomplete: Error occurred while saving to database", | ||
| "latest": "Already latest version" |
There was a problem hiding this comment.
| "latest": "Already latest version" | |
| "latest": "Latest" |
| "gatherFailed": "Unable to get {{type}} status: Database error", | ||
| "availableForDownload": "Available for download", | ||
| "newVersionAvailable": "New version available for download", | ||
| "incomplete": "{{type}} incomplete", |
There was a problem hiding this comment.
| "incomplete": "{{type}} incomplete", | |
| "incomplete": "{{type, capitalize}} incomplete", |
| }, | ||
| "credits": "This program is developed by <a href=\"https://hkilang.org\" target=\"_blank\">Hong Kong Indigenous Language Preservation Association</a>. We would like to thank the Leisure and Cultural Services Department's <a href=\"https://www.icho.hk/en/web/icho/ich_funding_scheme_introduction.html\" target=\"_blank\">Intangible Cultural Heritage Funding Scheme</a> for funding this project, and the <a href=\"https://crlls.eduhk.hk\" target=\"_blank\">Centre for Research in Linguistics and Language Sciences, The Education University of Hong Kong</a> for providing venue rental assistance.", | ||
| "technical": "The frontend of this program is developed using <a href=\"https://typescriptlang.org\" target=\"_blank\">TypeScript</a> and <a href=\"https://react.dev\" target=\"_blank\">React</a> framework, utilizing the VITS2 language model <sup><a href=\"#vits2\">[1]</a></sup> provided by <a href=\"https://hon9kon9ize.com\" target=\"_blank\">hon9kon9ize</a>. For details, please refer to the <a href=\"https://github.com/hkilang/TTS\" target=\"_blank\">source code</a>.", | ||
| "contact": "For any inquiries, please email <a href=\"mailto:info@hkilang.org\" target=\"_blank\">info@hkilang.org</a> or <a href=\"mailto:lchaakming@eduhk.hk\" target=\"_blank\">lchaakming@eduhk.hk</a>.", |
There was a problem hiding this comment.
| "contact": "For any inquiries, please email <a href=\"mailto:info@hkilang.org\" target=\"_blank\">info@hkilang.org</a> or <a href=\"mailto:lchaakming@eduhk.hk\" target=\"_blank\">lchaakming@eduhk.hk</a>.", | |
| "contact": "Should you have any enquiries, please email <a href=\"mailto:info@hkilang.org\" target=\"_blank\">info@hkilang.org</a> or <a href=\"mailto:lchaakming@eduhk.hk\" target=\"_blank\">lchaakming@eduhk.hk</a>.", |
|
@Hydramus Would you like to continue working on this PR, or would you like me to take it over? |
Hi i wanted to bring this to more hakka speakers who are not as comfortable with reading Chinese so I've added support for English and potentially any other language (or simplified Chinese even)
Let me know what you think and if you have any questions. (Also, sorry this is such a large PR 😅 )