question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some languages have overlapping characters. To provide the most accurate result, we could accept a language hint and prefer that language when there’s a conflict. You would still be able to use multiple languages in a string, but the provided one gets priority. For example, sv-SE to prioritize the Swedish replacement.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:38 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dotnetCarpentercommented, Mar 13, 2020

BCP-47 is used in most places currently, from Accept-language in HTTP, to lang in HTML, to i18n features in ECMAScript’s locale support.

I could get behind BCP-47 for the sole reason that it is familiar. But also more granular than a language code.

1reaction
Mottiecommented, Feb 17, 2020

We started building something similar to this a few years ago - https://github.com/diacritics - but we never finished it.

We had the transliteration default to general usage, but also allowed the user set the language and variant. For example:

const transliterate = require("diacritics-transliterator").transliterate;

const german = transliterate("¿abcñ-ß123?", "decompose", "de");
/* german => "¿abcñ-ss123?"; only the German s-sharp is replaced */

const spanish = transliterate("¿abcñ-ß123?", "base", "es");
/* spanish => "?abcn-ß123?"; only the Spanish ñ is modified */

const generic = transliterate("¿abcñ-ß123?");
/* generic => "?abcn-ß123?"; the base of ß is still ß */

const unchanged = transliterate("¿abcñ-ß123?", "base", "test");
/* unchanged => "¿abcñ-ß123?"; if no diacritics match the set language variant,
  the original string is returned */

But, that might have been too aggressive because the code owner opted to rewrite the transliterater to be much more basic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Effective Communication vs. The Language of Hint
The language of hint is both ineffectual and unhealthy. It is ineffectual because it is not clear and generally does not get us...
Read more >
Google OCR language hints - Stack Overflow
Does anyone know where I would specify a language hint in my code? I am programming it using a .net console application. using...
Read more >
39 English Language Hints ideas - Pinterest
Apr 28, 2020 - Explore Metlang's board "English Language Hints", followed by 288 people on Pinterest. See more ideas about learn english, english...
Read more >
OCR Language Support | Cloud Vision API
Language Language (English name) languageHints code Script / notes Mapped to بهسا اچيه Acehnese ace Latn Latin script model Lwo Acholi ach Latn Latin script...
Read more >
108 Language Cheat Sheets - Cheatography.com
108 Cheat Sheets tagged with Language ; French Cheat Sheet. English to French cheat sheet, with useful words and phrases to take with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found