Bug 622030 - RFE -- allow create_site to set a default language
Summary: RFE -- allow create_site to set a default language
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 1.6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeff Fearn 🐞
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2010-08-06 19:56 UTC by Ruediger Landmann
Modified: 2010-11-24 04:16 UTC (History)
4 users (show)

Clone Of:
Last Closed: 2010-10-08 20:42:36 UTC

Attachments (Terms of Use)

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):

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.

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.

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.

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.

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