Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect chinese dialect #2270

Open
alltheseas opened this issue May 17, 2024 · 8 comments
Open

detect chinese dialect #2270

alltheseas opened this issue May 17, 2024 · 8 comments
Labels
bug Something is not working, or not working as intended Needs recreation Issues requires concrete steps for recreation translations Automated DeepL translations, etc

Comments

@alltheseas
Copy link
Collaborator

potential approach:

-detect correctly
-dont send language detect

@alltheseas alltheseas added bug Something is not working, or not working as intended Needs recreation Issues requires concrete steps for recreation translations Automated DeepL translations, etc labels May 17, 2024
@alltheseas
Copy link
Collaborator Author

@tyiu do you know how apple detects Chinese language(s)?

@tyiu
Copy link
Collaborator

tyiu commented May 17, 2024

Can you provide more context? Is there a specific example? Which Chinese dialects are you referring to? In general, I don't think what you're asking is even possible.

@jb55
Copy link
Collaborator

jb55 commented May 17, 2024

maybe this got lost in the meeting notes, but feedback from @Semisol was:

jb55: Hmm these don’t seem to translate for some reason, not supported?
https://damus.io/nevent1qqst492mjessnswr6usw0007kff977ka4s8zpjlatnlvrsr3jlhmwtcpzpmhxue69uhkummnw3ezuamfdejsz9nhwden5te0wfjkccte9ehx7um5wghxyctwvsq32amnwvaz7tm9v3jkutnwdaehgu3wd3skueqpz3mhxue69uhhyetvv9ujuerpd46hxtnfduncq76h

semisol: oh yeah, I you need to specify zh-* (replace * with something I forgot) not zh-

@Semisol
Copy link

Semisol commented May 17, 2024

you need to specify zh-Hant/zh-Hans instead of zh if you are doing that. NLLanguage does that for you actually, so I don't know what's happening.

@Semisol
Copy link

Semisol commented May 17, 2024

It works for me. I'm also receiving requests for translating Chinese, but I only have received <50 in the last 7 days.

image

@tyiu
Copy link
Collaborator

tyiu commented May 18, 2024

you need to specify zh-Hant/zh-Hans instead of zh if you are doing that. NLLanguage does that for you actually, so I don't know what's happening.

I added code to intentionally drop the variant part of the detected locale from NLLanguageRecognizer. I didn't realize that we shouldn't be doing this for Chinese.

damus/nostrdb/NdbNote.swift

Lines 475 to 477 in c99aaea

// Remove the variant component and just take the language part as translation services typically only supports the variant-less language.
// Moreover, speakers of one variant can generally understand other variants.
return localeToLanguage(locale)

@tyiu
Copy link
Collaborator

tyiu commented May 18, 2024

For example, DeepL expects only zh as the source locale. So maybe it depends on the translation service.

https://developers.deepl.com/docs/resources/supported-languages#source-languages

@Semisol
Copy link

Semisol commented May 18, 2024

For example, DeepL expects only zh as the source locale. So maybe it depends on the translation service.

https://developers.deepl.com/docs/resources/supported-languages#source-languages

Yeah. I think for Damus Purple the locale should be dropped at the API layer, not client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working, or not working as intended Needs recreation Issues requires concrete steps for recreation translations Automated DeepL translations, etc
Projects
Status: No status
Development

No branches or pull requests

4 participants