This repository was archived by the owner on Nov 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
This repository was archived by the owner on Nov 20, 2024. It is now read-only.
Dialogs in CacheManager contain hardcoded English strings #1668
Copy link
Copy link
Closed
Milestone
Description
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:
osmdroid/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
Lines 766 to 779 in 98085a5
| 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels