parse_accept_lang($r->headers_in->get('Accept-Language'));
# set the editor default locale for each page load
- $OpenILS::Utils::CStoreEditor::default_locale = parse_eg_locale($ctx->{locale});
+ $ctx->{canonical_locale} = $OpenILS::Utils::CStoreEditor::default_locale = parse_eg_locale($ctx->{locale});
my $mprefix = $ctx->{media_prefix};
if($mprefix and $mprefix !~ /^http/ and $mprefix !~ /^\//) {
'//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]');
IF node AND node.textContent;
type = node.textContent;
- args.format_label = node.getAttribute('coded-value')
+ args.format_label = node.getAttribute('coded-value');
+
+ find_text_id = ctx.search_ccvm('ctype', icon_style, 'value', node.getAttribute('coded-value'));
+
+ IF find_text_id.0.id && ctx.canonical_locale != 'en-US';
+ format_label_i18n = ctx.search_i18n('fq_field', 'ccvm.value', 'identity_value', find_text_id.0.id);
+ FOR xi18n IN format_label_i18n;
+ IF xi18n.translation == ctx.canonical_locale;
+ args.format_label = xi18n.string;
+ LAST;
+ END;
+ END;
+ END;
+
args.schema.itemtype = schema_typemap.$type;
args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ type _ '.png';
LAST;