Apps-android-commons: No source text for Commons-android-strings-welcome_help_button_text (commons-android-strings)

Created on 1 Aug 2018  路  18Comments  路  Source: commons-app/apps-android-commons

Summary:

I am seeing this in our logs:
No source text for Commons-android-strings-welcome_help_button_text (commons-android-strings)

It's probably the previously encountered issue about HTML tags present. Could you apply the usual fix?

good first issue

Most helpful comment

Note to collaborators @maskaravivek @neslihanturan @nicolas-raoul - In the future when we merge PRs, we should check that the strings added do not have HTML tags without CDATA.

All 18 comments

Also noticed another one now: Commons-android-strings-nominated_see_more

@Nikerabbit can you please elaborate upon the issue and also give some insights on how to resolve it?

1258 has more details.

Okay! Thanks! I got that.
Just wanted to know at what point does No source text for Commons-android-strings-welcome_help_button_text (commons-android-strings) get logged?

It's a sanity check I've put in our (translatewiki.net) code to catch issues like this.

This looks to be similar to #1333 . I will copy my suggestion here:

So, what needs to be done in this task is:

  1. go to strings.xml and search for all strings that have a <u> tag added but no CDATA tag
  2. add the CDATA tag to those strings

Note to collaborators @maskaravivek @neslihanturan @nicolas-raoul - In the future when we merge PRs, we should check that the strings added do not have HTML tags without CDATA.

Thanks @Nikerabbit @misaochan for the clarification.
I would like to work on this issue.

@Mansi449 wonderful! However, it seems that both you and @arshadkazmi42 have expressed interest simultaneously in working on this in separate issues, so I am not sure who to assign it to. Could you both please discuss among yourselves and hopefully come to an agreement? :) Thanks!

@Mansi449 if you have started working on this you can take this up. If you would like me to work on it, let me know.

Thanks a lot @arshadkazmi42 for letting me take this up.

Thanks guys! @Mansi449 it is yours. :)

I added the CDATA tag to a string:
<string name="welcome_help_button_text"><![CDATA[<u>More Information</u>]]></string>
But it gives the following result:
screenshot_20180813-175601

I think something like this has to be done:
TextView tv = findViewById(R.id.welcomeInfo); (welcomeInfo is the TextView that contains the string "More Information").
Then:
tv.setText(Html.fromHtml(String.valueOf(R.string.welcome_help_button_text)));

@Nikerabbit @misaochan What do you think?

Yes, you are right. You need to use:

tv.setText(Html.fromHtml(String.valueOf(R.string.welcome_help_button_text)));

Thanks @maskaravivek I would make the necessary changes.

@Nikerabbit @maskaravivek @misaochan I have made the required changes for the welcome_help_button_text string.
But another string <string name="nominated_see_more"><u>See webpage for details</u></string> has the same issue.
So shall I create a PR for this issue now and fix the nominated_see_more string in a separate issue or shall I create the PR only after fixing the nominated_see_more string also?

IMO it should be fine to fix both the strings in a single PR. You can name the PR accordingly.

Ok sure, thanks!

Was this page helpful?
0 / 5 - 0 ratings