Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog translation support / String consistency #28

Closed
sairuk opened this issue Feb 4, 2022 · 1 comment
Closed

Dialog translation support / String consistency #28

sairuk opened this issue Feb 4, 2022 · 1 comment

Comments

@sairuk
Copy link
Collaborator

sairuk commented Feb 4, 2022

Future state thought

Refactor the dialogs to source a strings file at the top of each script that will not only provide string consistency, reducing duplication but will also permit sourcing translations based on the $LANG or similar env vars.

something like

_CONFIG=/opt/retronas/dialog/retronas.cfg
_LANG=/opt/retronas/etc/lang/$LANG.string

rn_tcpser() {
source $_CONFIG
source $_LANG
dialog \
  --backtitle "${RN_TITLE}" \
  --title "${RN_TITLE} ${RN_TCPSER} ${RN_MENU}" \
  --clear \
  --menu "${RN_IPADDRESS}: ${MY_IPS} \
  \n
  \n${RN_PLSOPT}" ${MG} 10 \
  "01" "${RN_MAIN_MENU}" \

where

/opt/retronas/etc/lang/$LANG.string would look like

RN_TITLE=RetroNAS
RN_TCPSER=TCPSer
RN_MENU=menu
RN_IPADDRESS="My IP addresses:"
RN_PLSOPT=Please select an option
RN_MAIN_MENU=Main Menu
@sairuk
Copy link
Collaborator Author

sairuk commented Feb 4, 2022

Closing this to move it to Discussions

@sairuk sairuk closed this as completed Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant