forked from liblouis/liblouis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script for generating "display-name" metadata
- Loading branch information
Showing
9 changed files
with
571 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
./autogen.sh && | ||
./configure $ENABLE_UCS4 --with-yaml && | ||
make && | ||
make check | ||
make check && | ||
# check display names | ||
if [[ -n ${ENABLE_UCS4+x} ]]; then | ||
cd extra/generate-display-names && | ||
if ! make; then | ||
cat generate.log | ||
false | ||
fi | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CC := gcc | ||
DISPLAY_NAMES_FILE := display-names | ||
|
||
export LOUIS_TABLEPATH = $(CURDIR)/../../tables | ||
export GOPATH = $(CURDIR)/.go-packages | ||
|
||
.PHONY : check | ||
check : generate | ||
./$< $(DISPLAY_NAMES_FILE) >$<.log 2>$<.log | ||
|
||
generate : generate.o displayLanguage.a ../../liblouis/liblouis.la | ||
../../libtool --tag=CC --mode=link $(CC) -o $@ $^ -lpthread | ||
|
||
generate.o : generate.c displayLanguage.h | ||
$(CC) -I. -I../../liblouis -g -O2 -c -o $@ $< | ||
|
||
displayLanguage.a displayLanguage.h : displayLanguage.go | ||
go get golang.org/x/text/language/display | ||
go build -buildmode=c-archive $< | ||
|
||
.PHONY : clean | ||
clean : | ||
rm -rf displayLanguage.a displayLanguage.h $(GOPATH) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
* ../../tables/afr-za-g1.ctb Afrikaans braille | ||
* ../../tables/ar.tbl Arabic braille | ||
* ../../tables/as.tbl Assamese braille | ||
* ../../tables/awa.tbl Awadhi braille | ||
* ../../tables/bg.tbl Bulgarian computer braille | ||
* ../../tables/bh.tbl Bihari braille | ||
* ../../tables/bn.tbl Bengali braille | ||
* ../../tables/bo.tbl Tibetan computer braille | ||
* ../../tables/bra.tbl Braj braille | ||
* ../../tables/ca.tbl Catalan braille | ||
* ../../tables/chr-us-g1.ctb Cherokee braille | ||
* ../../tables/ckb.tbl Kurdish braille | ||
* ../../tables/cs.tbl Czech braille | ||
* ../../tables/cy-cy-g1.utb Welsh uncontracted braille | ||
* ../../tables/cy.tbl Welsh contracted braille | ||
* ../../tables/da-dk-g08.ctb Danish computer braille | ||
* ../../tables/da-dk-g16-lit.ctb Danish 6-dot uncontracted braille | ||
* ../../tables/da-dk-g16.ctb Danish 6-dot uncontracted braille | ||
* ../../tables/da-dk-g18.ctb Danish 8-dot uncontracted braille | ||
* ../../tables/da-dk-g26-lit.ctb Danish 6-dot fully contracted braille | ||
* ../../tables/da-dk-g26.ctb Danish 6-dot fully contracted braille | ||
* ../../tables/da-dk-g26l-lit.ctb Danish 6-dot partially contracted braille | ||
* ../../tables/da-dk-g26l.ctb Danish 6-dot partially contracted braille | ||
* ../../tables/da-dk-g28.ctb Danish 8-dot fully contracted braille | ||
* ../../tables/da-dk-g28l.ctb Danish 8-dot partially contracted braille | ||
* ../../tables/de.tbl German fully contracted braille | ||
* ../../tables/de-de-g0.utb German uncontracted braille | ||
* ../../tables/de-de-g1.ctb German partially contracted braille | ||
* ../../tables/de_CH.tbl Swiss High German fully contracted braille | ||
* ../../tables/de-ch-g0.utb Swiss High German uncontracted braille | ||
* ../../tables/de-ch-g1.ctb Swiss High German partially contracted braille | ||
* ../../tables/dra.tbl Dravidian computer braille | ||
* ../../tables/el.tbl Greek braille | ||
* ../../tables/gr-bb.ctb Ancient Greek braille | ||
* ../../tables/ar-fa.utb Persian braille | ||
* ../../tables/fa-ir-comp8.ctb Persian computer braille | ||
* ../../tables/fa-ir-g1.utb Persian braille | ||
../../tables/en-ueb-g1.ctb English (UEB) uncontracted braille | ||
../../tables/en-ueb-g2.ctb English (UEB) contracted braille | ||
* ../../tables/en_CA.tbl Canadian English computer braille | ||
* ../../tables/en-gb-g1.utb U.K. English uncontracted braille | ||
* ../../tables/en_GB.tbl U.K. English contracted braille | ||
* ../../tables/en-gb-comp8.ctb U.K. English computer braille | ||
../../tables/en-us-g1.ctb U.S. English (EBAE) uncontracted braille | ||
../../tables/en_US-comp8-ext.tbl U.S. English (EBAE) computer braille | ||
../../tables/en_US.tbl U.S. English (EBAE) contracted braille | ||
* ../../tables/eo.tbl Esperanto braille | ||
* ../../tables/eo-g1-x-system.ctb Esperanto x-system braille | ||
* ../../tables/es.tbl Spanish braille | ||
* ../../tables/et.tbl Estonian computer braille | ||
* ../../tables/fi.tbl Finnish computer braille | ||
* ../../tables/fi.utb Finnish braille | ||
* ../../tables/fi-fi-8dot.ctb Finnish computer braille | ||
../../tables/fr-bfu-comp6.utb Unified French 6 dots braille | ||
../../tables/fr-bfu-comp8.utb Unified French 8 dots braille | ||
../../tables/fr-bfu-g2.ctb Unified French contracted braille | ||
* ../../tables/ga-g1.utb Irish uncontracted braille | ||
* ../../tables/ga.tbl Irish contracted braille | ||
* ../../tables/gd.tbl Scottish Gaelic computer braille | ||
* ../../tables/gez.tbl Ethiopic braille | ||
* ../../tables/gon.tbl Gondi braille | ||
* ../../tables/gu.tbl Gujarati braille | ||
* ../../tables/haw-us-g1.ctb Hawaiian braille | ||
* ../../tables/he.tbl Hebrew computer braille | ||
* ../../tables/hi.tbl Hindi braille | ||
* ../../tables/hr-g1.tbl Croatian braille | ||
* ../../tables/hr-comp8.tbl Croatian computer braille | ||
* ../../tables/hu-hu-comp8.ctb Hungarian computer braille | ||
* ../../tables/hu.tbl Hungarian partially contracted braille | ||
* ../../tables/hu-hu-g2.ctb Hungarian fully contracted braille | ||
* ../../tables/hy.tbl Armenian computer braille | ||
* ../../tables/is.tbl Icelandic braille | ||
* ../../tables/it.tbl Italian braille | ||
* ../../tables/it-it-comp8.utb Italian computer braille | ||
* ../../tables/iu-ca-g1.ctb Inuktitut braille | ||
* ../../tables/kha.tbl Khasi braille | ||
* ../../tables/kn.tbl Kannada braille | ||
* ../../tables/ko-2006-g2.ctb Korean contracted braille (2006 standard) | ||
* ../../tables/ko-2006-g1.ctb Korean uncontracted braille (2006 standard) | ||
* ../../tables/ko-g2.ctb Korean contracted braille | ||
* ../../tables/ko-g1.ctb Korean uncontracted braille | ||
* ../../tables/kok.tbl Konkani braille | ||
* ../../tables/kru.tbl Kurukh braille | ||
* ../../tables/lt.tbl Lithuanian 8-dot braille | ||
* ../../tables/lt-6dot.tbl Lithuanian braille | ||
* ../../tables/lv.tbl Latvian braille | ||
* ../../tables/mao-nz-g1.ctb Maori braille | ||
* ../../tables/ml.tbl Malayalam braille | ||
* ../../tables/mni.tbl Manipuri braille | ||
* ../../tables/mr.tbl Marathi braille | ||
* ../../tables/mt.tbl Maltese computer braille | ||
* ../../tables/mun.tbl Munda braille | ||
* ../../tables/mwr.tbl Marwari braille | ||
* ../../tables/no-no-g0.utb Norwegian uncontracted braille | ||
* ../../tables/no-no-g1.ctb Norwegian grade 1 contracted braille | ||
* ../../tables/no-no-g2.ctb Norwegian grade 2 contracted braille | ||
* ../../tables/no.tbl Norwegian grade 3 contracted braille | ||
* ../../tables/ne.tbl Nepali braille | ||
../../tables/nl.tbl Dutch braille as used in the Netherlands | ||
../../tables/nl_BE.tbl Dutch braille as used in Belgium | ||
* ../../tables/or.tbl Oriya braille | ||
* ../../tables/pa.tbl Punjabi braille | ||
* ../../tables/pi.tbl Pali braille | ||
* ../../tables/pl-pl-comp8.ctb Polish computer braille | ||
* ../../tables/pl.tbl Polish braille | ||
* ../../tables/pt.tbl Portuguese contracted braille | ||
* ../../tables/pt-pt-g1.utb Portuguese uncontracted braille | ||
* ../../tables/pt-pt-comp8.ctb Portuguese computer braille | ||
* ../../tables/ro.tbl Romanian computer braille | ||
* ../../tables/ru.tbl Russian braille | ||
* ../../tables/ru-compbrl.ctb Russian computer braille | ||
* ../../tables/sa.tbl Sanskrit braille | ||
* ../../tables/sd.tbl Sindhi braille | ||
* ../../tables/sv.tbl Swedish braille | ||
* ../../tables/sv-1996.ctb Swedish computer braille (1996 standard) | ||
* ../../tables/sv-1989.ctb Swedish computer braille (1989 standard) | ||
* ../../tables/sk.tbl Slovak braille | ||
* ../../tables/sl.tbl Slovenian braille | ||
* ../../tables/sl-si-comp8.ctb Slovenian computer braille | ||
* ../../tables/sr.tbl Serbian braille | ||
* ../../tables/ta-ta-g1.ctb Tamil braille | ||
* ../../tables/ta.tbl Tamil computer braille | ||
* ../../tables/te.tbl Telugu braille | ||
* ../../tables/tr.tbl Turkish computer braille | ||
* ../../tables/vi.ctb Vietnamese computer braille | ||
* ../../tables/vi.tbl Vietnamese braille |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package main | ||
|
||
import ( | ||
"C" | ||
"golang.org/x/text/language" | ||
"golang.org/x/text/language/display" | ||
) | ||
|
||
//export DisplayLanguage | ||
func DisplayLanguage(lang_c *C.char) *C.char { | ||
var lang string | ||
var ret string | ||
lang = C.GoString(lang_c) | ||
switch (lang) { | ||
case "bh": | ||
ret = "Bihari"; | ||
break; | ||
case "bn": | ||
ret = "Bengali"; | ||
break; | ||
case "ckb": | ||
ret = "Kurdish"; | ||
break; | ||
case "dra": | ||
ret = "Dravidian"; | ||
break; | ||
case "en-GB": | ||
ret = "U.K. English"; | ||
break; | ||
case "en-US": | ||
ret = "U.S. English"; | ||
break; | ||
case "eo-xsistemo": | ||
ret = "Esperanto x-system";; | ||
break; | ||
case "gez": | ||
ret = "Ethiopic"; | ||
break; | ||
case "mun": | ||
ret = "Munda"; | ||
break; | ||
case "no": | ||
ret = "Norwegian"; | ||
break; | ||
case "or": | ||
ret = "Oriya"; | ||
break; | ||
default: | ||
var namer display.Namer | ||
namer = display.English.Languages() | ||
ret = namer.Name(language.MustParse(lang)) | ||
} | ||
return C.CString(ret) | ||
} | ||
|
||
//export NativeLanguage | ||
func NativeLanguage(lang_c *C.char) *C.char { | ||
var lang string | ||
var ret string | ||
var namer display.Namer | ||
lang = C.GoString(lang_c) | ||
namer = display.Self | ||
ret = namer.Name(language.MustParse(lang)) | ||
return C.CString(ret) | ||
} | ||
|
||
// main function required for interfacing with C | ||
func main() {} |
Oops, something went wrong.