Skip to content

Adding support for English (and other languages in the future)#7

Open
Hydramus wants to merge 13 commits into
hkilang:mainfrom
Hydramus:main
Open

Adding support for English (and other languages in the future)#7
Hydramus wants to merge 13 commits into
hkilang:mainfrom
Hydramus:main

Conversation

@Hydramus

@Hydramus Hydramus commented Apr 19, 2026

Copy link
Copy Markdown

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 😅 )

@graphemecluster

Copy link
Copy Markdown
Member

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 graphemecluster self-requested a review April 20, 2026 15:34

@graphemecluster graphemecluster left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/db/DownloadRow.tsx
// 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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this follow the current language?

Comment thread src/i18n/locales/en.json
Comment on lines +27 to +28
"waitau": "Wai Tau Waa",
"hakka": "Hakka Wa",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"waitau": "Wai Tau Waa",
"hakka": "Hakka Wa",
"waitau": "Waitau",
"hakka": "Hakka",

Comment thread src/i18n/locales/en.json
"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."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "Enter text to hear Weitou and Hakka pronunciation, preserving local languages."
"description": "Enter text to hear Waitau and Hakka pronunciation, preserving local languages."

Comment thread src/i18n/locales/en.json
},
"languageSelection": {
"title": "Select Language",
"welcome": "Welcome to the <b>Hong Kong Weitou and Hakka Text-to-Speech</b> reader!",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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!",

Comment thread src/i18n/locales/en.json
Comment on lines +112 to +117
"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",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please stick to the translation in the README (https://github.com/hkilang/TTS#readme), and change all "Weitou" or "Wai Tau Waa" to "Waitau".

Comment thread src/i18n/locales/en.json
Comment on lines +43 to +44
"model": "Model ",
"data": "Data "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"model": "Model ",
"data": "Data "
"model": "model",
"data": "data"

Comment thread src/i18n/locales/en.json
"onlineMode": "Online Mode",
"offlineMode": "Offline Mode",
"voiceSpeed": "Voice Speed",
"download": "Download",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"download": "Download",
"download": "{{type}} Download",

But unlike the messages in downloadStatus, this has to be title-cased, so perhaps

  1. use two separate labels; or
  2. Suggested change
    "download": "Download",
    "download": "{{type, titlecase}} Download",
    and add a interpolation.format function to i18next settings
    format(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;
    },

Comment thread src/i18n/locales/en.json
"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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"latest": "Already latest version"
"latest": "Latest"

Comment thread src/i18n/locales/en.json
"gatherFailed": "Unable to get {{type}} status: Database error",
"availableForDownload": "Available for download",
"newVersionAvailable": "New version available for download",
"incomplete": "{{type}} incomplete",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"incomplete": "{{type}} incomplete",
"incomplete": "{{type, capitalize}} incomplete",

Comment thread src/i18n/locales/en.json
},
"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>.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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>.",

@graphemecluster

Copy link
Copy Markdown
Member

@Hydramus Would you like to continue working on this PR, or would you like me to take it over?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants