Skip to content

Fix warnings about string resources 'without required default value' #2655

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

Closed
domdomegg opened this issue Mar 18, 2019 · 6 comments
Closed

Comments

@domdomegg
Copy link
Member

Summary:

There are a bunch of warnings about string resources without the required default value (i.e. a fallback in strings.xml). As these strings are not used throughout the app I think we should remove them.

The main benefit is that it'll be easier to search for failures in the logs as the string resources have the text 'failed' in them which is annoying when going through Travis logs trying to find useful info.

Steps to reproduce:

Run a process manifest gradle task.

Logs:

> Task :app:processBetaReleaseManifest
warn: removing resource fr.free.nrw.commons.beta:string/contributions_subtitle without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/login_failed_password without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/login_failed_username without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/media_detail_media_title without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/multiple_uploads_title without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/preference_tracking without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/preference_tracking_summary without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/share_license_summary without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/starting_multiple_uploads without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/upload_image_problem_duplicate without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/uploads_pending_notification_indicator without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/use_wikidata without required default value.
> Task :app:processProdDebugManifest
warn: removing resource fr.free.nrw.commons:string/contributions_subtitle without required default value.
warn: removing resource fr.free.nrw.commons:string/login_failed_password without required default value.
warn: removing resource fr.free.nrw.commons:string/login_failed_username without required default value.
warn: removing resource fr.free.nrw.commons:string/media_detail_media_title without required default value.
warn: removing resource fr.free.nrw.commons:string/multiple_uploads_title without required default value.
warn: removing resource fr.free.nrw.commons:string/preference_tracking without required default value.
warn: removing resource fr.free.nrw.commons:string/preference_tracking_summary without required default value.
warn: removing resource fr.free.nrw.commons:string/share_license_summary without required default value.
warn: removing resource fr.free.nrw.commons:string/starting_multiple_uploads without required default value.
warn: removing resource fr.free.nrw.commons:string/upload_image_problem_duplicate without required default value.
warn: removing resource fr.free.nrw.commons:string/uploads_pending_notification_indicator without required default value.
warn: removing resource fr.free.nrw.commons:string/use_wikidata without required default value.

Would you like to work on the issue?

No, but I would be happy to review.

@domdomegg domdomegg changed the title Fix 'without default Fix warnings about string resources 'without required default value' Mar 18, 2019
@vanshikaarora
Copy link
Contributor

As these strings are not used throughout the app I think we should remove them.

@domdomegg Do you mean removing their declaration in strings.xml. Because on removing one of the listed string from strings.xml contributions_subtitle . I found that it was used in some classes(like MainActivity for contributions_subtitle)

Have I misunderstood the Issue?

@domdomegg
Copy link
Member Author

As these strings are not used throughout the app I think we should remove them.

@domdomegg Do you mean removing their declaration in strings.xml. Because on removing one of the listed string from strings.xml contributions_subtitle . I found that it was used in some classes(like MainActivity for contributions_subtitle)

Have I misunderstood the Issue?

Ah I didn't know they were used - if that's the case a default value for them should be added to strings.xml so it stops complaining.

@vanshikaarora
Copy link
Contributor

Ah I didn't know they were used - if that's the case a default value for them should be added to strings.xml so it stops complaining.

OK I'll do that 👍

@vanshikaarora
Copy link
Contributor

warn: removing resource fr.free.nrw.commons.beta:string/login_failed_password without required default value.
warn: removing resource fr.free.nrw.commons.beta:string/login_failed_username without required default value.

@domdomegg I didn't find these declarations in the latest master. Are you working on a different version?

@domdomegg
Copy link
Member Author

I think these are in master. e.g. login_failed_username is present in values-af/strings.xml

@vanshikaarora
Copy link
Contributor

@domdomegg I have raised a PR for this here. Kindly review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants