Untranslated text discrepancy to be highlighted in blue#26
Untranslated text discrepancy to be highlighted in blue#26LambdaLearner wants to merge 5 commits intodimagi:masterfrom
Conversation
adil-uddin
left a comment
There was a problem hiding this comment.
Some questions and general formatting required.
|
|
||
| for i in x.split(): | ||
| i = re.sub(r'[\W\_]','',i) | ||
| if not outputDict.get(i) and (i and i.strip()) and not (re.match(r'^[0-9]*$', i)): |
There was a problem hiding this comment.
If a word occurs more than once, do we increment occurrence count or we ignore it.
There was a problem hiding this comment.
We take only unique words in the dictionary. The keys are unique and value will always be 1. We do not increment count if the word occurs again.
| Returns list of common words and whether the script is english in both the columns or not. | ||
|
|
||
| """ | ||
| sharedWords = list(set(baseDict).intersection(colDict)) |
There was a problem hiding this comment.
Do we just compare only the shared words or even the occurrence count. For example, if base text has word w 2 times, and translated text has same word w only once, what do we do?
There was a problem hiding this comment.
We take only unique words in the dictionary and value will always be 1 in the dictionary. Hence this situation doesn't arise.
There was a problem hiding this comment.
bracket not need. Also please use pep-8 styling. There's no spaces after commas and general formatting issues.
adil-uddin
left a comment
There was a problem hiding this comment.
Looks good to me, except for minor nits. @mkangia
There was a problem hiding this comment.
Nit: spaces after commas
There was a problem hiding this comment.
Nit: space around = operator
|
@adil-uddin all resolved on this now? Do we need to test this once before merging? |
|
yes @mkangia I think this is good to go but better to test it once. If @dungeonmaster51 can post the results of his testing here that'd be great |
|
@adil-uddin I don't think @dungeonmaster51 would be around to test this. Can you do a test? I hope it will be quick and won't take long. let me know if you are not able to find time for this. |
|
|
|
Closing in favor of #28 |

https://dimagi-dev.atlassian.net/browse/ICDS-1709
SUMMARY
This PR makes improvements to Commcare translation checker script
Checks for missing translations or English words in regional languages and highlights the text discrepancy in blue