#103 [UI] Replace hardcoded strings in the settings

Open
opened 4 months ago by 6543 · 4 comments
6543 commented 4 months ago

Replace hardcodet strings in fragments/SettingsFragment.java with strings who can be translated via strings.xml

    private static String[] langList = {"English", "French", "German", "Russian", "Arabic"};
    private static String[] timeList = {"Pretty", "Normal"};
    private static String[] codeBlockList = {"Green - Black", "White - Black", "Grey - Black", "White - Grey", "Dark - White"};
    private static String[] homeScreenList = {"My Repositories", "Starred Repositories", "Organizations", "Repositories", "Profile"};
Replace hardcodet strings in **fragments/SettingsFragment.java** with strings who can be translated via strings.xml ```java private static String[] langList = {"English", "French", "German", "Russian", "Arabic"}; private static String[] timeList = {"Pretty", "Normal"}; private static String[] codeBlockList = {"Green - Black", "White - Black", "Grey - Black", "White - Grey", "Dark - White"}; private static String[] homeScreenList = {"My Repositories", "Starred Repositories", "Organizations", "Repositories", "Profile"}; ```
6543 added the
Improvement
label 4 months ago
mmarif commented 4 months ago
Owner

These strings are used as identifier to match the string in switch case for changing languages etc.

Translating them will make the app crash unless IDs are introduced. Let’s see what I can do about it.

These strings are used as identifier to match the string in switch case for changing languages etc. Translating them will make the app crash unless IDs are introduced. Let's see what I can do about it.
6543 commented 4 months ago
Poster

I noticed,it won’t be easy

I noticed,it won't be easy
mmarif commented 4 months ago
Owner

Yes, need some work.

But let’s keep this issue open for now and who knows can refactor in the future.

Yes, need some work. But let's keep this issue open for now and who knows can refactor in the future.
mmarif commented 6 days ago
Owner

This commit has made it possible to add new strings dynamically and translate them also.

377040add6

This commit has made it possible to add new strings dynamically and translate them also. https://codeberg.org/gitnex/GitNex/commit/377040add6c36ecc9a652f1f37ad1584be105ae4
mmarif added this to the 3.3.0 milestone 6 days ago
mmarif self-assigned this 6 days ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.