-
Notifications
You must be signed in to change notification settings - Fork 284
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
Look for locale files in main bundle on Android #485
base: master
Are you sure you want to change the base?
Conversation
…iour On Android, we do not have a system-wide GNUstep installation and thus not a 'gnustep-base' library bundle. Search the main bundle (the resource path of an Android app) for Languages/Locale.aliases instead.
As discussed in #484, this seems to duplicate a small part of the existing functionality to flexibly deploy all resources in the app bundle, and we should avoid duplication. |
PS. look at standalone.conf (a quick example standalone layout) or at the copious detail in the Base documentation on the GNUstep configuration file (particularly the part about relocatable/standalone config). |
@hmelder what kind of language string are we getting back from the system on Android? We’ve never actually shipped the "Languages" resources with our app on either Android or Windows, and if I understand correctly here it’s only needed to map language codes like "en" to "English" in case the app still uses localized resources using the old-style long names like "English.lproj" (which we don’t). So just for our own case I don’t think we should need to fix loading of the Languages resources in order to fix our issue. Maybe the first commit was already sufficient for our case? Regarding the config / file system layout, we’re already using this customized layout on Android. What’s tricky about Android though is that everything is bundled into an APK, and so neither libraries nor resources are actually in a normal file system, but instead have to be accessed via the "AAsset" API which reads them directly from the APK. We deal with this as best as we can by having the main bundle automatically check for resources in the APK as well (via |
This is probably what's causing problems:
What’s tricky about Android though is that everything is bundled into an APK, and so neither libraries nor resources are actually in a normal file system, but instead have to be accessed via the "AAsset" API which reads them directly from the APK.
Now I assume that the base library and the application, sharing the same APK, have some means of identifying resources within the APK, and I would hope that this works broadly like a filesystem (a hierarchical structure within the APK).
On other platforms, in a standalone config paths of the form ./a/b refer to item b in folder a relative to the base library. To me the obvious analogue for android would be that the AAsset based resource lookup code should treat that path as meaning item b within folder a within the APK or something similar. In other words, the dot ('.') at the start of the relative path should be interpreted by the android specific code as meaning the location of the root of the resource hierarchy within the APK.
… |
Ah yes of course, that might actually already work. We should check if placing the language resources in |
On Android, we do not have a system-wide GNUstep installation and thus not
a 'gnustep-base' library bundle. Search the main bundle (the resource path of an Android app) for Languages/Locale.aliases instead.
#484 tracks a revamp of the config infrastructure