Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

String localization does not work when using the static framework #9072

@friedbunny

Description

@friedbunny

Our replacement NSLocalizedString methods rely on +[NSBundle mgl_frameworkBundle] to provide the Mapbox bundle that contains the localizations.

When using the static Mapbox.framework:

  1. Localizations live in a separate Mapbox.bundle.
  2. +[NSBundle mgl_frameworkBundle] returns the app bundle (not Mapbox.framework or Mapbox.bundle).

This means that localizations never load because we’re looking for them in the base app bundle, not Mapbox.bundle.

(Mapbox.bundle has existed for static builds since #4455.)

Why do images and such work?

For other resources that we load from the bundle, like images or SSL certificates, we manually append Mapbox.bundle to the path using -[NSBundle mgl_resourcesDirectory]:

NSBundle *frameworkBundle = [NSBundle mgl_frameworkBundle];
NSString *resource = [frameworkBundle pathForResource:@"somefile"
                                               ofType:@"extension"
                                          inDirectory:frameworkBundle.mgl_resourcesDirectory];
[NSData dataWithContentsOfFile:resource];

This works, but seems like incorrect behavior: shouldn’t we be treating Mapbox.bundle as the bundle and not just a directory?

/cc @boundsj @1ec5

Metadata

Metadata

Assignees

Labels

bugiOSMapbox Maps SDK for iOSlocalizationHuman language support and internationalization

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions