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

Clean up base localization files #10731

Merged
merged 1 commit into from
Dec 18, 2017
Merged

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Dec 18, 2017

Localizable strings in Darwin classes need to specify Foundation as the table so that NSBundle consults the right .strings files. I reran make genstrings to automatically add some missing strings to the base localizations and fix some errors in the .strings files.

In particular, #10456 blew away the macOS SDK’s entire base localization and a few strings in the iOS SDK as well. We didn’t catch the problem because the same commit converted the iOS and macOS .strings files from UTF-8 to UTF-16, which Git refuses to diff.

/cc @fabian-guerra @friedbunny

Localizable strings in Darwin classes need to specify “Foundation” as the table so that NSBundle consults the right .strings files. Reran make genstrings to add some missing strings to the base localizations and undo some manual edits to the base localizations that contained errors.
@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS localization Human language support and internationalization macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release labels Dec 18, 2017
@1ec5 1ec5 added this to the macos-v0.6.0 milestone Dec 18, 2017
@1ec5 1ec5 self-assigned this Dec 18, 2017
@frederoni
Copy link
Contributor

Should we try to automate the extraction from source and conversion to UTF-8 similar to what we do in the Nav SDK so we can review the changes?

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 18, 2017

make genstrings already automates the process of generating base localization files. But separately, I agree it would be great to have a script like the navigation SDK’s for updating the translations correctly.

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 18, 2017

Since the previous, UTF-16-encoded versions of some of these files prevent their diffs from showing, I’ve included them below:

platform/ios/resources/Base.lproj/Localizable.strings
--- platform/ios/resources/Base.lproj/Localizable.strings	2017-12-18 10:43:59.000000000 -0800
+++ platform/ios/resources/Base.lproj/Localizable.strings	2017-12-18 10:43:57.000000000 -0800
@@ -64,6 +64,9 @@
 /* User-friendly error description */
 "PARSE_STYLE_FAILED_DESC" = "The map failed to load because the style is corrupted.";
 
+/* String format for accessibility value for road feature; {starting compass direction}, {ending compass direction} */
+"ROAD_DIRECTION_A11Y_FMT" = "%1$@ to %2$@";
+
 /* Accessibility value indicating that a road is a divided road (dual carriageway) */
 "ROAD_DIVIDED_A11Y_VALUE" = "Divided road";
 
@@ -83,7 +86,7 @@
 "STYLE_NOT_FOUND_DESC" = "The map failed to load because the style can’t be found or is incompatible.";
 
 /* Telemetry prompt message */
-/* OpenStreetMap full name attribution */
+"TELEMETRY_DISABLED_MSG" = "You can help make OpenStreetMap and Mapbox maps better by contributing anonymous usage data.";
 
 /* Telemetry prompt button */
 "TELEMETRY_DISABLED_OFF" = "Don’t Participate";
@@ -107,8 +110,8 @@
 "TELEMETRY_NAME" = "Mapbox Telemetry";
 
 /* Telemetry prompt title */
-"OSM_FULL_NAME" = "OpenStreetMap";
+"TELEMETRY_TITLE" = "Make Mapbox Maps Better";
 
-/* OpenStreetMap short name attribution */
-"OSM_SHORT_NAME" = "OSM";
+/* Default user location annotation title */
+"USER_DOT_TITLE" = "You Are Here";
 
platform/macos/sdk/Base.lproj/Localizable.strings
--- platform/macos/sdk/Base.lproj/Localizable.strings	2017-12-18 10:46:08.000000000 -0800
+++ platform/macos/sdk/Base.lproj/Localizable.strings	2017-12-18 10:46:10.000000000 -0800
@@ -1,6 +1,27 @@
-/* OpenStreetMap full name attribution */
-"OSM_FULL_NAME" = "OpenStreetMap";
+/* User-friendly error description */
+"LOAD_MAP_FAILED_DESC" = "The map failed to load because an unknown error occurred.";
 
-/* OpenStreetMap short name attribution */
-"OSM_SHORT_NAME" = "OSM";
+/* User-friendly error description */
+"LOAD_STYLE_FAILED_DESC" = "The map failed to load because the style can't be loaded.";
+
+/* Accessibility title */
+"MAP_A11Y_TITLE" = "Mapbox";
+
+/* User-friendly error description */
+"PARSE_STYLE_FAILED_DESC" = "The map failed to load because the style is corrupted.";
+
+/* User-friendly error description */
+"STYLE_NOT_FOUND_DESC" = "The map failed to load because the style can’t be found or is incompatible.";
+
+/* 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";
 

@fabian-guerra
Copy link
Contributor

When I was working on #10456 running make genstrings did not worked. I had to run manually genstrings -u -o platform/macos/sdk/Base.lproj platform/darwin/src/*.{m,mm} to get the new strings. I apologize for not noticing that the other strings were erased.

Copy link
Contributor

@fabian-guerra fabian-guerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this.

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 18, 2017

👍 It should be fine to run genstrings by itself, as long as the files are also converted back to UTF-8 afterwards. make genstrings just makes that easier to remember. I think the macOS .strings file got blown away because of the missing Foundation in MGLAttributionInfo.mm: when the table name is missing, -[NSBundle localizedStringForKey:value:table:] assumes a table of Localizable.

@1ec5 1ec5 merged commit 9c1dfe4 into release-agua Dec 18, 2017
@1ec5 1ec5 deleted the 1ec5-attribution-l10n-table branch December 18, 2017 19:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS localization Human language support and internationalization macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants