Created
February 10, 2010 18:13
-
-
Save shageman/300638 to your computer and use it in GitHub Desktop.
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 self.translate_route(route, route_name = nil) | |
new_routes = [] | |
new_named_routes = {} | |
# if root_route?(route) && prefix_on_default_locale | |
# add the root route "as is" in addition to the translated versions | |
new_routes << route | |
new_named_routes[route_name] = route | |
# end | |
available_locales.each do |locale| | |
translated = translate_route_by_locale(route, locale, route_name) | |
new_routes << translated | |
locale_suffix = locale_suffix(locale) | |
new_named_routes["#{route_name}_#{locale_suffix}".to_sym] = translated if route_name | |
end | |
[new_routes, new_named_routes] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment