This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4772 - add keyword substitution in smlerr localized messages?
Summary: add keyword substitution in smlerr localized messages?
Alias: None
Product: SML
Classification: Unclassified
Component: Interchange Format (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: LC
Assignee: Valentina Popescu
QA Contact: SML Working Group discussion list
Keywords: resolved
Depends on:
Reported: 2007-06-27 12:33 UTC by John Arwe
Modified: 2007-12-17 19:51 UTC (History)
0 users

See Also:


Description John Arwe 2007-06-27 12:33:37 UTC
(from Submission copy of spec, Appendix C issue 4)

smlerr:localizationID provides a mechanism allowing for translation of a fixed string, ala a Java resource bundle, but only does this for strings whose entire value is known when the translation is crafted.  There is no provision for including other values embedded w/in the translated string, which in general can be thought of as keyword substitution.
Comment 1 Virginia Smith 2007-10-17 18:06:22 UTC
Created ACTION-143 - Create proposal [on Valentina Popescu - due 2007-10-24].
Comment 2 Valentina Popescu 2007-11-15 19:17:08 UTC
proposal attached under this note

Comment 3 Kumar Pandit 2007-11-28 05:09:25 UTC
I agree with the proposal mentioned in comment #2. The proposal is summarized below for quick reference.

1. Change the namespace name to a more general name (for example, sml:localizationId) to position it as a localization mechanism for items other than error messages. 
2. Change the type of this attribute from anyURI to qname.
The namespace part of the qname, a URI, will be used to point to a localized resource. The local part of the qname will identify a specific string within the resource. 
3. How an implementation locates a localized resource using the URI is implementation dependent.
4. It is implementation dependant how variable substitution can be achieved in translated strings. SML will propose as best practices ( non-normative ) the use of xsl:variable for variable substitution support in schematron messages
Comment 4 Pratul Dublish 2007-11-29 20:40:55 UTC
Fix as per #2 and #3
Comment 5 Valentina Popescu 2007-12-10 19:19:51 UTC
Changes under the SML spec :

1. Replaced section 5.1 Localization of Error Messages
with a new sesction , 6. Localization of natural-language texts :;%20charset=utf-8#Localization_of_Messages

2. Added a new section under 8. SML Extension Reference, sml:locid;%20charset=utf-8#locid

3. Created a new Sample under Appendices, D. Localization and Variable Substitution Sample (Non-Normative) :;%20charset=utf-8#LocalizationSample

Under SML IF spec :

1. Added a new sample under Appendices, Localization of IF Identity Sample (Non-Normative) :


Under the sml.xsd file

Defined a new attribute, sml:locid:

  <!-- CONTEXT: To be used in <sch:assert>, <sch:report>
  and elements with textual content.
  This attribute is used to support string localization.
  It is used to define the translation location for 
  the text content of the containing element.-->  
  <xs:attribute name="locid" type="xs:QName"/>

Completely removed sml-err-schema.xsd 

This schema contained the smlerr attribute used for localization and the schematron sml output types, removed from the spec during the LC.
Comment 6 Valentina Popescu 2007-12-10 22:07:48 UTC
The right link for the IF 'Localization of IF Identity Sample
section' ( instead of the file url attached in comment #5 ):;%20charset=utf-8#LocalizationSample
Comment 7 Kumar Pandit 2007-12-12 08:51:32 UTC
I agree with the changes in comment# 5 and comment# 6.
Comment 8 Sandy Gao 2007-12-13 17:46:42 UTC
+1 to changes made for this bug.
Comment 9 C. M. Sperberg-McQueen 2007-12-13 19:03:05 UTC
The changes made to support keyword substitution and sml:locid seem mostly OK 
to me.  (Or rather, the current text in  the sections mentioned seems mostly 
OK -- I have not actually reviewed the previous text.)  But there are some 
shortcomings which I hope will receive editorial attention:

From sections 6 and 8.1.7 of SML this reader does not get any clear idea of
how sml:locid is to be used.  (To the extent that I'm a typical vocabulary
designer, this is alarming.  To the extent that I'm a vocabulary designer with
higher than usual tolerance for spec prose and indirection, it's more alarming.)
A one- or two-line example would help in either 6 or 8.1.7, as would a pointer
to the longer example in appendix F.

There is nothing formally wrong about using a Qname like 
"lang:StudendIDNotStartWith99" in the example.  But it does seem
odd not to spell it "...StudentID..." (with a 't' not a 'd' at the
end of 'Student').  This looks like a typo.

The examples in appendix F have some stray > symbols (two that I saw).

The example in the appendix would, I think, be clearer if it went into
slightly more painful detail, and said explicitly that 
"" is the URI of a
translation resource and "StudendIDNotStartWith99" is an id used to
locate the desired set of translations within that resource.  It
would be clearer still if it showed what such a translation resource
might in theory look like.  And the text should be clearer than it now
is on whether "StudendIDNotStartWith99" is an ID in the strict sense
(declared with a DTD), in the XSDL sense (value of type xsd:ID), or
generic sense (it's a magic cookie which an application will use to find

The motivation and usage of the variable named $var (not to mention the
scope of the variable) are not clear to me from the discussion.  I hope
this can be made clearer.
Comment 10 Virginia Smith 2007-12-13 19:15:03 UTC
Editors to consider comment #9; not necessary to mark "needsReview" for any changes based on comment #9.
Comment 11 Valentina Popescu 2007-12-17 19:48:51 UTC
Addressed comment #9:

- Fixed spaces/typo identified in comment #9

- Updated sample 'F. Localization and Variable Substitution Sample' with more (and intended better :) description 

- Added links from the normative section to the 'F. Localization and Variable Substitution Sample ' sample