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

[ios, macos] Enable localizations in iosapp & macosapp #8105

Merged
merged 1 commit into from
Feb 21, 2017

Conversation

friedbunny
Copy link
Contributor

Adds blank Localizable.strings to iosapp and macapp, so that our SDK localizations will be used in those apps.

screen shot 2017-02-17 at 7 31 44 copy

@friedbunny friedbunny added iOS Mapbox Maps SDK for iOS localization Human language support and internationalization macOS Mapbox Maps SDK for macOS labels Feb 18, 2017
@friedbunny friedbunny self-assigned this Feb 18, 2017
@friedbunny friedbunny requested a review from 1ec5 February 18, 2017 00:35
@mention-bot
Copy link

@friedbunny, thanks for your PR! By analyzing this pull request, we identified @1ec5 and @tmcw to be potential reviewers.

@friedbunny friedbunny force-pushed the fb-iosapp-localizable branch from bf81441 to 55b0960 Compare February 18, 2017 00:41
Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

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

I'm about 80% sure about base localization being the way to go here. The extra stub files for each language aren't terrible, but they're just one more step that can be missed when adding a new locale.

@@ -0,0 +1,8 @@

/*
File.strings
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this file to Base.lproj. A base localization will be reused by all localizations without the need to a separate stub file for each localization.

@@ -119,6 +119,7 @@ Once you’ve finished translating the SDK into a new language in Transifex, per
1. In ios.xcworkspace, open the project editor for ios.xcodeproj. Using the project editor’s sidebar or tab bar dropdown, go to the “ios” project; under the Localizations section of the Info tab, click the + button to add your language to the project.
1. In the sheet that appears, select all the .strings and .stringsdict files but not the .storyboard file. (LaunchScreen.storyboard is part of the iosapp example application, which is not localized.) If your language lacks declension and pluralization, as in the case of Chinese, omit the .stringsdict files.
1. In the Project navigator, expand each .stringsdict file in the project. An additional version for your localization should be listed; translate it. See Apple’s documentation on the [.stringsdict format](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/StringsdictFileFormat/StringsdictFileFormat.html).
1. In the Project navigator, select Demo App/Localizable.strings and then, in the File Inspector, check the box for your new localization.
Copy link
Contributor

Choose a reason for hiding this comment

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

As long as you use a base localization, the Localizable.strings for iosapp will be localized as part of the step before last.

@friedbunny
Copy link
Contributor Author

friedbunny commented Feb 18, 2017

Base localization via storyboards (or just by not checking any of the other Localizable.strings boxes) does seem like a better way to do this, but I couldn’t make language-switching update the app’s strings reliably in the simulator:

simulator screen shot feb 17 2017 8 07 20 pm

@1ec5
Copy link
Contributor

1ec5 commented Feb 19, 2017

More languages are being added in #8113.

@friedbunny friedbunny added this to the ios-v3.5.0 milestone Feb 20, 2017
@friedbunny friedbunny force-pushed the fb-iosapp-localizable branch from cd0c814 to b937b4a Compare February 20, 2017 16:35
@friedbunny
Copy link
Contributor Author

friedbunny commented Feb 20, 2017

Rebased on master and fixed a conflict in the macOS project. Not sure if rebasing will fix the consistently failing Node macOS test, though...

@friedbunny friedbunny force-pushed the fb-iosapp-localizable branch from b937b4a to 5a63f98 Compare February 20, 2017 20:22
@friedbunny
Copy link
Contributor Author

After another rebase, tests are finally passing. Needs a 👍 before it can be merged.

Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

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

#8113 also added Lithuanian, Polish, Russian, Spanish, and Ukrainian. Note that the list of localizations for iOS and macOS don’t quite line up, because some translators prioritized one platform over another.

@friedbunny friedbunny force-pushed the fb-iosapp-localizable branch from 5a63f98 to e30de34 Compare February 21, 2017 00:25
@friedbunny
Copy link
Contributor Author

Added the new localizations from #8113, rebased and squashed.

@friedbunny friedbunny force-pushed the fb-iosapp-localizable branch from e30de34 to 4f91e70 Compare February 21, 2017 04:07
@friedbunny friedbunny merged commit 4f91e70 into master Feb 21, 2017
@friedbunny friedbunny deleted the fb-iosapp-localizable branch February 21, 2017 04:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS localization Human language support and internationalization macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants