Created
November 6, 2014 00:48
-
-
Save rochers/5d0b41cde0bb68ee47c3 to your computer and use it in GitHub Desktop.
Proposed new translation / methods for Carmen's country.rb
This file contains hidden or 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
class Country | |
.... | |
def prepended_article | |
Carmen.i18n_backend.translate(path('prepended_article')) | |
end | |
def articlelized_common_name | |
prepended_article.blank? common_name : "#{article} #{common_name}" | |
end | |
end |
This seems like a translation (and possibly even localization) issue; articles don't necessarily work that way (and perhaps not even exist?) in other languages. i.e., this is probably not a concern Carmen should know about. You could consider wrapping Carmen with a small veneer which added this functionality. Or perhaps building a wrapper for the default backend which allowed you to add it?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another way to write that ternary statement, but without any branching: