summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-24 09:45:00 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-04-24 16:18:23 -0700
commit95613bd7dde7c15669022f69b7f9e611054873c1 (patch)
tree80a1d02311d3882e16b67663f0254fb50e975878
parent7a1d62dc302013e9a6a0be8cde7f2a71e64b5589 (diff)
downloadqtlocation-mapboxgl-95613bd7dde7c15669022f69b7f9e611054873c1.tar.gz
[ios, osx] Made OS X SDK localizable
Replaced the iOS-specific ilocalize make rule with a genstrings make rule that creates iOS, OS X, and shared strings files. Moved the override English .stringsdict file under darwin/resources/. Made the default OS X callout view XIB localizable. Made some hard-coded strings in the OS X SDK source localizable.
-rw-r--r--Makefile14
-rw-r--r--platform/darwin/resources/Base.lproj/Foundation.strings (renamed from platform/ios/resources/Base.lproj/Foundation.strings)0
-rw-r--r--platform/darwin/resources/en.lproj/Foundation.stringsdict (renamed from platform/ios/resources/en.lproj/Foundation.stringsdict)0
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj61
-rw-r--r--platform/osx/osx.xcodeproj/project.pbxproj75
-rw-r--r--platform/osx/sdk/Base.lproj/Localizable.strings30
-rw-r--r--platform/osx/sdk/Base.lproj/MGLAnnotationCallout.xib (renamed from platform/osx/sdk/MGLAnnotationCallout.xib)20
-rw-r--r--platform/osx/src/MGLAttributionButton.m5
-rw-r--r--platform/osx/src/MGLMapView.mm20
9 files changed, 175 insertions, 50 deletions
diff --git a/Makefile b/Makefile
index 96598011a9..6c2e58ff94 100644
--- a/Makefile
+++ b/Makefile
@@ -60,6 +60,14 @@ test-osx: osx node_modules/express
-configuration $(BUILDTYPE) \
-workspace $(OSX_WORK_PATH) -scheme CI test | xcpretty
+genstrings:
+ genstrings -u -o platform/osx/sdk/Base.lproj platform/darwin/src/*.{m,mm}
+ genstrings -u -o platform/osx/sdk/Base.lproj platform/osx/src/*.{m,mm}
+ genstrings -u -o platform/ios/resources/Base.lproj platform/ios/src/*.{m,mm}
+ mv platform/osx/sdk/Base.lproj/Foundation.strings platform/darwin/resources/Base.lproj/
+ -find platform/{darwin,ios,osx}/ -path '*/Base.lproj/*.strings' -exec \
+ textutil -convert txt -extension strings -inputencoding UTF-16 -encoding UTF-8 {} \;
+
#### iOS targets ##############################################################
IOS_OUTPUT_PATH = build/ios
@@ -125,12 +133,6 @@ ifabric: $(IOS_PROJ_PATH)
idocument:
OUTPUT=$(OUTPUT) ./platform/ios/scripts/document.sh
-ilocalize:
- genstrings -u -o platform/ios/resources/Base.lproj platform/darwin/src/*.{m,mm}
- genstrings -u -o platform/ios/resources/Base.lproj platform/ios/src/*.{m,mm}
- -find platform/ios/ -path '*/Base.lproj/*.strings' -exec \
- textutil -convert txt -extension strings -inputencoding UTF-16 -encoding UTF-8 {} \;
-
#### Android targets #####################################################
# Builds a particular android architecture.
diff --git a/platform/ios/resources/Base.lproj/Foundation.strings b/platform/darwin/resources/Base.lproj/Foundation.strings
index 9d63dfa697..9d63dfa697 100644
--- a/platform/ios/resources/Base.lproj/Foundation.strings
+++ b/platform/darwin/resources/Base.lproj/Foundation.strings
diff --git a/platform/ios/resources/en.lproj/Foundation.stringsdict b/platform/darwin/resources/en.lproj/Foundation.stringsdict
index 5f23fff93b..5f23fff93b 100644
--- a/platform/ios/resources/en.lproj/Foundation.stringsdict
+++ b/platform/darwin/resources/en.lproj/Foundation.stringsdict
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 978bf364ba..e12f36b237 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -135,7 +135,8 @@
DA88488E1CBB047F00AB86E3 /* reachability.h in Headers */ = {isa = PBXBuildFile; fileRef = DA88488D1CBB047F00AB86E3 /* reachability.h */; };
DA8848901CBB048E00AB86E3 /* reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488F1CBB048E00AB86E3 /* reachability.m */; };
DA8933A31CCC95B000E68420 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA89339F1CCC951200E68420 /* Localizable.strings */; };
- DA8933A41CCC95B000E68420 /* Foundation.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA89339D1CCC951200E68420 /* Foundation.strings */; };
+ DA8933BC1CCD2CA100E68420 /* Foundation.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933BA1CCD2CA100E68420 /* Foundation.strings */; };
+ DA8933BF1CCD2CAD00E68420 /* Foundation.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DA8933BD1CCD2CAD00E68420 /* Foundation.stringsdict */; };
DA8963371CC549A100684375 /* glyphs in Resources */ = {isa = PBXBuildFile; fileRef = DA8963331CC549A100684375 /* glyphs */; };
DA8963381CC549A100684375 /* sprites in Resources */ = {isa = PBXBuildFile; fileRef = DA8963341CC549A100684375 /* sprites */; };
DA8963391CC549A100684375 /* styles in Resources */ = {isa = PBXBuildFile; fileRef = DA8963351CC549A100684375 /* styles */; };
@@ -201,7 +202,6 @@
DABFB8711CBE9A0F00D62B32 /* MGLMapView+MGLCustomStyleLayerAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848381CBAFB8500AB86E3 /* MGLMapView+MGLCustomStyleLayerAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
DABFB8721CBE9A0F00D62B32 /* MGLUserLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848391CBAFB8500AB86E3 /* MGLUserLocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
DABFB8731CBE9A9900D62B32 /* Mapbox.h in Headers */ = {isa = PBXBuildFile; fileRef = DA88485E1CBAFC2E00AB86E3 /* Mapbox.h */; settings = {ATTRIBUTES = (Public, ); }; };
- DAF9E8931CCBFA03004C7E73 /* Foundation.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DAF9E8911CCBFA03004C7E73 /* Foundation.stringsdict */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -390,8 +390,9 @@
DA88488A1CBB037E00AB86E3 /* SMCalloutView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMCalloutView.m; sourceTree = "<group>"; };
DA88488D1CBB047F00AB86E3 /* reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = reachability.h; path = ../../include/mbgl/platform/darwin/reachability.h; sourceTree = "<group>"; };
DA88488F1CBB048E00AB86E3 /* reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = reachability.m; path = src/reachability.m; sourceTree = "<group>"; };
- DA89339E1CCC951200E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Foundation.strings; sourceTree = "<group>"; };
DA8933A01CCC951200E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = "<group>"; };
+ DA8933BB1CCD2CA100E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Foundation.strings; sourceTree = "<group>"; };
+ DA8933BE1CCD2CAD00E68420 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Foundation.stringsdict; sourceTree = "<group>"; };
DA8963331CC549A100684375 /* glyphs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = glyphs; sourceTree = "<group>"; };
DA8963341CC549A100684375 /* sprites */ = {isa = PBXFileReference; lastKnownFileType = folder; path = sprites; sourceTree = "<group>"; };
DA8963351CC549A100684375 /* styles */ = {isa = PBXFileReference; lastKnownFileType = folder; path = styles; sourceTree = "<group>"; };
@@ -414,7 +415,6 @@
DABCABBF1CB80717000A7C39 /* locations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = locations.cpp; sourceTree = "<group>"; };
DABCABC01CB80717000A7C39 /* locations.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = locations.hpp; sourceTree = "<group>"; };
DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = mbgl.xcconfig; path = ../../build/ios/mbgl.xcconfig; sourceTree = "<group>"; };
- DAF9E8921CCBFA03004C7E73 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Foundation.stringsdict; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -559,8 +559,9 @@
children = (
DA88485E1CBAFC2E00AB86E3 /* Mapbox.h */,
DA8847DE1CBAFA3E00AB86E3 /* Foundation */,
+ DA8933B91CCD2C6700E68420 /* Foundation Resources */,
DA8848331CBAFB2A00AB86E3 /* Kit */,
- DA8848621CBAFCC100AB86E3 /* Resources */,
+ DA8848621CBAFCC100AB86E3 /* Kit Resources */,
DA8847D61CBAF91600AB86E3 /* Info.plist */,
);
name = SDK;
@@ -658,14 +659,10 @@
path = src;
sourceTree = SOURCE_ROOT;
};
- DA8848621CBAFCC100AB86E3 /* Resources */ = {
+ DA8848621CBAFCC100AB86E3 /* Kit Resources */ = {
isa = PBXGroup;
children = (
DA89339F1CCC951200E68420 /* Localizable.strings */,
- DA89339D1CCC951200E68420 /* Foundation.strings */,
- DAF9E8911CCBFA03004C7E73 /* Foundation.stringsdict */,
- DA8848771CBAFD5C00AB86E3 /* api_mapbox_com-digicert.der */,
- DA8848781CBAFD5C00AB86E3 /* api_mapbox_com-geotrust.der */,
DA8848631CBAFCC100AB86E3 /* Compass.png */,
DA8848641CBAFCC100AB86E3 /* Compass@2x.png */,
DA8848651CBAFCC100AB86E3 /* Compass@3x.png */,
@@ -675,9 +672,8 @@
DA8848691CBAFCC100AB86E3 /* mapbox.png */,
DA88486A1CBAFCC100AB86E3 /* mapbox@2x.png */,
DA88486B1CBAFCC100AB86E3 /* mapbox@3x.png */,
- DA8848791CBAFD5C00AB86E3 /* star_tilestream_net.der */,
);
- name = Resources;
+ name = "Kit Resources";
path = resources;
sourceTree = SOURCE_ROOT;
};
@@ -713,6 +709,19 @@
path = ..;
sourceTree = "<group>";
};
+ DA8933B91CCD2C6700E68420 /* Foundation Resources */ = {
+ isa = PBXGroup;
+ children = (
+ DA8933BA1CCD2CA100E68420 /* Foundation.strings */,
+ DA8933BD1CCD2CAD00E68420 /* Foundation.stringsdict */,
+ DA8848771CBAFD5C00AB86E3 /* api_mapbox_com-digicert.der */,
+ DA8848781CBAFD5C00AB86E3 /* api_mapbox_com-geotrust.der */,
+ DA8848791CBAFD5C00AB86E3 /* star_tilestream_net.der */,
+ );
+ name = "Foundation Resources";
+ path = ../../darwin/resources;
+ sourceTree = "<group>";
+ };
DA8963321CC5498400684375 /* Fixtures */ = {
isa = PBXGroup;
children = (
@@ -1029,12 +1038,11 @@
buildActionMask = 2147483647;
files = (
DA8848731CBAFCC100AB86E3 /* mapbox.png in Resources */,
+ DA8933BC1CCD2CA100E68420 /* Foundation.strings in Resources */,
DA8848741CBAFCC100AB86E3 /* mapbox@2x.png in Resources */,
DA88487A1CBAFD5C00AB86E3 /* api_mapbox_com-digicert.der in Resources */,
DA8933A31CCC95B000E68420 /* Localizable.strings in Resources */,
- DA8933A41CCC95B000E68420 /* Foundation.strings in Resources */,
DA88486D1CBAFCC100AB86E3 /* Compass.png in Resources */,
- DAF9E8931CCBFA03004C7E73 /* Foundation.stringsdict in Resources */,
DA8848721CBAFCC100AB86E3 /* default_marker@3x.png in Resources */,
DA88487C1CBAFD5C00AB86E3 /* star_tilestream_net.der in Resources */,
DA88486F1CBAFCC100AB86E3 /* Compass@3x.png in Resources */,
@@ -1043,6 +1051,7 @@
DA8848711CBAFCC100AB86E3 /* default_marker@2x.png in Resources */,
DA8848751CBAFCC100AB86E3 /* mapbox@3x.png in Resources */,
DA88487B1CBAFD5C00AB86E3 /* api_mapbox_com-geotrust.der in Resources */,
+ DA8933BF1CCD2CAD00E68420 /* Foundation.stringsdict in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1195,36 +1204,36 @@
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
- DA89339D1CCC951200E68420 /* Foundation.strings */ = {
+ DA89339F1CCC951200E68420 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
- DA89339E1CCC951200E68420 /* Base */,
+ DA8933A01CCC951200E68420 /* Base */,
);
- name = Foundation.strings;
+ name = Localizable.strings;
sourceTree = "<group>";
};
- DA89339F1CCC951200E68420 /* Localizable.strings */ = {
+ DA8933BA1CCD2CA100E68420 /* Foundation.strings */ = {
isa = PBXVariantGroup;
children = (
- DA8933A01CCC951200E68420 /* Base */,
+ DA8933BB1CCD2CA100E68420 /* Base */,
);
- name = Localizable.strings;
+ name = Foundation.strings;
sourceTree = "<group>";
};
- DABCABB81CB80692000A7C39 /* LaunchScreen.storyboard */ = {
+ DA8933BD1CCD2CAD00E68420 /* Foundation.stringsdict */ = {
isa = PBXVariantGroup;
children = (
- DABCABB91CB80692000A7C39 /* Base */,
+ DA8933BE1CCD2CAD00E68420 /* en */,
);
- name = LaunchScreen.storyboard;
+ name = Foundation.stringsdict;
sourceTree = "<group>";
};
- DAF9E8911CCBFA03004C7E73 /* Foundation.stringsdict */ = {
+ DABCABB81CB80692000A7C39 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
- DAF9E8921CCBFA03004C7E73 /* en */,
+ DABCABB91CB80692000A7C39 /* Base */,
);
- name = Foundation.stringsdict;
+ name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
diff --git a/platform/osx/osx.xcodeproj/project.pbxproj b/platform/osx/osx.xcodeproj/project.pbxproj
index d3c2f8c9bb..4a74f352f9 100644
--- a/platform/osx/osx.xcodeproj/project.pbxproj
+++ b/platform/osx/osx.xcodeproj/project.pbxproj
@@ -25,6 +25,10 @@
DA839EA01CC2E3400062CAFB /* MapDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA839E9E1CC2E3400062CAFB /* MapDocument.xib */; };
DA839EA21CC2E3400062CAFB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA839EA11CC2E3400062CAFB /* Assets.xcassets */; };
DA839EA51CC2E3400062CAFB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA839EA31CC2E3400062CAFB /* MainMenu.xib */; };
+ DA8933A51CCD287300E68420 /* MGLAnnotationCallout.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA8933A71CCD287300E68420 /* MGLAnnotationCallout.xib */; };
+ DA8933AE1CCD290700E68420 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933AB1CCD290700E68420 /* Localizable.strings */; };
+ DA8933B51CCD2C2500E68420 /* Foundation.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933B31CCD2C2500E68420 /* Foundation.strings */; };
+ DA8933B81CCD2C2D00E68420 /* Foundation.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DA8933B61CCD2C2D00E68420 /* Foundation.stringsdict */; };
DAC2ABC51CC6D343006D18C4 /* MGLAnnotationImage_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */; };
DAE6C2E21CC304F900DB3429 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = DAE6C2E11CC304F900DB3429 /* Credits.rtf */; };
DAE6C2ED1CC3050F00DB3429 /* DroppedPinAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C2E41CC3050F00DB3429 /* DroppedPinAnnotation.m */; };
@@ -94,7 +98,6 @@
DAE6C3BA1CC31EF300DB3429 /* MGLOpenGLLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3B01CC31EF300DB3429 /* MGLOpenGLLayer.mm */; };
DAE6C3BE1CC31F2E00DB3429 /* default_marker.pdf in Resources */ = {isa = PBXBuildFile; fileRef = DAE6C3BB1CC31F2E00DB3429 /* default_marker.pdf */; };
DAE6C3BF1CC31F2E00DB3429 /* mapbox.pdf in Resources */ = {isa = PBXBuildFile; fileRef = DAE6C3BC1CC31F2E00DB3429 /* mapbox.pdf */; };
- DAE6C3C01CC31F2E00DB3429 /* MGLAnnotationCallout.xib in Resources */ = {isa = PBXBuildFile; fileRef = DAE6C3BD1CC31F2E00DB3429 /* MGLAnnotationCallout.xib */; };
DAE6C3C21CC31F4500DB3429 /* Mapbox.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3C11CC31F4500DB3429 /* Mapbox.h */; settings = {ATTRIBUTES = (Public, ); }; };
DAE6C3C71CC3499100DB3429 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3C61CC3499100DB3429 /* libsqlite3.tbd */; };
DAE6C3D21CC34C9900DB3429 /* MGLGeometryTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3C81CC34BD800DB3429 /* MGLGeometryTests.mm */; };
@@ -165,6 +168,10 @@
DA839EA11CC2E3400062CAFB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
DA839EA41CC2E3400062CAFB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
DA839EA61CC2E3400062CAFB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ DA8933A61CCD287300E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MGLAnnotationCallout.xib; sourceTree = "<group>"; };
+ DA8933AC1CCD290700E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = "<group>"; };
+ DA8933B41CCD2C2500E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Foundation.strings; sourceTree = "<group>"; };
+ DA8933B71CCD2C2D00E68420 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Foundation.stringsdict; sourceTree = "<group>"; };
DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationImage_Private.h; sourceTree = "<group>"; };
DAE6C2E11CC304F900DB3429 /* Credits.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = "<group>"; };
DAE6C2E31CC3050F00DB3429 /* DroppedPinAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DroppedPinAnnotation.h; sourceTree = "<group>"; };
@@ -238,8 +245,7 @@
DAE6C3AF1CC31EF300DB3429 /* MGLOpenGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOpenGLLayer.h; sourceTree = "<group>"; };
DAE6C3B01CC31EF300DB3429 /* MGLOpenGLLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLOpenGLLayer.mm; sourceTree = "<group>"; };
DAE6C3BB1CC31F2E00DB3429 /* default_marker.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = default_marker.pdf; sourceTree = "<group>"; };
- DAE6C3BC1CC31F2E00DB3429 /* mapbox.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = mapbox.pdf; path = sdk/mapbox.pdf; sourceTree = SOURCE_ROOT; };
- DAE6C3BD1CC31F2E00DB3429 /* MGLAnnotationCallout.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MGLAnnotationCallout.xib; path = sdk/MGLAnnotationCallout.xib; sourceTree = SOURCE_ROOT; };
+ DAE6C3BC1CC31F2E00DB3429 /* mapbox.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = mapbox.pdf; sourceTree = "<group>"; };
DAE6C3C11CC31F4500DB3429 /* Mapbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mapbox.h; path = src/Mapbox.h; sourceTree = SOURCE_ROOT; };
DAE6C3C51CC31F9100DB3429 /* mbgl.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = mbgl.xcconfig; path = ../../build/osx/mbgl.xcconfig; sourceTree = "<group>"; };
DAE6C3C61CC3499100DB3429 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
@@ -337,6 +343,27 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ DA8933A81CCD28D100E68420 /* Kit Resources */ = {
+ isa = PBXGroup;
+ children = (
+ DA8933AB1CCD290700E68420 /* Localizable.strings */,
+ DAE6C3BB1CC31F2E00DB3429 /* default_marker.pdf */,
+ DAE6C3BC1CC31F2E00DB3429 /* mapbox.pdf */,
+ DA8933A71CCD287300E68420 /* MGLAnnotationCallout.xib */,
+ );
+ name = "Kit Resources";
+ sourceTree = "<group>";
+ };
+ DA8933B21CCD2C0700E68420 /* Foundation Resources */ = {
+ isa = PBXGroup;
+ children = (
+ DA8933B31CCD2C2500E68420 /* Foundation.strings */,
+ DA8933B61CCD2C2D00E68420 /* Foundation.stringsdict */,
+ );
+ name = "Foundation Resources";
+ path = ../../darwin/resources;
+ sourceTree = "<group>";
+ };
DAE6C31E1CC308BC00DB3429 /* Frameworks */ = {
isa = PBXGroup;
children = (
@@ -353,10 +380,9 @@
children = (
DAE6C3C11CC31F4500DB3429 /* Mapbox.h */,
DAE6C3491CC31DF500DB3429 /* Foundation */,
+ DA8933B21CCD2C0700E68420 /* Foundation Resources */,
DAE6C39E1CC31E7C00DB3429 /* Kit */,
- DAE6C3BB1CC31F2E00DB3429 /* default_marker.pdf */,
- DAE6C3BC1CC31F2E00DB3429 /* mapbox.pdf */,
- DAE6C3BD1CC31F2E00DB3429 /* MGLAnnotationCallout.xib */,
+ DA8933A81CCD28D100E68420 /* Kit Resources */,
DAE6C32C1CC30DB200DB3429 /* Info.plist */,
);
name = SDK;
@@ -635,9 +661,12 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ DA8933AE1CCD290700E68420 /* Localizable.strings in Resources */,
DAE6C3BE1CC31F2E00DB3429 /* default_marker.pdf in Resources */,
DAE6C3BF1CC31F2E00DB3429 /* mapbox.pdf in Resources */,
- DAE6C3C01CC31F2E00DB3429 /* MGLAnnotationCallout.xib in Resources */,
+ DA8933A51CCD287300E68420 /* MGLAnnotationCallout.xib in Resources */,
+ DA8933B51CCD2C2500E68420 /* Foundation.strings in Resources */,
+ DA8933B81CCD2C2D00E68420 /* Foundation.stringsdict in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -750,6 +779,38 @@
name = MainMenu.xib;
sourceTree = "<group>";
};
+ DA8933A71CCD287300E68420 /* MGLAnnotationCallout.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ DA8933A61CCD287300E68420 /* Base */,
+ );
+ name = MGLAnnotationCallout.xib;
+ sourceTree = "<group>";
+ };
+ DA8933AB1CCD290700E68420 /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ DA8933AC1CCD290700E68420 /* Base */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
+ DA8933B31CCD2C2500E68420 /* Foundation.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ DA8933B41CCD2C2500E68420 /* Base */,
+ );
+ name = Foundation.strings;
+ sourceTree = "<group>";
+ };
+ DA8933B61CCD2C2D00E68420 /* Foundation.stringsdict */ = {
+ isa = PBXVariantGroup;
+ children = (
+ DA8933B71CCD2C2D00E68420 /* en */,
+ );
+ name = Foundation.stringsdict;
+ sourceTree = "<group>";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
diff --git a/platform/osx/sdk/Base.lproj/Localizable.strings b/platform/osx/sdk/Base.lproj/Localizable.strings
new file mode 100644
index 0000000000..818c82b2ec
--- /dev/null
+++ b/platform/osx/sdk/Base.lproj/Localizable.strings
@@ -0,0 +1,30 @@
+/* Linked part of copyright notice */
+"COPYRIGHT_MAPBOX" = "Mapbox";
+
+/* Copyright notice link */
+"COPYRIGHT_MAPBOX_LINK" = "https://www.mapbox.com/about/maps/";
+
+/* Linked part of copyright notice */
+"COPYRIGHT_OSM" = "OpenStreetMap";
+
+/* Copyright notice link */
+"COPYRIGHT_OSM_LINK" = "http://www.openstreetmap.org/about/";
+
+/* Copyright notice prefix */
+"COPYRIGHT_PREFIX" = "© ";
+
+/* Accessibility title */
+"MAP_A11Y_TITLE" = "Mapbox";
+
+/* Label of Zoom In button */
+"ZOOM_IN_LABEL" = "+";
+
+/* Tooltip of Zoom In button */
+"ZOOM_IN_TOOLTIP" = "Zoom In";
+
+/* Label of Zoom Out button; U+2212 MINUS SIGN */
+"ZOOM_OUT_LABEL" = "−";
+
+/* Tooltip of Zoom Out button */
+"ZOOM_OUT_TOOLTIP" = "Zoom Out";
+
diff --git a/platform/osx/sdk/MGLAnnotationCallout.xib b/platform/osx/sdk/Base.lproj/MGLAnnotationCallout.xib
index edf84a26a7..c8e29bc29e 100644
--- a/platform/osx/sdk/MGLAnnotationCallout.xib
+++ b/platform/osx/sdk/Base.lproj/MGLAnnotationCallout.xib
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSViewController">
@@ -22,6 +22,14 @@
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
+ <attributedString key="userComments">
+ <fragment content="Placeholder for the annotation’s title">
+ <attributes>
+ <font key="NSFont" metaFont="smallSystem"/>
+ <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
+ </attributes>
+ </fragment>
+ </attributedString>
<connections>
<binding destination="-2" name="value" keyPath="representedObject.title" id="3nD-YS-gzq"/>
</connections>
@@ -33,6 +41,14 @@
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
+ <attributedString key="userComments">
+ <fragment content="Placeholder for the annotation’s subtitle">
+ <attributes>
+ <font key="NSFont" metaFont="smallSystem"/>
+ <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
+ </attributes>
+ </fragment>
+ </attributedString>
<connections>
<binding destination="-2" name="value" keyPath="representedObject.subtitle" id="RQf-48-DyH"/>
</connections>
diff --git a/platform/osx/src/MGLAttributionButton.m b/platform/osx/src/MGLAttributionButton.m
index b14d36cffd..e21b860794 100644
--- a/platform/osx/src/MGLAttributionButton.m
+++ b/platform/osx/src/MGLAttributionButton.m
@@ -1,5 +1,7 @@
#import "MGLAttributionButton.h"
+#import "NSBundle+MGLAdditions.h"
+
@implementation MGLAttributionButton {
NSTrackingRectTag _trackingAreaTag;
}
@@ -10,8 +12,7 @@
self.bezelStyle = NSRegularSquareBezelStyle;
// Start with a copyright symbol. The whole string will be mini.
- NSMutableAttributedString *attributedTitle = [[NSMutableAttributedString alloc] initWithString:@"© "
- attributes:@{
+ NSMutableAttributedString *attributedTitle = [[NSMutableAttributedString alloc] initWithString:NSLocalizedStringWithDefaultValue(@"COPYRIGHT_PREFIX", nil, nil, @"© ", @"Copyright notice prefix") attributes:@{
NSFontAttributeName: [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSMiniControlSize]],
}];
// Append the specified title, underlining it like a hyperlink.
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm
index 280706b798..767bcb81a8 100644
--- a/platform/osx/src/MGLMapView.mm
+++ b/platform/osx/src/MGLMapView.mm
@@ -80,8 +80,14 @@ struct MGLAttribution {
/// URL to open when the attribution button is clicked.
NSString *urlString;
} MGLAttributions[] = {
- { .title = @"Mapbox", .urlString = @"https://www.mapbox.com/about/maps/" },
- { .title = @"OpenStreetMap", .urlString = @"http://www.openstreetmap.org/about/" },
+ {
+ .title = NSLocalizedStringWithDefaultValue(@"COPYRIGHT_MAPBOX", nil, nil, @"Mapbox", @"Linked part of copyright notice"),
+ .urlString = NSLocalizedStringWithDefaultValue(@"COPYRIGHT_MAPBOX_LINK", nil, nil, @"https://www.mapbox.com/about/maps/", @"Copyright notice link"),
+ },
+ {
+ .title = NSLocalizedStringWithDefaultValue(@"COPYRIGHT_OSM", nil, nil, @"OpenStreetMap", @"Linked part of copyright notice"),
+ .urlString = NSLocalizedStringWithDefaultValue(@"COPYRIGHT_OSM_LINK", nil, nil, @"http://www.openstreetmap.org/about/", @"Copyright notice link"),
+ },
};
/// Unique identifier representing a single annotation in mbgl.
@@ -302,12 +308,12 @@ public:
[(NSSegmentedCell *)_zoomControls.cell setTrackingMode:NSSegmentSwitchTrackingMomentary];
_zoomControls.continuous = YES;
_zoomControls.segmentCount = 2;
- [_zoomControls setLabel:@"−" forSegment:0]; // U+2212 MINUS SIGN
+ [_zoomControls setLabel:NSLocalizedStringWithDefaultValue(@"ZOOM_OUT_LABEL", nil, nil, @"−", @"Label of Zoom Out button; U+2212 MINUS SIGN") forSegment:0];
[(NSSegmentedCell *)_zoomControls.cell setTag:0 forSegment:0];
- [(NSSegmentedCell *)_zoomControls.cell setToolTip:@"Zoom Out" forSegment:0];
- [_zoomControls setLabel:@"+" forSegment:1];
+ [(NSSegmentedCell *)_zoomControls.cell setToolTip:NSLocalizedStringWithDefaultValue(@"ZOOM_OUT_TOOLTIP", nil, nil, @"Zoom Out", @"Tooltip of Zoom Out button") forSegment:0];
+ [_zoomControls setLabel:NSLocalizedStringWithDefaultValue(@"ZOOM_IN_LABEL", nil, nil, @"+", @"Label of Zoom In button") forSegment:1];
[(NSSegmentedCell *)_zoomControls.cell setTag:1 forSegment:1];
- [(NSSegmentedCell *)_zoomControls.cell setToolTip:@"Zoom In" forSegment:1];
+ [(NSSegmentedCell *)_zoomControls.cell setToolTip:NSLocalizedStringWithDefaultValue(@"ZOOM_IN_TOOLTIP", nil, nil, @"Zoom In", @"Tooltip of Zoom In button") forSegment:1];
_zoomControls.target = self;
_zoomControls.action = @selector(zoomInOrOut:);
_zoomControls.controlSize = NSRegularControlSize;
@@ -340,7 +346,7 @@ public:
logoImage.alignmentRect = NSInsetRect(logoImage.alignmentRect, 3, 3);
_logoView.image = logoImage;
_logoView.translatesAutoresizingMaskIntoConstraints = NO;
- _logoView.accessibilityTitle = @"Mapbox";
+ _logoView.accessibilityTitle = NSLocalizedStringWithDefaultValue(@"MAP_A11Y_TITLE", nil, nil, @"Mapbox", @"Accessibility title");
[self addSubview:_logoView];
}