discourse-translator/spec/lib
Natalie Tay 346d47cde9
FIX: Normalize languages within Discourse AI translator (#194)
The criteria to allow a post to be translated is if the user's locale is different from the site's default locale.

For each translator (e.g. Google, Amazon, Azure), we maintain a list of mappings `SUPPORTED_LANG_MAPPING` for each locale. On top of that, this mapping is also used to define what language the post should be translated to. When using most translators available in the plugin, "en_GB" forums will translate text to "en" due to these mappings. This is not a problem for Discourse AI provider, since there are no restrictions on language.

This PR normalizes locales within Discourse AI translator, so that it sees "ar" to be the same as "ar_SA".
2025-01-13 17:13:26 +08:00
..
guardian_extension_spec.rb FIX: Normalize languages within Discourse AI translator (#194) 2025-01-13 17:13:26 +08:00
translator_selection_validator_spec.rb FEATURE: Add DiscourseAi translator (#181) 2024-12-03 19:15:14 +08:00