I have a nested dictionary in the following format开发者_C百科, used for internationalization (this allows our translators and non-programmers to edit this file as necessary; my backup plan is to use JSON format, but this would not be as suitable for these users..).
dict[LANGUAGE][KEY] = VALUE
I output this into a csv file in the following format:
KEY, VALUE-LANG-1, ... VALUE-LANG-N
where VALUE-LANG-I = dict[LANGUAGE-I][KEY]
This works fine, so long as the VALUEs are simple strings. I run into a problem, though, if the VALUE is anything more complex (a nested dict or a list). Is there a way to handle this robustly?
It is hard to suggest an alternative format suitable for manual editing by non-technical users without knowing the exact details of the data structures you want to store there (e.g. the nested dicts/lists that you mention).
One obvious suggestion is to stick with a computer-friendly format and provide a usable GUI for editing those files.
精彩评论