-
Notifications
You must be signed in to change notification settings - Fork 21
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
add lang_header arg for specify language header values #215
base: main
Are you sure you want to change the base?
Conversation
…y the language for header values in excel/csv export (you can have _xml header values and _default values for submits datas). If not set, lng arg override lang_header value.
…nguage for header values in excel/csv export (you can have _xml header values and _default values for submits datas). If not set, lang arg override lang_header arg value. Need this PR : kobotoolbox/formpack#215
Hi @jdugh . Thanks for the PR. Could you add a test that uses this column and shows how the values would change when this parameter is used? Also, if I understand correctly what this does, it might make more sense to call it |
src/formpack/pack.py
Outdated
@@ -337,7 +337,7 @@ def to_json(self, **kwargs): | |||
def export(self, lang=UNSPECIFIED_TRANSLATION, group_sep='/', hierarchy_in_labels=False, | |||
versions=-1, multiple_select="both", | |||
force_index=False, copy_fields=(), title=None, | |||
tag_cols_for_header=None): | |||
tag_cols_for_header=None, lang_header=-1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tag_cols_for_header=None, lang_header=-1): | |
header_lang=None, | |
tag_cols_for_header=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we cannot set None to default value for "header_lang" otherwise we cannot know if it is not set or set to None. And, if user call with : (lang=False,header_lang=None) I don't want to change value of arg header_lang. If user call with (lang=False) - header_lang is not set, I want to override header_lang with lang value for not change the current algo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes. Thanks for reminding me of this. I will discuss this with the team and see if we can agree on -1
or a different solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @dorey , do you know if you can agree a -1
value (or a different solution), and also, accept this PR in the futur ?
Ok thank you. I go to create the test and change the name to header_lang. Here and in KPI views. |
@joshuaberetta I have merge my PR with the master and I have change the -1 default value with a constant. |
Hi @joshuaberetta and @dorey, |
Hi @jnm. EDIT : Otherwise, Unless I'm mistaken, the endpoint on KPI API : |
add lang_header arg in export def. lang_header can be used for specify the language for header values in excel/csv export (you can have _xml header values and _default values for submits datas). If not set, lang arg override lang_header arg value.