Bug 622030 - RFE -- allow create_site to set a default language
RFE -- allow create_site to set a default language
Status: CLOSED ERRATA
Product: Publican
Classification: Community
Component: publican (Show other bugs)
1.6
All Linux
low Severity medium
: ---
: ---
Assigned To: Jeff Fearn
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-06 15:56 EDT by Ruediger Landmann
Modified: 2010-11-23 23:16 EST (History)
4 users (show)

See Also:
Fixed In Version: publican-2.2-0.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-08 16:42:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ruediger Landmann 2010-08-06 15:56:22 EDT
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 16:10:46 EDT
en-US also seems to be assumed earlier too: 

	var match = 0;
	var locales = ["en-US"];
Comment 2 Jeff Fearn 2010-08-09 00:09:27 EDT
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 00:15:44 EDT
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 01:48:58 EDT
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 01:50:16 EDT
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 01:50:20 EDT
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 16:40:25 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.