AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.07k stars 351 forks source link

[I18n] Does this library consider suport for i18n? #390

Closed Cactusinhand closed 2 years ago

Cactusinhand commented 2 years ago

Hi @AlecAivazis Does this library consider suport for i18n?

mislav commented 2 years ago

Hi, I'm going to answer for @AlecAivazis to the best of my knowledge.

This library mostly displays text that you supply yourself, such as the wording of the prompts and all the options presented (like for Selects and MultiSelects). You control that text, so you can perform i18n of that text in your app.

However, there are a few prompts where this library renders English text of its own, mostly to clarify keybindings. Example: https://github.com/AlecAivazis/survey/blob/a8912d047bec8f7ed857969e109690f90fdbd977/select.go#L71

This text isn't explicitly configurable, but it comes from a template string which is an exported variable in the survey Go package. You could theoretically override this template string from your app to change that language.

Hope this helps! Good luck 🙇

Cactusinhand commented 2 years ago

@mislav Thanks for your help 👍🏻