<commit_before>
class WMFWelcomePanelViewController: UIViewController {
    fileprivate var theme = Theme.standard
    
    @IBOutlet fileprivate var containerView:UIView!
    @IBOutlet fileprivate var nextButton:UIButton!
    @IBOutlet fileprivate var titleLabel:UILabel!
    @IBOutlet fileprivate var subtitleLabel:UILabel!

    fileprivate var viewControllerForContainerView:UIViewController? = nil
    var welcomePageType:WMFWelcomePageType = .intro

    override func viewDidLoad() {
        super.viewDidLoad()
        embedContainerControllerView()
        updateUIStrings()
        nextButton.setTitleColor(theme.colors.link, for: UIControlState())
        containerView.layer.borderWidth = 1.0 / UIScreen.main.scale
        self.view.wmf_configureSubviewsForDynamicType()
    }
    
    fileprivate func embedContainerControllerView() {
        if let containerController = containerController {
            containerController.willMove(toParentViewController: self)
            containerController.view.translatesAutoresizingMaskIntoConstraints = false
            containerView.addSubview((containerController.view)!)
            self.containerView.wmf_addConstraintsToEdgesOfView(containerController.view)
            self.addChildViewController(containerController)
            containerController.didMove(toParentViewController: self)
        }
    }
    
    fileprivate lazy var containerController: UIViewController? = {
        switch self.welcomePageType {
        case .intro:
            assertionFailure("Intro welcome view is not embedded in a panel.")
            return nil
        case .languages:
            return WMFWelcomeLanguageTableViewController.wmf_viewControllerFromWelcomeStoryboard()
        case .analytics:
            return WMFWelcomeAnalyticsViewController.wmf_viewControllerFromWelcomeStoryboard()
        }
    }()

    fileprivate func updateUIStrings(){
        switch self.welcomePageType {
        case .intro:
            assertionFailure("Intro welcome view is not embedded in a panel.")
        case .languages:
            titleLabel.text = WMFLocalizedString("welcome-languages-title", value:"Languages", comment:"Title for welcome screen allowing user to select additional languages\n{{Identical|Language}}").uppercased(with: Locale.current)
            subtitleLabel.text = WMFLocalizedString("welcome-languages-sub-title", value:"Choose your preferred languages to search Wikipedia", comment:"Sub-title for languages welcome screen")
            nextButton.setTitle(WMFLocalizedString("welcome-languages-continue-button", value:"Continue", comment:"Text for button for moving to next welcome screen\n{{Identical|Continue}}").uppercased(with: Locale.current), for: UIControlState())
        case .analytics:
            titleLabel.text = WMFLocalizedString("welcome-send-data-title", value:"Send Anonymous data", comment:"Title for welcome screen allowing user to opt in to send usage reports").uppercased(with: Locale.current)
            subtitleLabel.text = WMFLocalizedString("welcome-send-data-sub-title", value:"Help the Wikimedia Foundation make the app better by letting us know how you use the app. Data collected is anonymous", comment:"Sub-title explaining how sending usage reports can help improve the app")
            nextButton.setTitle(WMFLocalizedString("button-done", value:"Done", comment:"Button text for done button used in various places.\n{{Identical|Done}}").uppercased(with: Locale.current), for: UIControlState())
        }
    }
}<commit_msg>Wire up Welcome panel vc to updated Welcome storyboard.<commit_after>
class WMFWelcomePanelViewController: UIViewController {
    fileprivate var theme = Theme.standard
    
    @IBOutlet fileprivate var containerView:UIView!
    @IBOutlet fileprivate var titleLabel:UILabel!
    
    fileprivate var viewControllerForContainerView:UIViewController? = nil
    var welcomePageType:WMFWelcomePageType = .intro

    override func viewDidLoad() {
        super.viewDidLoad()
        embedContainerControllerView()
        updateUIStrings()
        view.wmf_configureSubviewsForDynamicType()
    }
    
    fileprivate func embedContainerControllerView() {
        if let containerController = containerController {
            containerController.willMove(toParentViewController: self)
            containerController.view.translatesAutoresizingMaskIntoConstraints = false
            containerView.addSubview((containerController.view)!)
            containerView.wmf_addConstraintsToEdgesOfView(containerController.view)
            addChildViewController(containerController)
            containerController.didMove(toParentViewController: self)
        }
    }
    
    fileprivate lazy var containerController: UIViewController? = {
        switch welcomePageType {
        case .intro:
            return WMFWelcomeIntroductionViewController.wmf_viewControllerFromWelcomeStoryboard()
        case .exploration:
            return WMFWelcomeExplorationViewController.wmf_viewControllerFromWelcomeStoryboard()
        case .languages:
            return WMFWelcomeLanguageTableViewController.wmf_viewControllerFromWelcomeStoryboard()
        case .analytics:
            return WMFWelcomeAnalyticsViewController.wmf_viewControllerFromWelcomeStoryboard()
        }
    }()

    fileprivate func updateUIStrings(){
        switch welcomePageType {
        case .intro:
            titleLabel.text = WMFLocalizedString("welcome-intro-free-encyclopedia-title", value:"The free encyclopedia", comment:"Title for introductory welcome screen")
        case .exploration:
            titleLabel.text = WMFLocalizedString("welcome-explore-new-ways-title", value:"New ways to explore", comment:"Title for welcome screens including explanation of new notification features")
        case .languages:
            //TODO: 300 may not be how many app can show. Need shorter string too? Wraps to 3 lines on iphone 5...
            titleLabel.text = WMFLocalizedString("welcome-languages-search-title", value:"Search in nearly 300 languages", comment:"Title for welcome screen describing Wikipedia languages")
        case .analytics:
            titleLabel.text = WMFLocalizedString("welcome-send-data-helps-title", value:"Help make the app better", comment:"Title for welcome screen allowing user to opt in to send usage reports")
        }
    }
    
    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
        super.traitCollectionDidChange(previousTraitCollection)
        titleLabel.font = UIFont.wmf_preferredFontForFontFamily(.systemMedium, withTextStyle: .headline, compatibleWithTraitCollection: traitCollection)
    }
}
{'fraction_non_alphanumeric': 0.07409070498428379, 'fraction_numerical': 0.00149678191887442, 'mean_word_length': 3.656445993031359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2361867', 'n_tokens_mistral': 1687, 'n_tokens_neox': 1615, 'n_words': 400}