so I know this is a not a good question for the StackOverflow format. but I am at a bit of a loss, feel free to recommend a different place to put this where it may get some eyeballs
I am very familliar with the xgettext stuff for localizing your python program. currently we are saving user preferences as strings (eg: user_prefs = {'temperature':u'\u00b0C Fahrenheit', 'volumetric':'Cubic inches', ...}
)
this works fine, and when operating in foreign languages we attempt(mostly successfully) to reverse the string localization back to english before saving it. so that the saved string is always the english version, and then we localize them when we start the program.
however it leads to problems later if we change 'Cubic inches'
to u'in\u00b3'
or even a small change like 'Cubic inches'
to 'Cubic Inches'
. we have somewhat compensated for this by always doing comparisons in lower case, but it feels hackish to me, and it seems like there must be a better way to do it such as saving an id (be it an index into an array or even just some unique identifier). but wondering about others experiences here with regards to future proofing user preferences so that they will always be recognized.
I suspect this will get closed (asking for subjective answers) but maybe I can get some good insight before it does