Created
February 22, 2012 00:09
-
-
Save timhaines/1880073 to your computer and use it in GitHub Desktop.
Name Display in Page Title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def name_for_page_title user | |
result = "@" + user.screen_name | |
if I18n.locale == :en | |
result += user.screen_name.last == "s" ? "’" : "’s" | |
result += " (#{user.name.strip})" unless user.screen_name == user.name | |
end | |
return result | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment