Skip to content
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

Tidying up the 'strings.xml' files #442

Closed
berkaygunduzz opened this issue Dec 8, 2020 · 17 comments · Fixed by #445
Closed

Tidying up the 'strings.xml' files #442

berkaygunduzz opened this issue Dec 8, 2020 · 17 comments · Fixed by #445
Assignees
Labels
enhancement New feature or request

Comments

@berkaygunduzz
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When i translate, it was hard to find out where am i and where is the string that i will control.

Describe the solution you'd like

I want to group strings and make topic comments to their head for all string.xml files.
Group names that i suggest:

  • Navigation Drawer
  • Library
  • Saved Presets
  • Sleep Timer
  • Wake-up Timer
  • Theme
  • About
  • Help
  • Support Development
  • Buttons
  • Others

An example:

  ...
  <!-- Navigation Drawer -->
  <string name="library"></string>
  <string name="about"></string>
  <string name="report_issue"></string>
  ...

  <!-- Library -->
  <string name="airplane_inflight"></string>
  <string name="airplane_seatbelt_beeps"></string>
  <string name="birds"></string>
  ...
@berkaygunduzz berkaygunduzz added the enhancement New feature or request label Dec 8, 2020
@ashutoshgngwr
Copy link
Member

@berkaygunduzz While this sounds awesome, you'll have to do it for all the locales to keep things consistent. I'm open to accepting these changes if you're upto it.

@berkaygunduzz
Copy link
Contributor Author

Great, i will start it as soon as possible.

@ashutoshgngwr ashutoshgngwr changed the title Permission for clear up string.xml files Tidying up the 'strings.xml' files Dec 8, 2020
@berkaygunduzz
Copy link
Contributor Author

@ashutoshgngwr How it looks like? This is a draft and it will be alphabetical. If you have suggestions i'm open to them.
strings.xml

Btw, i won't make it hand by hand, i will make a Python script that will do it. Also i will share it when finished.

@ashutoshgngwr
Copy link
Member

@berkaygunduzz Yeah, this works! Much better than the what we have now.

@berkaygunduzz
Copy link
Contributor Author

I don't have a full perfection on app so when you have time, can you control that all strings are in correct topic?

@ashutoshgngwr
Copy link
Member

ashutoshgngwr commented Dec 8, 2020

I made a few changes and added more granular sections. I accidentally replaced 3-blank lines with 2-blank lines. You can keep whichever you prefer.

strings.xml.txt

@berkaygunduzz
Copy link
Contributor Author

Looks great, thanks.

@berkaygunduzz
Copy link
Contributor Author

berkaygunduzz commented Dec 9, 2020

@ashutoshgngwr Because of i used Python script , it converted special chars to codes like &->235; Is it problem? How can i fix it? Here is commit

@berkaygunduzz
Copy link
Contributor Author

Ok, i will try to fix it.

@ashutoshgngwr
Copy link
Member

@berkaygunduzz Ignore that comment. As you said, it was the script that did this. Let me see if I can find a fix.

@ashutoshgngwr
Copy link
Member

Could you please share your script so that I know what I am dealing with?

@berkaygunduzz
Copy link
Contributor Author

It's a bit messy. Tested and worked with Python 3.8.6
tidy.zip

@berkaygunduzz
Copy link
Contributor Author

berkaygunduzz commented Dec 9, 2020

Btw, I can fix it with this codes are decimal and it gives me unicode

@ashutoshgngwr
Copy link
Member

ashutoshgngwr commented Dec 9, 2020

@berkaygunduzz On line 38, if you pass another parameter encoding="UTF-8", it will write strings as UTF-8. I tested it, it fixes the issue.

Ref: https://stackoverflow.com/questions/10046755/write-xml-utf-8-file-with-utf-8-data-with-elementtree

@berkaygunduzz
Copy link
Contributor Author

Well, that's great. Thanks

@berkaygunduzz
Copy link
Contributor Author

Do you want me to delete topic comments if it has no strings?

@ashutoshgngwr
Copy link
Member

Yeah, you can delete the empty ones.

ashutoshgngwr added a commit that referenced this issue Dec 10, 2020
Tidying up the 'strings.xml' files for #442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants