Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vtourraine committed Apr 30, 2016
1 parent 0e333d0 commit 7310837
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Source/AcknowLocalization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,29 @@ public class AcknowLocalization {
The localized version of “Acknowledgements”.
You can use this value for the button presenting the `AcknowListViewController`, for instance.

- return: The localized title.
- returns: The localized title.
*/
public class func localizedTitle() -> String {
return self.localizedString(forKey: "VTAckAcknowledgements", defaultString: "Acknowledgements")
}

/**
Returns the user’s preferred language.

- returns: The preferred language ID.
*/
class func preferredLanguageCode() -> String? {
return NSLocale.preferredLanguages().first
}

/**
Returns a localized string.

- parameter key: The key for the string to localize.
- parameter defaultString: The default non-localized string.

- returns: The localized string.
*/
class func localizedString(forKey key: String, defaultString: String) -> String {
var bundlePath = NSBundle(forClass: AcknowListViewController.self).pathForResource("AcknowList", ofType: "bundle")
let languageBundle: NSBundle
Expand Down Expand Up @@ -83,10 +96,20 @@ public class AcknowLocalization {
return NSBundle.mainBundle().localizedStringForKey(key, value:localizedDefaultString, table:nil)
}

/**
Returns the URL for the CocoaPods main website.

- returns: The CocoaPods website URL.
*/
class func CocoaPodsURLString() -> String {
return "https://cocoapods.org"
}

/**
Returns the default localized footer text.

- returns: The localized footer text.
*/
class func localizedCocoaPodsFooterText() -> String {
return
self.localizedString(forKey: "VTAckGeneratedByCocoaPods", defaultString: "Generated by CocoaPods")
Expand Down

0 comments on commit 7310837

Please sign in to comment.