Last active
May 1, 2020 15:50
-
-
Save souljorje/e08a2bbd61843468923c870e33dc4336 to your computer and use it in GitHub Desktop.
Transliteration from Georgian to English JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
inspired by https://stackoverflow.com/a/36310163/12496886 | |
transliterateGeToEN('აბგდევზთიკლმნოპჟრსტღყშცჩძწჭხჯჰ') // "abgdevztiklmnopzhrstghkhshcchdztschxjh" | |
***/ | |
export const transliterateGeToEN = (text) => text | |
.replace(/\u10D0/g, 'a') | |
.replace(/\u10D1/g, 'b') | |
.replace(/\u10D2/g, 'g') | |
.replace(/\u10D3/g, 'd') | |
.replace(/\u10D4/g, 'e') | |
.replace(/\u10D5/g, 'v') | |
.replace(/\u10D6/g, 'z') | |
.replace(/\u10D7/g, 't') | |
.replace(/\u10D8/g, 'i') | |
.replace(/\u10D9/g, 'k') | |
.replace(/\u10DA/g, 'l') | |
.replace(/\u10DB/g, 'm') | |
.replace(/\u10DC/g, 'n') | |
.replace(/\u10DD/g, 'o') | |
.replace(/\u10DE/g, 'p') | |
.replace(/\u10DF/g, 'zh') | |
.replace(/\u10E0/g, 'r') | |
.replace(/\u10E1/g, 's') | |
.replace(/\u10E2/g, 't') | |
.replace(/\u10E3/g, 'u') | |
.replace(/\u10E4/g, 'f') | |
.replace(/\u10E5/g, 'q') | |
.replace(/\u10E6/g, 'gh') | |
.replace(/\u10E7/g, 'kh') | |
.replace(/\u10E8/g, 'sh') | |
.replace(/\u10E9/g, 'ch') | |
.replace(/\u10EA/g, 'c') | |
.replace(/\u10EB/g, 'dz') | |
.replace(/\u10EC/g, 'ts') | |
.replace(/\u10ED/g, 'ch') | |
.replace(/\u10EE/g, 'x') | |
.replace(/\u10EF/g, 'j') | |
.replace(/\u10F0/g, 'h'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment