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

Can't localize status text on BrowseGridFragment (in setStatusText) #4224

Open
koreapyj opened this issue Nov 17, 2024 · 1 comment
Open
Labels
enhancement New feature or request good-first-issue Good for newcomers

Comments

@koreapyj
Copy link
Contributor

Describe the feature you'd like

Status text format is hardcoded and it will make troubles in some languages(Korean, Japanese etc.).

public void setStatusText(String folderName) {
String text = getString(R.string.lbl_showing) + " ";
FilterOptions filters = mAdapter.getFilters();
if (filters == null || (!filters.isFavoriteOnly() && !filters.isUnwatchedOnly())) {
text += getString(R.string.lbl_all_items);
} else {
text += (filters.isUnwatchedOnly() ? getString(R.string.lbl_unwatched) : "") + " " +
(filters.isFavoriteOnly() ? getString(R.string.lbl_favorites) : "");
}
if (mAdapter.getStartLetter() != null) {
text += " " + getString(R.string.lbl_starting_with) + " " + mAdapter.getStartLetter();
}
text += " " + getString(R.string.lbl_from) + " '" + folderName + "' " + getString(R.string.lbl_sorted_by) + " " + getSortOption(mAdapter.getSortBy()).name;
binding.statusText.setText(text);
}

I suggest to use printf format like lbl_user_last_used.

summary = context.getString(
R.string.lbl_user_last_used,
DateFormat.getDateInstance(DateFormat.MEDIUM).format(user.lastUsed),
DateFormat.getTimeInstance(DateFormat.SHORT).format(user.lastUsed)
)

Currently, there is no way to handle it properly as a translator.

@koreapyj koreapyj added the enhancement New feature or request label Nov 17, 2024
@nielsvanvelzen nielsvanvelzen added the good-first-issue Good for newcomers label Nov 17, 2024
@nielsvanvelzen
Copy link
Member

I think we should simplify this code a bit, I don't think everything that is shown in the "status text" is really necessary. The 2 filters (favorited&unwatched) are already indicated by the buttons in the top-right of the screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants