Open ManasMadrecha opened 3 years ago
Let's make this a non-breaking change by ensuring the following:
Intl.DisplayNames
. (One must add a comment in the code to this effect.)Sanscript.t
, handle old names by mapping to any new names from the previous step.Sanscript.t
, handle hi-Deva
etc. by mapping to Intl.DisplayNames
.If the above is clear, please go ahead and send a pull request.
Why?
Intl.DisplayNames
in JS, we can easily get the standard names of the script. These can then be programmatically inserted intoSanscript.t(text, "here", "here")
lang
attribute likehi-Deva
orhi-Latn
.sanscript
's scripts' names likedevanagari
,bengali
, etc. serves no purpose. They cannot be used inside HTML'slang
. Also, we if anyway want the full names of the scripts we can always useIntl.DisplayNames
. But this doesn't work withsanscript
's scripts' nameslang
anyway, e.g.sanskritOCR
Approach
Of course, this will be a breaking change, so for the time being, you can simply copy+paste the current
.json
files inside thebrahmic
folder into Unicode-based names.For e.g., for
gujarati
,bengali
, etc. scripts, you can create newGujr.json
,Beng.json
files with the same content as thegujarati.json
,bengali.json
, respectively.