Bug 1067783

Summary: RFE: Add support for other languages in Content Specs
Product: [Community] PressGang CCMS Reporter: Matthew Casperson <mcaspers>
Component: CCMS-CoreAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.3CC: cbredesen, lnewson
Target Milestone: ---   
Target Release: 1.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-01 21:39:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1067789, 1072685    

Comment 1 Lee Newson 2014-02-21 04:36:05 UTC
Going to move this to an RFE, as Content Specs weren't original meant to be used outside of English content.

Comment 2 Lee Newson 2014-02-27 02:03:05 UTC
This actually brings up a few problems when the base locale isn't English. These are the things I've noticed so far:

1. We'll need to determine a way to create the "id"/fixed url attribute, since it can only contain the following sequence [A-Za-z0-9][A-Za-z0-9_:.-]*. Since it will be extremely rare that other locales will work for that we may just have to use the Topic ID (as we do when fixed url processing fails).

2. Title and Product must contain certain characters (or have equivalent publican.cfg properties) otherwise "publican package" will fail due to the naming restrictions on rpms. The valid chars for product/title are: 0-9a-zA-Z_-.+

Comment 3 Lee Newson 2014-02-27 03:06:37 UTC
3. File names must use a similar syntax as above, otherwise you will get this error:

FATAL ERROR: XInclude:1605 in Title.xml on line 9: failed build URL

Comment 4 Lee Newson 2014-02-28 01:48:31 UTC
Upon reading the XML spec and doing some testing, I've found a way to deal with points 1 and 3.

Point 1 can be dealt with by escaping the id based on the information in http://www.w3.org/TR/REC-xml/#id. However I'll still need to test the html produced to ensure that it works on older browsers, as the HTML 4 spec says that ids should only contain the characters I mentioned, see http://www.w3.org/TR/xhtml1/#C_8 (I should note this is actually the xhtml 1.0 spec, but xhtml is what is produced by the docbook xsl stylesheets).

Point 3 just requires the href to be URL encoded in the XInclude. This means that the file name can remain something readable.

Comment 8 Lee Newson 2014-03-17 04:57:20 UTC
Fixed in 1.5-SNAPSHOT build 201403171432

Content specs now have a "Locale" metadata attribute. This attribute will be synced with the properties locale value when saving content specs. In the case of text based content specs (ie the /rest/1/contentspec/update/text endpoint) then the value will be pulled from the content spec text.

Comment 11 Matthew Casperson 2014-03-23 22:49:17 UTC
Confirmed that specs with topics that don't match the spec locale result in an error.
Confirmed that the Locale metadata element is copied from the locale property.

Comment 15 Matthew Casperson 2014-04-22 21:06:43 UTC
Built a newly imported Japanese book, and fixed urls were generated ok.