Skip to content

Untranslated text discrepancy to be highlighted in blue#26

Closed
LambdaLearner wants to merge 5 commits intodimagi:masterfrom
LambdaLearner:sbansal/icds-1709
Closed

Untranslated text discrepancy to be highlighted in blue#26
LambdaLearner wants to merge 5 commits intodimagi:masterfrom
LambdaLearner:sbansal/icds-1709

Conversation

@LambdaLearner
Copy link

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

Copy link
Contributor

@adil-uddin adil-uddin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions and general formatting required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after if

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.


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)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a word occurs more than once, do we increment occurrence count or we ignore it.

Copy link
Author

@LambdaLearner LambdaLearner Sep 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We take only unique words in the dictionary and value will always be 1 in the dictionary. Hence this situation doesn't arise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bracket not need. Also please use pep-8 styling. There's no spaces after commas and general formatting issues.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

Copy link
Contributor

@adil-uddin adil-uddin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, except for minor nits. @mkangia

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: spaces after commas

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: space around = operator

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@mkangia
Copy link
Contributor

mkangia commented Sep 25, 2020

@adil-uddin all resolved on this now?

Do we need to test this once before merging?

@adil-uddin
Copy link
Contributor

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

@mkangia
Copy link
Contributor

mkangia commented Sep 27, 2020

@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.

@adil-uddin
Copy link
Contributor

image_2020_09_28T13_49_58_714Z
@mkangia @dungeonmaster51 I just tested with exact scenario mentioned in the ticket and it doesn't seem to detect the missing translation ?

@mkangia
Copy link
Contributor

mkangia commented Oct 11, 2020

Closing in favor of #28

@mkangia mkangia closed this Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments