~mil/sxmo-tickets#298: 
sxmo-utils. use env variables for text strings to be able to add translations

Hi! again. im currently looking through the scripts of sxmo_modem and im seeing a log of hardcoded messages like: info "Sent text message ok" and "Couldn't send text message".

i would like to see all this strings in variables, like $MODEM_MESSAGE_SENT and $MODEM_MESSAGE_ERROR not only here but everywhere :)

my idea is to use env variables for this. create a file like .locale/en.sh where we put all those used strings inside.

this makes it possible to configure SXMO_LOCALE="en" or source it properly. on therefore we are able to translate everything and also the code gets cleaner (which is my actual goal).

Status
RESOLVED DUPLICATE
Submitter
~dni
Assigned to
No-one
Submitted
3 years ago
Updated
3 years ago
Labels
No labels applied.

~proycon REPORTED DUPLICATE 3 years ago

What you're proposing is kind of a custom solution to issue #247 (so I'm considering this a duplicate).

As I said on irc, I'm not a fan of replacing all strings with environment variables (they're for configuration) nor a custom SXMO_LOCALE, I'd rather have sxmo respect the actual locale settings and use standardized solutions if we go for proper localisation. Let's discuss this further in the existing ticket?

~dni 3 years ago

perfect! :)

Register here or Log in to comment, or comment via email.