Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Dialogs in CacheManager contain hardcoded English strings #1668

@grishka

Description

@grishka

Issue Type

[ ] Question
[ ] Bug
[x] Improvement
[ ] Build system related
[ ] Performance
[ ] Documentation

Description and/or steps/code to reproduce the problem

CacheManager shows dialogs, and all the user-visible strings are hardcoded and not translatable. For example:

public CacheManagerDialog getDownloadingDialog(final Context pCtx, final CacheManagerTask pTask) {
return new CacheManagerDialog(pCtx, pTask) {
@Override
protected String getUITitle() {
return "Downloading tiles";
}
@Override
public void onTaskFailed(int errors) {
super.onTaskFailed(errors);
Toast.makeText(pCtx, "Loading completed with " + errors + " errors.", Toast.LENGTH_SHORT).show();
}
};
}

I was able to substitute this particular one for a localized string like this, but still...

CacheManager mgr=new CacheManager(OSM.OPENTOPOMAP, new SqliteArchiveTileWriter(tilesDb.getAbsolutePath()), minZoom, maxZoom){
	@Override
	public CacheManagerDialog getDownloadingDialog(Context pCtx, CacheManagerTask pTask){
		return new CacheManagerDialog(pCtx, pTask) {
			@Override
			protected String getUITitle() {
				return getString(R.string.downloading_map);
			}

			@Override
			public void onTaskFailed(int errors) {
				super.onTaskFailed(errors);
				Toast.makeText(pCtx, "Loading completed with " + errors + " errors.", Toast.LENGTH_SHORT).show();
			}
		};
	}
};

It would be nice to move the strings to a strings.xml file so that apps could provide their own translated versions by overriding them in other locales.

Environment

If it's a bug, version(s) of android this affects:

All

Version of osmdroid the issue relates to:

6.1.2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions