Bug 622030

Summary: RFE -- allow create_site to set a default language
Product: [Community] Publican Reporter: Ruediger Landmann <rlandman>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 1.6CC: jfearn, mmcallis, publican-list, rlandman
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: publican-2.2-0.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-08 20:42:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ruediger Landmann 2010-08-06 19:56:22 UTC
Description of problem:

The JavaScript in the top index.html of a Publican website attempts to match the locale of a visitor's browser and redirect the visitor to a welcome page in their own language. If the locale can't be matched, it defaults to en-US:

	// Else default to en-US
	if(match == 0) {
		lang = 'en-US';
	}

However, for somebody building a site in a language other than English, it would be useful to be able to define this default when the site is created.

Version-Release number of selected component (if applicable):
2.1

Additional info:

For now, you can work around this by manually editing the index.html file to set a different default language. However, you need to re-do this if you ever run update_site, because this file gets overwritten.

Comment 1 Ruediger Landmann 2010-08-06 20:10:46 UTC
en-US also seems to be assumed earlier too: 

	var match = 0;
	var locales = ["en-US"];

Comment 2 Jeff Fearn 🐞 2010-08-09 04:09:27 UTC
There was already some support for def_lang with regard to TOC creation.

Made index.tmpl use default language, this did require updating the pot and po files.

Added --lang to create_site parameters, this will set def_lang in the site configuration file. Not 100% sure this is a good approach, maybe create a new parameter, --def_lang, specifically for this action?

Fixed in build: 2.1-0.%{dist}.t32

Comment 3 Jeff Fearn 🐞 2010-08-09 04:15:44 UTC
Added --lang parameter to create_site action to allow def_lang to be set at site creation.

Modified index.tmpl to use default language.

Changed debug message from print to debug_msg so it's only displayed in debug mode.

Changed debug message to be more readable and translatable:

"No languages found, using default language: [_1]\n", $self->{def_lang}

Moved static string in HTML to maketext calls to allow for translation of index page in to the default language.

Fixed in build: 2.1-0.%{dist}.t32

Comment 4 Fedora Update System 2010-10-06 05:48:58 UTC
publican-2.2-0.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/publican-2.2-0.fc13

Comment 5 Fedora Update System 2010-10-06 05:50:16 UTC
publican-2.2-0.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/publican-2.2-0.fc12

Comment 6 Fedora Update System 2010-10-06 05:50:20 UTC
publican-2.2-0.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/publican-2.2-0.fc14

Comment 7 Fedora Update System 2010-10-08 20:40:25 UTC
publican-2.2-0.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.