Layout issues when usin Yii:t()...
#1
Posted 01 June 2010 - 09:31 AM
Anyone has experienced this issue? Am I forgetting some thing?
#2
Posted 01 June 2010 - 01:50 PM
I'm afraid I don't understand what your problem is ? Maybe you could provide more details and code sample ?
#3
Posted 01 June 2010 - 02:45 PM
Raoul, on 01 June 2010 - 01:50 PM, said:
I'm afraid I don't understand what your problem is ? Maybe you could provide more details and code sample ?
Please see the 2 images attached to know what I mean.
On first image before the translation, there isn't another return space between the page title and the breadcrumbs
on second image you can see that the entire content after breadcrumbs gone down one line.
The code analysed on firefox with firebug show the same code but rendered different after translation.
<div class="container"> <div id="content"> <h1>Create new account</h1> <p>Please fill out the following form to create a new account.</p>
after
<div class="container"> <div id="content"> <h1>Criar uma nova conta</h1> <p>Preencha o formulário a seguir para criar uma nova conta.</p> <div class="form">
#4
Posted 01 June 2010 - 03:59 PM
ciao
#5
Posted 01 June 2010 - 04:30 PM
Thank for you interest.
<?php return array( 'About' => 'Sobre', 'April' => 'Abril', 'August' => 'Agosto', 'Birthday' => 'Data de nascimento', 'Can not access your account?' => 'Não consegue acessar sua conta?', 'Clear form' => 'Apagar formulário', 'Clear form anyway?' => 'Deseja realmente apagar formulário?', 'Contact' => 'Contato', 'Create new account' => 'Criar uma nova conta', 'Day' => 'Dia', 'December' => 'Dezembro', 'Email' => 'Email', 'February' => 'Fevereiro', 'Fields with <span class="required">*</span> are required.' => 'Campos com <span class="required">*</span> são obrigatórios.', 'First name' => 'Primeiro nome', 'Home' => 'Início', 'Incorrect username or password' => 'Nome de usuário ou senha inválidos', 'January' => 'Janeiro', 'July' => 'Julho', 'June' => 'Junho', 'Last name' => 'Ultimo nome', 'March' => 'Março', 'May' => 'Maio', 'Month' => 'Mês', 'Name' => 'Nome', 'Names cannot contain numbers or special characters.' => 'Nomes não podem conter números ou caracteres especiais.', 'November' => 'Novembro', 'Password' => 'Senha', 'Password confirmation' => 'Confirmação de senha', 'Please enter the letters as they are shown in the image.' => 'Por favor entre a letras como mostrado na imagem.', 'Please fill out the following form' => 'Por favor preencha o formulário a seguir', 'Please fill out the following form to create a new account.' => 'Preencha o formulário a seguir para criar uma nova conta.', 'Register' => 'Registre-se', 'Registration' => 'Registrar', 'Retrive password' => 'Recuperar senha', 'Secret answer' => 'Resposta de segurança', 'Secret question' => 'Questão de segurança', 'Select one from the list' => 'Selecione uma da lista', 'Send message' => 'Enviar mensagem', 'September' => 'Setembro', 'Sign in' => 'Entrar', 'Sign out' => 'Sair', 'Stay signed in' => 'Continuar conectado', 'Subject' => 'Assunto', 'Thank you' => 'Obrigado', 'Thank you for creating your account. You may now go to login form to enter site.' => 'Obrigado por criar sua conta. Você já pode ir para a área de login e acessar sua conta.', 'Thank you!' => 'Obrigado!', 'This email address already existis in our database.' => 'Este endereço de email já existe em nosso banco de dados.', 'This username already existis.' => 'Este usuário ja existe.', 'to contact us.' => 'para enviar sua mensagem.', 'to create a new account.' => 'para criar uma nova conta.', 'to request a new password.' => 'para solicitar uma nova senha.', 'Username' => 'Nome de usuário', 'Username only can contain letters and numbers.' => 'Nomes de usuário só podem conter letras e números.', 'Username or email' => 'Nome de usuário ou email', 'Verification code' => 'Código de verificação', 'Year' => 'Ano', 'You already have your account. You cannot create a new one. Please go to another page.' => 'Você ja possui uma conta. Você não pode criar outra. Por favor acesse outra página.', "What is your father's middle name?" => 'Qual é o nome do meio do seu pai?', 'What is your favorite car?' => 'Qual é o seu carro favorito?', 'What is your favorite place on world?' => 'Qual é o seu lugar favorito no mundo?', "What is your gradmother's middle name?" => 'Qual é o nome do meio da sua avó?', 'What is your library card number?' => 'Qual é o número do seu cartão da biblioteca?', 'What is your primary frequent flyer number?' => 'Qual é o número do seu cartão de viagens principal?', 'What was your first phone number?' => 'Qual foi o seu primeiro número de telefone?', "What was your first teacher's name?" => 'Qual é o nome do seu primeiro professor?', );
#6
Posted 01 June 2010 - 05:31 PM
ciao
#7
Posted 01 June 2010 - 07:45 PM
#8
Posted 02 June 2010 - 12:30 AM
In one of my view files I had the folllowing:
<?php /* $this CController */ /* $model CActiveRecord */ ?> <?php echo $model->name; ?>
The empty line between the codeblocks caused an extra line in my layout when nothing is outputtet in the first codeblock.
#9
Posted 02 June 2010 - 07:13 AM
Check if the language file is encoded in UTF-8 WITHOUT BOM.
Some editor add this byte that can create problem. Check if the encode of all file is UTF-8 WITHOUT BOM.
#10
Posted 02 June 2010 - 07:40 AM
zaccaria, on 02 June 2010 - 07:13 AM, said:
Check if the language file is encoded in UTF-8 WITHOUT BOM.
Some editor add this byte that can create problem. Check if the encode of all file is UTF-8 WITHOUT BOM.
I think you are right! But i don't know how to do this... Can u help me?
#11
Posted 02 June 2010 - 08:58 AM
It can be in some menu of the editor, or format menu, or preference->encoding, dipends from the editor.
If is encoded with UTF-8 with BOM change to UTF-8 without BOM
#12
Posted 02 June 2010 - 09:33 AM
#13
Posted 03 June 2010 - 05:37 AM
If you are part of some unlucky people, wich has not-ascii character in their language, you have to pay attention to:
- In layout/main.php you should have this line:<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- All files have to be encoded in utf-8 without BOM
- In your dbConnection you should have:
- 'charset' => 'utf8',
- 'initSQLs'=>array('SET NAMES utf8')
- 'charset' => 'utf8',
With all this precaution, you should avoid any problem with encoding, your db will be readable and all character displayed in a proper way.
#14
Posted 03 June 2010 - 03:04 PM
zaccaria, on 03 June 2010 - 05:37 AM, said:
Sorry. My mistake. I meant falling apart.
zaccaria, on 03 June 2010 - 05:37 AM, said:
- In layout/main.php you should have this line:<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- All files have to be encoded in utf-8 without BOM
- In your dbConnection you should have:
- 'charset' => 'utf8',
- 'initSQLs'=>array('SET NAMES utf8')
- 'charset' => 'utf8',
With all this precaution, you should avoid any problem with encoding, your db will be readable and all character displayed in a proper way.
I did this but still not working. I don't understand. I really believe that is something with page encode.

Help
















