Please look at the question I asked about PN 0.764 here:
http://community.zikula.org/module-Forum-viewtopic-topic-56701.htm
I have the same same question about Zikula
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Page language in Zikula
-
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
-
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
Evidently, the
Code
<html lang="<!--[lang]-->">
variable is set somewhere in the PHP code that reads it from the database, where it is set by the setting chosen in the admin interface...
can someone please at least tell me where that PHP code resides, in which file? -
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
ok, I located part of the issue in function.lang.php
Code
<?php
/**
* Zikula Application Framework
*
* @copyright (c) 2004, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: function.lang.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Template_Plugins
* @subpackage Functions
*/
/**
* Smarty function to get the site's language
*
* available parameters:
* - assign if set, the language will be assigned to this variable
*
* Example
* <html lang="<!--[lang]-->">
*
* @author Jörg Napp
* @since 03. Feb. 04
* @param array $params All attributes passed to this function from the template
* @param object $smarty Reference to the Smarty object
* @return string the language
*/
function smarty_function_lang($params, &$smarty)
{
if (!defined('_LOCALE')) {
define('_LOCALE','en_US');
}
$p = strpos(_LOCALE, '.');
$p ? $locale = substr(_LOCALE, 0, $p) : $locale = _LOCALE;
return DataUtil::formatForDisplay($locale);
}
now I've to find out where the _LOCALE comes from. -
- Rank: Team Member
- Registered: Jan 05, 2003
- Posts: 776
-
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
cool, thanks, that means that the behavior was changed in Zikula.
as a matter of fact, the site language setting has disappeared from admin interface, so I suppose that the language now is dynamically and correctly set according to the user's language.
I now just have to solve the issue on my PN site. -
- Rank: Team Member
- Registered: Jan 05, 2003
- Posts: 776
Quote
as a matter of fact, the site language setting has disappeared from admin interface
Not quite. You have to enable multilingual features in order to be able to select a different base language. Check under Admin->Settings->Internationalization ...
Greetings
R -
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
rgasch
Quote
as a matter of fact, the site language setting has disappeared from admin interface
Not quite. You have to enable multilingual features in order to be able to select a different base language. Check under Admin->Settings->Internationalization ...
Greetings
R
Thanks, but is the language declaration tag automatically adjusted to fit the language the site is displayed in, or is it still frozen to show the site's default language? -
- Rank: Softmore
- Registered: Mar 10, 2005
- Last visit: Mar 18, 2010
- Posts: 288
manarak
Quote
language declaration tag automatically adjusted to fit the language the site is displayed in, or is it still frozen to show the site's default language?
what language do you need?
there are languages that already defined in zikula.
if you need a site's active language during session there is variable $userlang this has ative language for user/viewer of site..
uups sorry for that.... I just use this variable name..
here it is how it works...
in template
Code
<!--[pnusergetlang assign="userLang" ]-->
<!--[if $userLang eq "deu"]-->
<!--[pnpageaddvar name="javascript" value="javascript/jscalendar/lang/calendar-de.js" ]-->
<!--[else]-->
<!--[pnpageaddvar name="javascript" value="javascript/jscalendar/lang/calendar-en.js" ]-->
<!--[/if]-->
edited by: shoshia, Jun 16, 2009 - 08:39 AM -
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
well, I'm talking about this line in the templates:
Code
<html lang="<!--[lang]-->">
On my current site this seems to be static, regardless of what newlang says.
But for search engines it is important to declare the language, and feed the proper title and site description in the set language.
So, I got french, english and german on my site, and I want everything to adapt to the user's language, including the meta-tags, title, description, keywords, etc. and the HTML language declaration.
edited by: manarak, Jun 15, 2009 - 10:25 PM -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Theme caching enabled??
you only should use the pnRender cache, Theme caching doesn't consider the nocache tags, and that lang should be non included in the cache then, right?
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Softmore
- Registered: Mar 10, 2005
- Last visit: Mar 18, 2010
- Posts: 288
Quote
manarak
you don't need that $lang anyway , I think.
that $lang is different i never use it for following reasons:
1. there are languages that dont have locales defined nor on nix/linux servers (espetially for ancient servers :) ) nor for windows one.
2. language detection from browser settings nether worked for me.
so in all language core files i have 'en_US', 'eng' and charset varies from language to language my case is bilingual so I have for english and Georgian both charset===UTF-8 .
you just change charset not lang in languages/core.php file.
Quote
feed the proper title and site description in the set language.
this things are not translated...
you can define __SITENAME__ and __SITEDESCRIPTION__ in core lang files and add to templates
pnml calls to get this things translated.
why this thing are handwritten in code i dont get..
there is a beautiful approach of internationalization like used in Categories.
you have 1 category with names on several languages.
i'd like to see this way I18n-ed
user profile data and groups
-
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
The lang setting is important, because it helps search engines to include the correct descriptions and titles when people are searching in specific languages.
I'm running a site with several sub-sites (subdomains) for different countries and in several languages.
For example, you could have
uk.mysite.com/en
uk.mysite.com/fr
uk.mysite.com/de
de.mysite.com/de
de.mysite.com/fr
etc.
So, what's needed is the classic older PN multisite setup, along with dynamic languages settings.
Otherwise, what are the odds of getting correct descriptions, keywords and everything for an german search engine indexing de.mysite.fr, if the page's language setting tells it is in english, while the content is french and the site's subject is Germany?
- Moderated by:
- Support
