IDEMSInternational / idems_translation

GNU General Public License v3.0
0 stars 3 forks source link

FacilitatorApp MY insert empty string in splitgps #53

Closed esmeetewinkel closed 10 months ago

esmeetewinkel commented 10 months ago

Running

py app/scripts/prepare_for_translation.py app\config_files\plh_facilitator_my_settings.json

only works correctly when the proposed changes are made to plh_facilitator_my_settings.json, that is, the SplitGroups each contain two items. Otherwise, I get the error

Traceback (most recent call last):
  File "C:\Users\Esmee\Documents\GitHub\idems_translation\app\scripts\prepare_for_translation.py", line 40, in <module>
    main()
  File "C:\Users\Esmee\Documents\GitHub\idems_translation\app\scripts\prepare_for_translation.py", line 26, in main
    dest_path = group_info[1]
IndexError: list index out of range
image

@edmoss345 Could you see if you can fix this in the prepare_for_translation.py script? If yes, we can undo the changes in my commit. If no, we can just merge this as is because this does provide a work-around.

edmoss345 commented 10 months ago

@esmeetewinkel , having reminded myself what is going on here, the reason that SplitGroups expects pairs of values is that In SplitGroups the first entry in the list is the name of the file where all of the translated text is collected, the second entry in the list is the folder in which that file is stored. I'm assuming that if you don't want to provide the folder information, then you just want all the POT files to be exported direct to the 'ReadyForTranslation" folder. They will all go into an 'en' file by default.

The workaround you have is ok, but I will just make a quick modification to the code so that if we don't provide a folder location then nothing will crash.