Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 2.35 KB

README.md

File metadata and controls

68 lines (50 loc) · 2.35 KB

JuliaSurveyForm

CI codecov

A package generates Julia-based survey form in many different languages and formats. This package is motivated by creating Chinese translation for JuliaCon's Julia survey every year and I'd like to automate this process with good text-diff using TOML and automated Google translate.

Installation

JuliaSurveyForm is a   Julia Language   package. To install JuliaSurveyForm, please open Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then type the following command

pkg> add JuliaSurveyForm

Usage

read the TOML file from survey directory

surveys_dir(xs...) = pkgdir(JuliaSurveyForm, "surveys", xs...)

survey_en_US = from_toml(Survey, surveys_dir("JuliaSurvey.en_US.toml"))
survey_zh_CN = from_toml(Survey, surveys_dir("JuliaSurvey.zh_CN.toml"))

then you can translate to other languages based on the version you import, e.g we can translate from simplified Chinese to traditional Chinese, or from Chinese to Japanese or Korean.

survey_zh_TW = JuliaSurveyForm.translate(survey_zh_CN, zh_TW)
survey_ja_JP = JuliaSurveyForm.translate(survey_zh_CN, ja_JP)
survey_ko_KR = JuliaSurveyForm.translate(survey_zh_CN, ko_KR)

then we can serialize the translated version into either markdown or TOML file.

JuliaSurveyForm.emit_toml(surveys_dir("JuliaSurvey.zh_TW.toml"), survey_zh_TW)
JuliaSurveyForm.emit_toml(surveys_dir("JuliaSurvey.ja_JP.toml"), survey_ja_JP)
JuliaSurveyForm.emit_toml(surveys_dir("JuliaSurvey.ko_KR.toml"), survey_ko_KR)

JuliaSurveyForm.emit_markdown("JuliaSurvey.zh_CN.md", survey_zh_CN)
JuliaSurveyForm.emit_markdown("JuliaSurvey.zh_CN.md", survey_zh_CN)

License

MIT License