From 658a34714f089c8cd9d8556e4dcea0cb708fa0ed Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 17 Sep 2009 23:36:54 +0000 Subject: [PATCH 1/1] When displaying objects in /browse/* and in the JavaScript "Data" feature use the name key corresponding to the user's locale. E.g. "name:is" for Icelandic. This will fall back on "name". The interface will be equivalent unless the user has selected another language than English in the preferences and objects with localized name:* tags corresponding to the user's language are being displayed. --- app/helpers/browse_helper.rb | 4 +++- app/views/browse/start.rjs | 20 +++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/helpers/browse_helper.rb b/app/helpers/browse_helper.rb index 879d516ef..aed0c518f 100644 --- a/app/helpers/browse_helper.rb +++ b/app/helpers/browse_helper.rb @@ -8,7 +8,9 @@ module BrowseHelper if version name = t 'printable_name.with_version', :id => name, :version => object.version.to_s end - if object.tags.include? 'name' + if object.tags.include? "name:#{I18n.locale}" + name = t 'printable_name.with_name', :name => object.tags["name:#{I18n.locale}"].to_s, :id => name + elsif object.tags.include? 'name' name = t 'printable_name.with_name', :name => object.tags['name'].to_s, :id => name end return name diff --git a/app/views/browse/start.rjs b/app/views/browse/start.rjs index 707054526..220295663 100644 --- a/app/views/browse/start.rjs +++ b/app/views/browse/start.rjs @@ -262,7 +262,7 @@ page << <